Questions tagged «count»

5
Terraform-使用带计数的嵌套循环
我正在尝试在Terraform中使用嵌套循环。我有两个列表变量list_of_allowed_accounts和list_of_images,并且希望遍历list list_of_images,然后遍历list list_of_allowed_accounts。 这是我的Terraform代码。 variable "list_of_allowed_accounts" { type = "list" default = ["111111111", "2222222"] } variable "list_of_images" { type = "list" default = ["alpine", "java", "jenkins"] } data "template_file" "ecr_policy_allowed_accounts" { template = "${file("${path.module}/ecr_policy.tpl")}" vars { count = "${length(var.list_of_allowed_accounts)}" account_id = "${element(var.list_of_allowed_accounts, count.index)}" } } resource "aws_ecr_repository_policy" "repo_policy_allowed_accounts" { count …
18 terraform  count 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.