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

resource/aws_ami: Fixes eventual consistency errors #34691

Merged
merged 5 commits into from
Dec 7, 2023
Merged

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Dec 1, 2023

Description

The parameters description and deprecation_time are set or modified using eventually consistent operations. This was causing them to not be updated in Terraform state.

Also affects aws_ami_from_instance and aws_ami_copy

Output from Acceptance Testing

% make testacc PKG=ec2 TESTS='TestAccEC2AMI_|TestAccEC2AMICopy_|TestAccEC2AMIFromInstance_'

--- PASS: TestAccEC2AMI_ephemeralBlockDevices (1049.53s)
--- PASS: TestAccEC2AMI_gp3BlockDevice (1058.41s)
--- PASS: TestAccEC2AMI_imdsSupport (1066.79s)
--- PASS: TestAccEC2AMI_tpmSupport (1071.75s)
--- PASS: TestAccEC2AMI_disappears (1074.21s)
--- PASS: TestAccEC2AMI_boot (1075.10s)
--- PASS: TestAccEC2AMI_basic (1086.15s)
--- PASS: TestAccEC2AMIFromInstance_basic (1140.95s)
--- PASS: TestAccEC2AMIFromInstance_disappears (1155.93s)
--- PASS: TestAccEC2AMICopy_basic (1173.47s)
--- PASS: TestAccEC2AMICopy_enaSupport (1175.05s)
--- PASS: TestAccEC2AMI_description (1243.46s)
--- PASS: TestAccEC2AMI_tags (1359.69s)
--- PASS: TestAccEC2AMICopy_description (1366.41s)
--- PASS: TestAccEC2AMI_deprecateAt (1378.52s)
--- PASS: TestAccEC2AMIFromInstance_tags (1396.37s)
--- PASS: TestAccEC2AMICopy_tags (1473.40s)

Copy link

github-actions bot commented Dec 1, 2023

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 size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ec2 Issues and PRs that pertain to the ec2 service. labels Dec 1, 2023
Copy link

github-actions bot commented Dec 1, 2023

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to additionally mention aws_ami_from_instance and aws_ami_copy?

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. eventual-consistency Pertains to eventual consistency issues. labels Dec 5, 2023
Copy link
Contributor

@ewbankkit ewbankkit 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=TestAccEC2AMI_\|TestAccEC2AMICopy_\|TestAccEC2AMIFromInstance_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccEC2AMI_\|TestAccEC2AMICopy_\|TestAccEC2AMIFromInstance_ -timeout 360m
=== RUN   TestAccEC2AMICopy_basic
=== PAUSE TestAccEC2AMICopy_basic
=== RUN   TestAccEC2AMICopy_description
=== PAUSE TestAccEC2AMICopy_description
=== RUN   TestAccEC2AMICopy_enaSupport
=== PAUSE TestAccEC2AMICopy_enaSupport
=== RUN   TestAccEC2AMICopy_destinationOutpost
=== PAUSE TestAccEC2AMICopy_destinationOutpost
=== RUN   TestAccEC2AMICopy_tags
=== PAUSE TestAccEC2AMICopy_tags
=== RUN   TestAccEC2AMIFromInstance_basic
=== PAUSE TestAccEC2AMIFromInstance_basic
=== RUN   TestAccEC2AMIFromInstance_tags
=== PAUSE TestAccEC2AMIFromInstance_tags
=== RUN   TestAccEC2AMIFromInstance_disappears
=== PAUSE TestAccEC2AMIFromInstance_disappears
=== RUN   TestAccEC2AMI_basic
=== PAUSE TestAccEC2AMI_basic
=== RUN   TestAccEC2AMI_deprecateAt
=== PAUSE TestAccEC2AMI_deprecateAt
=== RUN   TestAccEC2AMI_description
=== PAUSE TestAccEC2AMI_description
=== RUN   TestAccEC2AMI_disappears
=== PAUSE TestAccEC2AMI_disappears
=== RUN   TestAccEC2AMI_ephemeralBlockDevices
=== PAUSE TestAccEC2AMI_ephemeralBlockDevices
=== RUN   TestAccEC2AMI_gp3BlockDevice
=== PAUSE TestAccEC2AMI_gp3BlockDevice
=== RUN   TestAccEC2AMI_tags
=== PAUSE TestAccEC2AMI_tags
=== RUN   TestAccEC2AMI_outpost
=== PAUSE TestAccEC2AMI_outpost
=== RUN   TestAccEC2AMI_boot
=== PAUSE TestAccEC2AMI_boot
=== RUN   TestAccEC2AMI_tpmSupport
=== PAUSE TestAccEC2AMI_tpmSupport
=== RUN   TestAccEC2AMI_imdsSupport
=== PAUSE TestAccEC2AMI_imdsSupport
=== CONT  TestAccEC2AMICopy_basic
=== CONT  TestAccEC2AMI_description
--- PASS: TestAccEC2AMI_description (103.25s)
=== CONT  TestAccEC2AMI_outpost
    acctest.go:1157: skipping since no Outposts found
--- SKIP: TestAccEC2AMI_outpost (0.47s)
=== CONT  TestAccEC2AMI_imdsSupport
--- PASS: TestAccEC2AMICopy_basic (142.25s)
=== CONT  TestAccEC2AMI_tpmSupport
--- PASS: TestAccEC2AMI_imdsSupport (73.01s)
=== CONT  TestAccEC2AMI_boot
--- PASS: TestAccEC2AMI_tpmSupport (73.45s)
=== CONT  TestAccEC2AMIFromInstance_basic
--- PASS: TestAccEC2AMI_boot (72.21s)
=== CONT  TestAccEC2AMI_deprecateAt
--- PASS: TestAccEC2AMI_deprecateAt (135.52s)
=== CONT  TestAccEC2AMI_basic
--- PASS: TestAccEC2AMI_basic (74.06s)
=== CONT  TestAccEC2AMICopy_destinationOutpost
    acctest.go:1157: skipping since no Outposts found
--- SKIP: TestAccEC2AMICopy_destinationOutpost (0.49s)
=== CONT  TestAccEC2AMICopy_tags
--- PASS: TestAccEC2AMIFromInstance_basic (310.44s)
=== CONT  TestAccEC2AMIFromInstance_disappears
--- PASS: TestAccEC2AMICopy_tags (188.54s)
=== CONT  TestAccEC2AMIFromInstance_tags
--- PASS: TestAccEC2AMIFromInstance_disappears (319.38s)
=== CONT  TestAccEC2AMI_gp3BlockDevice
--- PASS: TestAccEC2AMI_gp3BlockDevice (74.24s)
=== CONT  TestAccEC2AMICopy_enaSupport
--- PASS: TestAccEC2AMICopy_enaSupport (142.82s)
=== CONT  TestAccEC2AMI_tags
--- PASS: TestAccEC2AMIFromInstance_tags (421.09s)
=== CONT  TestAccEC2AMI_ephemeralBlockDevices
--- PASS: TestAccEC2AMI_ephemeralBlockDevices (76.03s)
=== CONT  TestAccEC2AMICopy_description
--- PASS: TestAccEC2AMI_tags (117.44s)
=== CONT  TestAccEC2AMI_disappears
--- PASS: TestAccEC2AMI_disappears (70.23s)
--- PASS: TestAccEC2AMICopy_description (165.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1316.129s

@gdavison gdavison merged commit 0264242 into main Dec 7, 2023
57 checks passed
@gdavison gdavison deleted the b-acctest-ec2-ami branch December 7, 2023 01:24
@github-actions github-actions bot added this to the v5.30.0 milestone Dec 7, 2023
github-actions bot pushed a commit that referenced this pull request Dec 7, 2023
Copy link

github-actions bot commented Dec 7, 2023

This functionality has been released in v5.30.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!

Copy link

github-actions bot commented Jan 7, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. eventual-consistency Pertains to eventual consistency issues. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants