Terraform: How to create multiple aws subnets from one resource block?

前端 未结 2 624
借酒劲吻你
借酒劲吻你 2021-01-16 02:23

I\'m trying to create multiple subnets from one resource block and I get the following error

Error: aws_subnet.private: cidr_block must be a single v

2条回答
  •  有刺的猬
    2021-01-16 02:58

    private_subnet is a list, so you should pick a single element, e.g.

    cidr_block = "${element(var.private_subnet,count.index)}"

提交回复
热议问题