SSM Patch Manager LifeCycleHooks to remove node from TargetGroup

0

Working with AWS SSM to automate the patching of EC2 instances that are part of a target group. As patching will be carried out on live instances without any application downtime, we would like to cleanly remove the EC2 from the target group by de-registering them first and re-register pre and post reboot and patching.

Can this be achieved using say a SSM RunCommand as part of the Patching lifecycle hooks (PreInstall etc) or is there a better method?

profile picture
EXPERT
asked 10 months ago371 views
1 Answer
1
Accepted Answer

Maybe the following Automation runbook provided by AWS will fit your use case.
https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awsec2-patch-load-balancer-instance.html

  1. The load balancer or target group to which the instance is attached is determined, and the instance is verified as healthy.
  2. The instance is removed from the load balancer or target group.
  3. The automation waits for the period of time specified for the connection draining time.
  4. The AWS-RunPatchBaseline automation is called to patch the instance.
  5. The instance is reattached to the load balancer or target group.
profile picture
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
  • AWESOME.. Didnt find this.. Many thanks Riku!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions