Question

Difficulty: Very hardAuto Scaling and Elasticity

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.)

  1. 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
  2. Add the iam:PassRole permission for the EC2 instance profile role to the IAM execution role used by the Systems Manager Automation runbook.Answer
  3. C
    Increase 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.
  4. D
    Enable 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.
  5. E
    Replace the Systems Manager Automation target with an AWS Config remediation rule triggered by an Amazon EventBridge rule when the instance state changes to running.

Answer

To resolve these issues, the administrator must increase the estimated instance warmup time on the target tracking scaling policy and add the iam:PassRole permission to the Systems Manager Automation execution role.
To prevent over-provisioning during scaling, the estimated instance warmup must be set to a value higher than the boot and configuration time of the instances. This ensures the scaling policy excludes the warming-up instances from the scaling calculation until they are ready. Additionally, the Systems Manager Automation role requires the iam:PassRole permission to associate the IAM instance profile role with the EC2 instances during runbook execution.

Step-by-Step Solution

1
Analyze why the target tracking policy is launching redundant instances during scale-out.
The target tracking policy uses the estimated instance warmup period to exclude newly launched instances from contributing to the group's metric calculations. Since the default warmup is shorter than the time the instance takes to boot and complete the lifecycle hook, the policy continues scaling out.
Increasing the warmup period prevents the policy from triggering additional scaling actions until the instances are fully initialized.
2
Identify why Systems Manager Automation is failing to run on the instances.
The automation role requires permission to associate the target instance profile with the EC2 instances. Without this permission, the execution fails.
Adding the iam:PassRole permission allows the Systems Manager Automation role to pass the instance profile role to the EC2 instances.

Key Concept

Auto Scaling target tracking policies utilize an estimated instance warmup period to suppress redundant scale-out events. Furthermore, automated configurations integrating with EC2 launch tasks must have correct iam:PassRole permissions to operate on behalf of the user.
Rate this question