A SysOps administrator uses AWS CloudFormation to manage a production stack that includes an Amazon EC2 Auto Scaling group (ASG) behind an Application Load Balancer. The administrator attempts to update the application by modifying the CloudFormation template to use a new launch template. The new launch template specifies a new IAM instance profile with a new IAM role. The CloudFormation stack update is initiated using a dedicated IAM execution role.
During the deployment, the update fails on the ASG resource, causing CloudFormation to transition the stack to the UPDATE_ROLLBACK_IN_PROGRESS state. Shortly after, the stack status changes to UPDATE_ROLLBACK_FAILED. The CloudFormation event log shows an access denied error stating that CloudFormation is not authorized to associate the old IAM instance profile's role with the ASG's launch template.
How should the administrator resolve this issue to allow the rollback to complete successfully?
- AModify the trust policy of the original IAM role to allow the autoscaling.amazonaws.com service principal to assume the role, and then initiate an UpdateStack API call with the previous template version.
- BManually delete the resources that failed to roll back, update the administrator's IAM user policy to include sts:AssumeRole for the Auto Scaling service role, and then recreate the stack from the previous template.
- Update the IAM policy attached to the CloudFormation execution role to include the iam:PassRole permission for the original IAM role used in the previous launch template, and then execute the ContinueUpdateRollback action on the stack.Answer
- DTemporarily detach the Application Load Balancer from the Auto Scaling group to halt traffic, perform a manual in-place deployment of the previous application version to the instances, and then delete the failed CloudFormation stack.