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

codedeploy/deployment_group: add outdated instances strategy parameters #33844

Conversation

shblue21
Copy link
Contributor

@shblue21 shblue21 commented Oct 9, 2023

Description

The outdated_instances_strategy property is required in the deployment group of codedeploy.
This is a rarely used value, but it can prevent duplicate deployments when auto scaling.

Relations

Closes #33811

References

AWS Note: https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-groups-configure-advanced-options.html
AWS API: https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeploymentGroup.html
GO SDK: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#OutdatedInstancesStrategy

Output from Acceptance Testing

$ make testacc TESTS=TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update PKG=deploy
TF_ACC=1 go test ./internal/service/deploy/... -v -count 1 -parallel 20 -run='TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update'  -timeout 360m
=== RUN   TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
=== PAUSE TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
=== CONT  TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
--- PASS: TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update (176.12s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/deploy     176.215s
...
$ make testacc TESTS=TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore PKG=deploy
TF_ACC=1 go test ./internal/service/deploy/... -v -count 1 -parallel 20 -run='TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore'  -timeout 360m
=== RUN   TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
=== PAUSE TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
=== CONT  TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
--- PASS: TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore (203.19s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/deploy     203.289s

...

@github-actions
Copy link

github-actions bot commented Oct 9, 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/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/deploy Issues and PRs that pertain to the deploy service. labels Oct 9, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 9, 2023
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Oct 12, 2023
@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 12, 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=TestAccDeployDeploymentGroup_' PKG=deploy ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/deploy/... -v -count 1 -parallel 2  -run=TestAccDeployDeploymentGroup_ -timeout 360m
=== RUN   TestAccDeployDeploymentGroup_basic
=== PAUSE TestAccDeployDeploymentGroup_basic
=== RUN   TestAccDeployDeploymentGroup_Basic_tagSet
=== PAUSE TestAccDeployDeploymentGroup_Basic_tagSet
=== RUN   TestAccDeployDeploymentGroup_onPremiseTag
=== PAUSE TestAccDeployDeploymentGroup_onPremiseTag
=== RUN   TestAccDeployDeploymentGroup_disappears
=== PAUSE TestAccDeployDeploymentGroup_disappears
=== RUN   TestAccDeployDeploymentGroup_Disappears_app
=== PAUSE TestAccDeployDeploymentGroup_Disappears_app
=== RUN   TestAccDeployDeploymentGroup_tags
=== PAUSE TestAccDeployDeploymentGroup_tags
=== RUN   TestAccDeployDeploymentGroup_Trigger_basic
=== PAUSE TestAccDeployDeploymentGroup_Trigger_basic
=== RUN   TestAccDeployDeploymentGroup_Trigger_multiple
=== PAUSE TestAccDeployDeploymentGroup_Trigger_multiple
=== RUN   TestAccDeployDeploymentGroup_AutoRollback_create
=== PAUSE TestAccDeployDeploymentGroup_AutoRollback_create
=== RUN   TestAccDeployDeploymentGroup_AutoRollback_update
=== PAUSE TestAccDeployDeploymentGroup_AutoRollback_update
=== RUN   TestAccDeployDeploymentGroup_AutoRollback_delete
=== PAUSE TestAccDeployDeploymentGroup_AutoRollback_delete
=== RUN   TestAccDeployDeploymentGroup_AutoRollback_disable
=== PAUSE TestAccDeployDeploymentGroup_AutoRollback_disable
=== RUN   TestAccDeployDeploymentGroup_Alarm_create
=== PAUSE TestAccDeployDeploymentGroup_Alarm_create
=== RUN   TestAccDeployDeploymentGroup_Alarm_update
=== PAUSE TestAccDeployDeploymentGroup_Alarm_update
=== RUN   TestAccDeployDeploymentGroup_Alarm_delete
=== PAUSE TestAccDeployDeploymentGroup_Alarm_delete
=== RUN   TestAccDeployDeploymentGroup_Alarm_disable
=== PAUSE TestAccDeployDeploymentGroup_Alarm_disable
=== RUN   TestAccDeployDeploymentGroup_DeploymentStyle_default
=== PAUSE TestAccDeployDeploymentGroup_DeploymentStyle_default
=== RUN   TestAccDeployDeploymentGroup_DeploymentStyle_create
=== PAUSE TestAccDeployDeploymentGroup_DeploymentStyle_create
=== RUN   TestAccDeployDeploymentGroup_DeploymentStyle_update
=== PAUSE TestAccDeployDeploymentGroup_DeploymentStyle_update
=== RUN   TestAccDeployDeploymentGroup_DeploymentStyle_delete
=== PAUSE TestAccDeployDeploymentGroup_DeploymentStyle_delete
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfo_create
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfo_create
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfo_update
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfo_update
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfo_delete
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfo_delete
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_create
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_create
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_update
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_update
=== RUN   TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_delete
=== PAUSE TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_delete
=== RUN   TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_create
=== PAUSE TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_create
=== RUN   TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_update
=== PAUSE TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_update
=== RUN   TestAccDeployDeploymentGroup_BlueGreenDeployment_create
=== PAUSE TestAccDeployDeploymentGroup_BlueGreenDeployment_create
=== RUN   TestAccDeployDeploymentGroup_BlueGreenDeployment_updateWithASG
=== PAUSE TestAccDeployDeploymentGroup_BlueGreenDeployment_updateWithASG
=== RUN   TestAccDeployDeploymentGroup_BlueGreenDeployment_update
=== PAUSE TestAccDeployDeploymentGroup_BlueGreenDeployment_update
=== RUN   TestAccDeployDeploymentGroup_BlueGreenDeployment_delete
=== PAUSE TestAccDeployDeploymentGroup_BlueGreenDeployment_delete
=== RUN   TestAccDeployDeploymentGroup_BlueGreenDeployment_complete
=== PAUSE TestAccDeployDeploymentGroup_BlueGreenDeployment_complete
=== RUN   TestAccDeployDeploymentGroup_ECS_blueGreen
=== PAUSE TestAccDeployDeploymentGroup_ECS_blueGreen
=== RUN   TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
=== PAUSE TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
=== RUN   TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
=== PAUSE TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
=== CONT  TestAccDeployDeploymentGroup_basic
=== CONT  TestAccDeployDeploymentGroup_DeploymentStyle_update
--- PASS: TestAccDeployDeploymentGroup_DeploymentStyle_update (52.70s)
=== CONT  TestAccDeployDeploymentGroup_AutoRollback_update
--- PASS: TestAccDeployDeploymentGroup_basic (77.79s)
=== CONT  TestAccDeployDeploymentGroup_DeploymentStyle_create
--- PASS: TestAccDeployDeploymentGroup_AutoRollback_update (52.45s)
=== CONT  TestAccDeployDeploymentGroup_DeploymentStyle_default
--- PASS: TestAccDeployDeploymentGroup_DeploymentStyle_create (43.73s)
=== CONT  TestAccDeployDeploymentGroup_Alarm_disable
--- PASS: TestAccDeployDeploymentGroup_DeploymentStyle_default (37.33s)
=== CONT  TestAccDeployDeploymentGroup_Alarm_delete
--- PASS: TestAccDeployDeploymentGroup_Alarm_disable (54.67s)
=== CONT  TestAccDeployDeploymentGroup_Alarm_update
--- PASS: TestAccDeployDeploymentGroup_Alarm_delete (54.13s)
=== CONT  TestAccDeployDeploymentGroup_Alarm_create
--- PASS: TestAccDeployDeploymentGroup_Alarm_update (52.89s)
=== CONT  TestAccDeployDeploymentGroup_AutoRollback_disable
--- PASS: TestAccDeployDeploymentGroup_Alarm_create (34.25s)
=== CONT  TestAccDeployDeploymentGroup_AutoRollback_delete
--- PASS: TestAccDeployDeploymentGroup_AutoRollback_disable (54.07s)
=== CONT  TestAccDeployDeploymentGroup_tags
--- PASS: TestAccDeployDeploymentGroup_AutoRollback_delete (54.85s)
=== CONT  TestAccDeployDeploymentGroup_AutoRollback_create
--- PASS: TestAccDeployDeploymentGroup_AutoRollback_create (37.02s)
=== CONT  TestAccDeployDeploymentGroup_Trigger_multiple
--- PASS: TestAccDeployDeploymentGroup_tags (73.34s)
=== CONT  TestAccDeployDeploymentGroup_Trigger_basic
--- PASS: TestAccDeployDeploymentGroup_Trigger_multiple (56.15s)
=== CONT  TestAccDeployDeploymentGroup_disappears
--- PASS: TestAccDeployDeploymentGroup_Trigger_basic (54.05s)
=== CONT  TestAccDeployDeploymentGroup_Disappears_app
--- PASS: TestAccDeployDeploymentGroup_disappears (39.52s)
=== CONT  TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_update
--- PASS: TestAccDeployDeploymentGroup_Disappears_app (39.30s)
=== CONT  TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore
--- PASS: TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_update (54.31s)
=== CONT  TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update
--- PASS: TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_ignore (36.83s)
=== CONT  TestAccDeployDeploymentGroup_ECS_blueGreen
--- PASS: TestAccDeployDeploymentGroup_ECS_blueGreen (323.64s)
=== CONT  TestAccDeployDeploymentGroup_BlueGreenDeployment_complete
--- PASS: TestAccDeployDeploymentGroup_OutdatedInstancesStrategy_update (35.99s)
=== CONT  TestAccDeployDeploymentGroup_BlueGreenDeployment_delete
--- PASS: TestAccDeployDeploymentGroup_BlueGreenDeployment_complete (56.29s)
=== CONT  TestAccDeployDeploymentGroup_BlueGreenDeployment_update
--- PASS: TestAccDeployDeploymentGroup_BlueGreenDeployment_delete (55.59s)
=== CONT  TestAccDeployDeploymentGroup_BlueGreenDeployment_updateWithASG
--- PASS: TestAccDeployDeploymentGroup_BlueGreenDeployment_update (52.29s)
=== CONT  TestAccDeployDeploymentGroup_BlueGreenDeployment_create
--- PASS: TestAccDeployDeploymentGroup_BlueGreenDeployment_create (161.29s)
=== CONT  TestAccDeployDeploymentGroup_onPremiseTag
--- PASS: TestAccDeployDeploymentGroup_BlueGreenDeployment_updateWithASG (211.66s)
=== CONT  TestAccDeployDeploymentGroup_Basic_tagSet
--- PASS: TestAccDeployDeploymentGroup_onPremiseTag (36.30s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfo_update
--- PASS: TestAccDeployDeploymentGroup_Basic_tagSet (65.31s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfo_delete
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfo_update (55.78s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfo_create
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfo_delete (53.32s)
=== CONT  TestAccDeployDeploymentGroup_DeploymentStyle_delete
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfo_create (34.79s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_delete
--- PASS: TestAccDeployDeploymentGroup_DeploymentStyle_delete (53.39s)
=== CONT  TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_create
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_delete (53.30s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_update
--- PASS: TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_create (42.74s)
=== CONT  TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_create
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_update (51.39s)
--- PASS: TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_create (33.53s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/deploy	1029.658s

@ewbankkit
Copy link
Contributor

@shblue21 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit f3794b1 into hashicorp:main Oct 12, 2023
41 checks passed
@github-actions github-actions bot added this to the v5.21.0 milestone Oct 12, 2023
@github-actions
Copy link

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

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 Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/deploy Issues and PRs that pertain to the deploy service. size/M 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.

[Enhancement]: Support outdated_instances_strategy parameters for aws_codedeploy_deployment_group
2 participants