skip to Main Content

How can I correct a Terraform, Error: Incorrect attribute value type error?

Here is a the snippets of relevant code: resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" } data "aws_availability_zones" "available" { state = "available" } resource "aws_subnet" "private_subnet" { count = length(data.aws_availability_zones.available.names) vpc_id = aws_vpc.main.id cidr_block = "10.0.${20+count.index}.0/24" availability_zone = data.aws_availability_zones.available.names[count.index]…

VIEW QUESTION

How to list all items in a list in Terraform and what's the for loop equivalent here?

I am kind of new to Terraform and could you help me with the lists in terraform. This is my code variable "ip_bitbucket" { type = "list" } ip_bitbucket = ["34.199.54.113/32","34.232.25.90/32","34.232.119.183/32","34.236.25.177/32","35.171.175.212/32","52.54.90.98/32","52.202.195.162/32","52.203.14.55/32","52.204.96.37/32","34.218.156.209/32","34.218.168.212/32","52.41.219.63/32","35.155.178.254/32","35.160.177.10/32","34.216.18.129/32","3.216.235.48/32","34.231.96.243/32","44.199.3.254/32","174.129.205.191/32","44.199.127.226/32","44.199.45.64/32","3.221.151.112/32","52.205.184.192/32","52.72.137.240/32"] and need to access the list as below resource…

VIEW QUESTION
Back To Top
Search