-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: aws_vpc_endpoint
resource: private_dns_enabled
effectively stuck on true
.
#37694
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Acceptance tests are actually failing too (related to #37628): $ git checkout v5.50.0 --quiet
$ git show --oneline --no-patch --no-show-signature
f00a84434b (HEAD, tag: v5.50.0) Merge pull request #37518 from acwwat/d-aws_cloudfront_distribution-improve_origin_ssl_protocols_arg_desc
$ make testacc PKG=ec2 TESTS="TestAccVPCEndpoint_interfaceBasic" ACCTEST_TIMEOUT=10m
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCEndpoint_interfaceBasic' -timeout 10m
=== RUN TestAccVPCEndpoint_interfaceBasic
=== PAUSE TestAccVPCEndpoint_interfaceBasic
=== CONT TestAccVPCEndpoint_interfaceBasic
--- PASS: TestAccVPCEndpoint_interfaceBasic (70.64s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 70.792s
$ git checkout v5.51.0 --quiet
$ git show --oneline --no-patch --no-show-signature
50b6108103 (HEAD, tag: v5.51.0) Update CHANGELOG.md (Manual Trigger)
$ make testacc PKG=ec2 TESTS="TestAccVPCEndpoint_interfaceBasic" ACCTEST_TIMEOUT=10m
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCEndpoint_interfaceBasic' -timeout 10m
=== RUN TestAccVPCEndpoint_interfaceBasic
=== PAUSE TestAccVPCEndpoint_interfaceBasic
=== CONT TestAccVPCEndpoint_interfaceBasic
vpc_endpoint_test.go:72: Step 1/2 error: Error running apply: exit status 1
Error: creating EC2 VPC Endpoint (com.amazonaws.eu-west-1.ec2): operation error EC2: CreateVpcEndpoint, https response error StatusCode: 400, RequestID: 61c8e7df-0d50-4260-8542-f271bfe52523, api error InvalidParameter: Enabling private DNS requires both enableDnsSupport and enableDnsHostnames VPC attributes set to true for vpc-0ca7434b02619f9c2
with aws_vpc_endpoint.test,
on terraform_plugin_test.tf line 22, in resource "aws_vpc_endpoint" "test":
22: resource "aws_vpc_endpoint" "test" {
--- FAIL: TestAccVPCEndpoint_interfaceBasic (9.59s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/ec2 9.830s
FAIL
make: *** [GNUmakefile:630: testacc] Error 1
$ git checkout v5.50.0 -- internal/service/ec2/vpc_endpoint.go
$ make testacc PKG=ec2 TESTS="TestAccVPCEndpoint_interfaceBasic" ACCTEST_TIMEOUT=10m
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCEndpoint_interfaceBasic' -timeout 10m
=== RUN TestAccVPCEndpoint_interfaceBasic
=== PAUSE TestAccVPCEndpoint_interfaceBasic
=== CONT TestAccVPCEndpoint_interfaceBasic
--- PASS: TestAccVPCEndpoint_interfaceBasic (120.15s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 120.276s |
private_dns_enabled
effectively stuck on true
.aws_vpc_endpoint
resource: private_dns_enabled
effectively stuck on true
.
Just want to add that once the endpoint has been wrongly created with Private DNS enabled, running tf apply again will update the resource to disable the feature. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.53.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.8.4
AWS Provider Version
5.51.0, 5.51.1
Affected Resource(s)
aws_vpc_endpoint
Expected Behavior
The
aws_vpc_endpoint.private_dns_enabled
attribute should be respected, i.e. setting tofalse
(or leaving undefined) should not attempt to create Route 53 resources.Actual Behavior
Regardless of whether the
aws_vpc_endpoint.private_dns_enabled
attribute is set totrue
/false
/ undefined, it always attempts to create Route 53 resources.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Optionally:
Steps to Reproduce
Apply the above configuration with an arbitrary (unused) AWS VPC endpoint name, e.g.
terraform init terraform apply -var "vpce_service_name=com.amazonaws.eu-west-2.iot.fleethub.api"
Debug Output
When executing the above configuration as-is, it produces the following error:
This error is unexpected, because enabling DNS for the VPC should not be required.
For science / completeness, one can additionally configure
aws_vpc.enable_dns_hostnames = true
andaws_vpc.enable_dns_support = true
and re-run from scratch (e.g. usingterraform test
) to produce the subsequent error:which is still unexpected, because private DNS for the VPC endpoint was not requested.
Panic Output
No response
Important Factoids
Seems to be a regression with
hashicorp/aws:5.51.0
, because reverting to5.50.0
does not have this problem. I've also reproduced the problem with5.51.1
in the last few minutes, just in case. 🙂I initially encountered the
aws_route53_zone
error described above, which is why I've included it in the issue description. It was only after further investigation that I realised it is probably unrelated toaws_route53_zone
and instead related toaws_vpc_endpoint
.References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: