hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

[Enhancement]: Implementing the Termination Hook in CodeDeploy's deployment environment #35366

Open shblue21 opened 8 months ago

shblue21 commented 8 months ago

Description

Hello, last month the CodeDeploy AutoScaling Termination Hook feature was released and I would like to implement it.
Previously, autoscaling would crash the application when a scale-in event occurred (as the instance was shut down).
With Hooks, you can now use CodeDeploy's LifeCycle flow to shut down your application normally.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_codedeploy_deployment_group" "example" {
  app_name              = aws_codedeploy_app.example.name
  deployment_group_name = "example-group"
  service_role_arn      = aws_iam_role.example.arn
  autoscaling_groups = "deploy-asg"

...
  termination_hook_enabled = true
...

}

References

Would you like to implement a fix?

Yes

github-actions[bot] commented 8 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

Jeff-SearchPilot commented 1 month ago

Is the PR planned to be merged? This feature has been GA for 9 months and there's no way to manage it in tf

shblue21 commented 1 month ago

@Jeff-SearchPilot I haven't received any feedback from reviewers since adding this feature, so I'll double check. The Termination Hook is quite useful.