Hi everyone,
I have a usecase wherein if a variable named enabled is set to true, I want to get a list of vpcs that have a particular tag. Then for each of the vpc, get the cidr and finally create a security group rule for each of the cidr and assign it to a security group
The idea is as follows
if (var.enabled[var.stage] == true){
Use aws_vpcs data resource to get the ids
for each id, get the cidr block using the aws_vpc data resource to create a list
for each cidr in the list, create the sg rule
}
I am unable to orchestrate the above flow. I am relatively new to Terraform and any help on this would be appreciated. I am currently using TF 0.12.
Thanks