我正在学习本教程,并设法将一切设置好。
https://learn.hashicorp.com/tutorials/terraform/cloud-workspace-configure?in=terraform%2Fcloud-开始
在排队计划时,我得到了以下与变量有关的错误,无法找到它的底部。
有人对如何推进这项工作有什么想法吗?感谢
我希望这将是一个很容易起床和跑步的比赛!
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-助理教程
如果我选择选项";Terraform变量";同时在Terraform Cloud中创建变量。
我通过选择";环境变量";同时创建AWS_ ACCESS_KEY_ID和AWS_。
似乎忘记了步骤"配置工作空间变量";,您需要设置两个环境变量(AWS_SECRET_ACCESS_KEY、AWS_ACCESS_KEY_ID(,然后,所有变量都应该按预期工作。