aws-samples / aft-workshop-sample

Collection of sample Terraform configuration for AFT workshop
MIT No Attribution
13 stars 22 forks source link

Error launching Cloud9 in AFT-Management acc #9

Closed wellsiau-aws closed 1 year ago

wellsiau-aws commented 1 year ago

PR #8 is using aws_subnet data source that return exactly one subnet that matches the filter

this has causing downstream impact when preparing Cloud9 environment in the AFT Management account:

Error: Invalid function argument
│
│   on main.tf line 37, in resource "aws_cloud9_environment_ec2" "cloud9-aft":
│   37:   subnet_id     = local.vpc.is_use_aft_vpc ? tolist(data.aws_subnet.aft_public_subnet_01[local.vpc.index].id)[0] : null
│     ├────────────────
│     │ while calling tolist(v)
│     │ data.aws_subnet.aft_public_subnet_01 is tuple with 1 element
│     │ local.vpc.index is 0
│
│ Invalid value for "v" parameter: cannot convert string to list of any single type.