更具体地说,adjustment_type不断(似乎)在每个terraform plan上得到更新。为什么要这样做,可以避免呢?
Terraform will perform the following actions:
# aws_autoscaling_policy.this will be updated in-place
~ resource "aws_autoscaling_policy" "this" {
+ adjustment_type = "ChangeInCapacity"
下面是自动
我在跑完后用aws-保险库来存放我的部下
docker-compose -f deploy/docker-compose.yml run --rm terraform init
我搞错了
Initializing the backend...
Error: error using credentials to get account ID: error calling sts:GetCallerIdentity: InvalidClientTokenId: The security token included in the request is invalid
status cod
我正在尝试创建一个IAM角色/策略,以使我的EC2实例能够列出并附加EBS卷(通过调用aws cli的脚本)。我希望此策略仅允许列出/附加具有特定标签的EBS卷。 我注意到,当我在下面的策略中设置了Resources: "*"和no Conditions时,该脚本能够列出/附加卷。但只要我引入下面的策略,AWS cli就会抛出以下错误: ./aws ec2 describe-volumes
An error occurred (UnauthorizedOperation) when calling the DescribeVolumes operation: You are
我正在尝试使用concat来组合两个子网列表
我最初也尝试在这两个子网上使用join,但失败了,出现了错误:
join: argument 1 should be type string, got type list in:
我现在正在尝试对相同的字符串使用concat,当它们组合在一起时,将导致一个抛出另一个错误的列表。
conditional operator cannot be used with list values
我现在的代码如下:
subnet_ids = ["${split(",",(terraform.workspace == &
我试图用gcp提供商使用terraform云,这是一个非常基本的用例。
主要的问题是--我如何提供google提供商作为云版本terraform的一个变量?我已经添加了JSON变量并按照指示删除了\n,但是在运行terraform apply时它仍然抛出unexpected end of JSON input
在google文档或google页面上的terraform文档中,没有提到terraform云的文档。
我已经超过了谷歌的第10页搜索各种没有运气,我真的不能使用terraform云与GCP最基本的任务和缺乏支持围绕这个问题是令人震惊的。
盒式可空底层类型可以将转换为enum,但不能将转换为可空类型。
同样的,
盒式可空枚举可以将转换为底层类型,但不能将转换为可空枚举。
好的,我知道“框空类型”不是描述它的最好方法,但这是为了这个问题。我知道是底层的值类型被装箱了。
我将举例说明这一点。假设我有一个以enum为基础类型的int。
enum Sex { Male, Female }
案例一:
int? i = 1;
object o = i;
Sex e = (Sex)o; //success
//but
Sex e = Sex.Male;
object o = e;
int? i = (int?)o;
上下文:尽管这个问题与有关,但并不完全相同。
我不能分享我确切的TF配置,但是我的想法是我要给一个空的“对象已经在Terraform之外改变了”警告消息?
$ terraform plan
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply":
Unless you have made equivalent changes to yo
我正在尝试从terraform远程状态获取一些引用,并注意到了terraform state资源/数据与使用terraform_remote_state数据对象之间的一些差异。
例如,我有一个terraform模块,它创建了一个AWS托管目录,没有输出。在该模块中,我可以看到状态中的所有资源-例如,terraform state show aws_directory_service_directory.ad给出了目录的详细信息-目录ID、DNS服务器地址等等。
$ terraform state list
aws_directory_service_directory.ad
$ terrafo
当第一个属性为空或未定义时,寻找一种巧妙的方法从对象访问第二个非空属性,使用ES6对象解构。
ES5等效项:
var obj = { a: null, b: 2 };
var num = obj.a || obj.b; // num = 2
使用ES6 (类似于):
const { num: a || b } = obj; // <- how to achieve the above effect here?
我需要帮助处理Terraform上的以下错误,当我运行terraform应用程序时,当我检查aws控制台时,一切似乎都正常,但最后我得到了以下错误:
Error: error reading Main Route Table Association (subnet-09b6d028942d15d8e): empty result
│
│ with aws_main_route_table_association.a,
│ on main.tf line 55, in resource "aws_main_route_table_association" "a