A SysOps administrator is configuring an Auto Scaling group (ASG) to deploy EC2 instances using a new launch template. The launch template specifies an IAM instance profile associated with the IAM role 'AppExecutionRole'. During a scale-out event, the ASG fails to launch new instances. The ASG activity history shows the following error:
'Launching a new EC2 instance failed. Status Reason: User: arn:aws:iam::123456789012:user/SysOpsAdmin is not authorized to perform: iam:PassRole on resource: arn:aws:iam::123456789012:role/AppExecutionRole'
Which action must the administrator take to successfully launch the instances?
- Attach an IAM policy to the SysOpsAdmin user that grants the iam:PassRole permission for the AppExecutionRole resource.Cevap
- BModify the trust policy of the AppExecutionRole to allow the autoscaling.amazonaws.com service principal to perform sts:AssumeRole.
- CIncrease the default cooldown period of the Auto Scaling group to allow the IAM role propagation to complete before the next launch attempt.
- DEnable detailed monitoring in the launch template to reduce the time required for CloudWatch to verify the authorization status of the instance profile.
Cevap
Attach an IAM policy to the SysOpsAdmin user that grants the iam:PassRole permission for the AppExecutionRole resource.
The correct action is to attach an IAM policy to the SysOpsAdmin user that grants the iam:PassRole permission for the AppExecutionRole resource. This permission is required when a user creates or updates an Auto Scaling group with a launch template containing an IAM instance profile, ensuring the user is authorized to pass the role to the EC2 instances being launched.
Adım Adım Çözüm
Anahtar Kavram
IAM PassRole Permission in Auto Scaling Launch Templates
Tahmini Süre:2m 0s