You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only when trying to perform a terraform import I run into the following:
Error: Invalid for_each argument
│
│ on .terraform/modules/vpc_endpoints/modules/vpc-endpoints/main.tf line 72, in module "gateway_endpoint_label":
│ 72: for_each = local.enabled ? data.aws_vpc_endpoint_service.gateway_endpoint_service : {}
│ ├────────────────
│ │ data.aws_vpc_endpoint_service.gateway_endpoint_service will be known only after apply
│ │ local.enabled is true
│
│ The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot
│ predict how many instances will be created. To work around this, use the -target argument to first apply only the
│ resources that the for_each depends on.
My VPC endpoint does not contain a gateway_vpc_endpoints. I think this is because the module uses local.enabled for the existence of either a gateway or interface VPC endpoint rather than toggling them on individually. Or I'm doing it completely wrong. I'm doing:
Add some resource to import. I added resource "aws_s3_bucket" "test_bucket" {bucket=test_name}. It doesn't even have to exist, you just need a resource to target
Accidentally found out this issue doesn't exist in later versions of tf. We're moving to 1.4.6. Leaving the issue open in case it compels any changes to the module. Otherwise feel free to close it or it can expire or whatever. Thanks.
Describe the Bug
Only when trying to perform a
terraform import
I run into the following:My VPC endpoint does not contain a
gateway_vpc_endpoints
. I think this is because the module useslocal.enabled
for the existence of either a gateway or interface VPC endpoint rather than toggling them on individually. Or I'm doing it completely wrong. I'm doing:Expected Behavior
No error on import
Steps to Reproduce
Steps to reproduce the behavior:
resource "aws_s3_bucket" "test_bucket" {bucket=test_name}
. It doesn't even have to exist, you just need a resource to targetterraform import aws_s3_bucket.test_bucket something-that-doesnt-exist-and-thats-ok
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: