-
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
Fix aws_ec2_instance_connect_endpoint/fips_dns_name in non-US regions #37939
Fix aws_ec2_instance_connect_endpoint/fips_dns_name in non-US regions #37939
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @arax 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Q: I'm wondering how to properly write acc tests for behavior that depends on specific AWS regions being selected for the test. As shown above in the |
# Conflicts: # internal/service/ec2/ec2_instance_connect_endpoint.go
…anceConnectEndpoint_nonFIPSRegion'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% AWS_DEFAULT_REGION=ap-northeast-1 make testacc TESTARGS='-run=TestAccEC2InstanceConnectEndpoint_nonFIPSRegion' PKG=ec2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2InstanceConnectEndpoint_nonFIPSRegion -timeout 360m
2024/12/27 12:22:16 Initializing Terraform AWS Provider...
=== RUN TestAccEC2InstanceConnectEndpoint_nonFIPSRegion
=== PAUSE TestAccEC2InstanceConnectEndpoint_nonFIPSRegion
=== CONT TestAccEC2InstanceConnectEndpoint_nonFIPSRegion
--- PASS: TestAccEC2InstanceConnectEndpoint_nonFIPSRegion (254.53s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 260.294s
% make testacc TESTARGS='-run=TestAccEC2InstanceConnectEndpoint_basic\|TestAccEC2InstanceConnectEndpoint_fipsRegion' PKG=ec2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2InstanceConnectEndpoint_basic\|TestAccEC2InstanceConnectEndpoint_fipsRegion -timeout 360m
2024/12/27 12:29:16 Initializing Terraform AWS Provider...
=== RUN TestAccEC2InstanceConnectEndpoint_basic
=== PAUSE TestAccEC2InstanceConnectEndpoint_basic
=== RUN TestAccEC2InstanceConnectEndpoint_fipsRegion
=== PAUSE TestAccEC2InstanceConnectEndpoint_fipsRegion
=== CONT TestAccEC2InstanceConnectEndpoint_basic
=== CONT TestAccEC2InstanceConnectEndpoint_fipsRegion
--- PASS: TestAccEC2InstanceConnectEndpoint_basic (362.31s)
--- PASS: TestAccEC2InstanceConnectEndpoint_fipsRegion (364.85s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 370.237s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
@arax Thanks for the contribution 🎉 👏. |
Description
Outside of FIPS-supported regions (us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, ca-west-1, us-gov-east-1, us-gov-west-1) AWS API responses for EICE do not contain the
FipsDnsName
property. That leaves the resource in an infinitefips_dns_name = (known after apply)
loop and results in crashes on apply.This makes sure
fips_dns_name
is initialized with an empty string if theFipsDnsName
property is missing from the AWS API response.This does not change the resource's documented behavior or the behavior covered by tests.
Relations
Closes #37920
References
TestAcc Output
For
us-east-1
:For
eu-west-1
: