Skip to content
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

r/aws_instance: Set public_dns and public_ip as newly Computed if instance is stopped/started #40710

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Dec 27, 2024

Description

Set public_dns and public_ip as newly Computed if an aws_instance update would stop then start the instance as this may result in an IP address change -- see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses.

Relations

Closes #6781.
Closes #10720.
Closes #20651.
Closes #24690.
Closes #33726.

Output from Acceptance Testing

% make testacc TESTARGS='-run=^TestAccEC2Instance_changeInstanceType' 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=^TestAccEC2Instance_changeInstanceType -timeout 360m
2024/12/27 14:05:09 Initializing Terraform AWS Provider...
=== RUN   TestAccEC2Instance_changeInstanceType
=== PAUSE TestAccEC2Instance_changeInstanceType
=== RUN   TestAccEC2Instance_changeInstanceTypeReplace
=== PAUSE TestAccEC2Instance_changeInstanceTypeReplace
=== RUN   TestAccEC2Instance_changeInstanceTypeAndUserData
=== PAUSE TestAccEC2Instance_changeInstanceTypeAndUserData
=== RUN   TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== PAUSE TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== CONT  TestAccEC2Instance_changeInstanceType
=== CONT  TestAccEC2Instance_changeInstanceTypeAndUserData
=== CONT  TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== CONT  TestAccEC2Instance_changeInstanceTypeReplace
--- PASS: TestAccEC2Instance_changeInstanceTypeReplace (257.49s)
--- PASS: TestAccEC2Instance_changeInstanceType (304.14s)
--- PASS: TestAccEC2Instance_changeInstanceTypeAndUserDataBase64 (494.12s)
--- PASS: TestAccEC2Instance_changeInstanceTypeAndUserData (555.97s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	561.513s

…p` attributes when changing `instance_type`, `user_data`, or `user_data_base64`.
@ewbankkit ewbankkit requested a review from a team as a code owner December 27, 2024 19:37
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ec2 Issues and PRs that pertain to the ec2 service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Dec 27, 2024
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Dec 27, 2024
Copy link
Contributor

@nam054 nam054 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

> make testacc TESTARGS='-run=^TestAccEC2Instance_changeInstanceType' 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=^TestAccEC2Instance_changeInstanceType -timeout 360m
2024/12/30 11:57:40 Initializing Terraform AWS Provider...
=== RUN   TestAccEC2Instance_changeInstanceType
=== PAUSE TestAccEC2Instance_changeInstanceType
=== RUN   TestAccEC2Instance_changeInstanceTypeReplace
=== PAUSE TestAccEC2Instance_changeInstanceTypeReplace
=== RUN   TestAccEC2Instance_changeInstanceTypeAndUserData
=== PAUSE TestAccEC2Instance_changeInstanceTypeAndUserData
=== RUN   TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== PAUSE TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== CONT  TestAccEC2Instance_changeInstanceType
=== CONT  TestAccEC2Instance_changeInstanceTypeAndUserData
=== CONT  TestAccEC2Instance_changeInstanceTypeAndUserDataBase64
=== CONT  TestAccEC2Instance_changeInstanceTypeReplace
--- PASS: TestAccEC2Instance_changeInstanceTypeAndUserDataBase64 (463.68s)
--- PASS: TestAccEC2Instance_changeInstanceType (548.22s)
--- PASS: TestAccEC2Instance_changeInstanceTypeReplace (606.09s)
--- PASS: TestAccEC2Instance_changeInstanceTypeAndUserData (701.85s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        708.698s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants