A SysOps administrator manages an Amazon EC2 Auto Scaling group (ASG) that uses a target tracking scaling policy based on the Average CPU Utilization metric. The ASG has a scale-out lifecycle hook (InstanceLaunching) configured to run a custom security scanning script on new instances using AWS Systems Manager (SSM) Automation.
During a sudden increase in traffic, the administrator observes the following behavior:
- The ASG launches redundant batches of instances every few minutes before the previous instances complete the security scan, leading to significant over-provisioning.
- The SSM Automation fails to run on the newly launched instances, causing the lifecycle hook to eventually time out and terminate the instances.
Which actions should the administrator take to resolve these issues? (Select TWO.)
- Increase the estimated instance warmup time on the target tracking scaling policy to exceed the combined duration of the instance boot time and the lifecycle hook execution.Answer
- Add the iam:PassRole permission for the EC2 instance profile role to the IAM execution role used by the Systems Manager Automation runbook.Answer
- CIncrease the default cooldown period of the Auto Scaling group to prevent the target tracking policy from launching new instances while others are in the hook state.
- DEnable detailed monitoring in the Auto Scaling group launch template to reduce the CloudWatch metric collection interval to 1 minute, allowing the target tracking policy to stabilize faster.
- EReplace the Systems Manager Automation target with an AWS Config remediation rule triggered by an Amazon EventBridge rule when the instance state changes to running.