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

EC2: API idempotency #27561

Merged
merged 13 commits into from
Oct 31, 2022
Merged

EC2: API idempotency #27561

merged 13 commits into from
Oct 31, 2022

Conversation

ewbankkit
Copy link
Contributor

Description

Uses the EC2 API ClientToken where applicable to ensure API idempotency.

Relations

Closes #27543.

AMI changes - Relates #27083.

References

EC2 API Reference: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccEC2Instance_withIAMInstanceProfile' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2Instance_withIAMInstanceProfile -timeout 180m
=== RUN   TestAccEC2Instance_withIAMInstanceProfile
=== PAUSE TestAccEC2Instance_withIAMInstanceProfile
=== RUN   TestAccEC2Instance_withIAMInstanceProfilePath
=== PAUSE TestAccEC2Instance_withIAMInstanceProfilePath
=== CONT  TestAccEC2Instance_withIAMInstanceProfile
=== CONT  TestAccEC2Instance_withIAMInstanceProfilePath
--- PASS: TestAccEC2Instance_withIAMInstanceProfilePath (118.69s)
--- PASS: TestAccEC2Instance_withIAMInstanceProfile (129.70s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	133.578s
% make testacc TESTARGS='-run=TestAccEC2Host_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2Host_basic -timeout 180m
=== RUN   TestAccEC2Host_basic
=== PAUSE TestAccEC2Host_basic
=== CONT  TestAccEC2Host_basic
--- PASS: TestAccEC2Host_basic (19.93s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	24.429s
% make testacc TESTARGS='-run=TestAccEC2AMICopy_basic\|TestAccEC2AMIFromInstance_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2AMICopy_basic\|TestAccEC2AMIFromInstance_basic -timeout 180m
=== RUN   TestAccEC2AMICopy_basic
=== PAUSE TestAccEC2AMICopy_basic
=== RUN   TestAccEC2AMIFromInstance_basic
=== PAUSE TestAccEC2AMIFromInstance_basic
=== CONT  TestAccEC2AMICopy_basic
=== CONT  TestAccEC2AMIFromInstance_basic
--- PASS: TestAccEC2AMIFromInstance_basic (267.72s)
--- PASS: TestAccEC2AMICopy_basic (381.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	388.656s
% make testacc TESTARGS='-run=TestAccVPCEgressOnlyInternetGateway_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCEgressOnlyInternetGateway_basic -timeout 180m
=== RUN   TestAccVPCEgressOnlyInternetGateway_basic
=== PAUSE TestAccVPCEgressOnlyInternetGateway_basic
=== CONT  TestAccVPCEgressOnlyInternetGateway_basic
--- PASS: TestAccVPCEgressOnlyInternetGateway_basic (32.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	36.357s
% make testacc TESTARGS='-run=TestAccVPCFlowLog_vpcID' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCFlowLog_vpcID -timeout 180m
=== RUN   TestAccVPCFlowLog_vpcID
=== PAUSE TestAccVPCFlowLog_vpcID
=== CONT  TestAccVPCFlowLog_vpcID
--- PASS: TestAccVPCFlowLog_vpcID (37.15s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	41.431s
% make testacc TESTARGS='-run=TestAccVPCNATGateway_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCNATGateway_basic -timeout 180m
=== RUN   TestAccVPCNATGateway_basic
=== PAUSE TestAccVPCNATGateway_basic
=== CONT  TestAccVPCNATGateway_basic
--- PASS: TestAccVPCNATGateway_basic (160.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	165.162s
% make testacc TESTARGS='-run=TestAccEC2EBSVolume_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2EBSVolume_basic -timeout 180m
=== RUN   TestAccEC2EBSVolume_basic
=== PAUSE TestAccEC2EBSVolume_basic
=== CONT  TestAccEC2EBSVolume_basic
--- PASS: TestAccEC2EBSVolume_basic (39.30s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	43.688s
% make testacc TESTARGS='-run=TestAccVPCEndpoint_gatewayBasic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCEndpoint_gatewayBasic -timeout 180m
=== RUN   TestAccVPCEndpoint_gatewayBasic
=== PAUSE TestAccVPCEndpoint_gatewayBasic
=== CONT  TestAccVPCEndpoint_gatewayBasic
--- PASS: TestAccVPCEndpoint_gatewayBasic (34.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	38.569s
% make testacc TESTARGS='-run=TestAccEC2SpotInstanceRequest_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2SpotInstanceRequest_basic -timeout 180m
=== RUN   TestAccEC2SpotInstanceRequest_basic
=== PAUSE TestAccEC2SpotInstanceRequest_basic
=== CONT  TestAccEC2SpotInstanceRequest_basic
--- PASS: TestAccEC2SpotInstanceRequest_basic (75.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	79.407s

@github-actions
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.

@ewbankkit ewbankkit changed the title F ec2 api idempotency EC2: API idempotency Oct 31, 2022
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. service/ec2ebs Issues and PRs that pertain to the ec2ebs service. service/vpc Issues and PRs that pertain to the vpc service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 31, 2022
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Oct 31, 2022
@ewbankkit ewbankkit merged commit 31de51c into main Oct 31, 2022
@ewbankkit ewbankkit deleted the f-ec2-api-idempotency branch October 31, 2022 21:41
@github-actions github-actions bot added this to the v4.38.0 milestone Oct 31, 2022
github-actions bot pushed a commit that referenced this pull request Oct 31, 2022
@github-actions
Copy link

github-actions bot commented Nov 3, 2022

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

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

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 Dec 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2ebs Issues and PRs that pertain to the ec2ebs service. service/ec2 Issues and PRs that pertain to the ec2 service. service/vpc Issues and PRs that pertain to the vpc 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.

[Bug]: Duplicate EC2 instances created
1 participant