gpt4 book ai didi

terraform - 通过云教程使用变量的问题

转载 作者:行者123 更新时间:2023-12-05 03:50:34 25 4
gpt4 key购买 nike

我正在学习本教程并设法设置一切正常。

https://learn.hashicorp.com/tutorials/terraform/cloud-workspace-configure?in=terraform%2Fcloud-get-started

在对计划进行排队时,我收到以下与变量相关的错误,但无法深入了解。

有人对如何推进这个有任何想法吗?谢谢

希望这将是一个很好的简单启动和运行!

Configuring remote state backend...
Initializing Terraform configuration...

Warning: Value for undeclared variable

The root module does not declare a variable named "tag_user_name" but a value
was found in file "/terraform/terraform.tfvars". To use this value, add a
"variable" block to the configuration.

Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization, use TF_VAR_...
environment variables to set these instead.


Error: No value for required variable

on variables.tf line 6:
6: variable "aws_access_key_id" {

The root module input variable "aws_access_key_id" is not set, and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.


Error: No value for required variable

on variables.tf line 10:
10: variable "aws_secret_access_key" {

The root module input variable "aws_secret_access_key" is not set, and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.

最佳答案

我正在按照此处描述的步骤操作,但我遇到了类似的问题: https://learn.hashicorp.com/tutorials/terraform/aws-remote?in=terraform/certification-associate-tutorials

如果我在 Terraform Cloud 中创建变量时选择“Terraform 变量”选项,则会向我显示上述错误。

我通过在创建 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 变量时选择“环境变量”解决了这个问题。

关于terraform - 通过云教程使用变量的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63402545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com