A SysOps Administrator is using AWS CloudFormation to update a web application stack. The stack includes an Auto Scaling group (ASG) configured with an AutoScalingRollingUpdate update policy. The update template references a new AMI and a new IAM instance profile for the EC2 instances. During the deployment, the new instances fail to send a success signal to CloudFormation within the PauseTime period because of a misconfiguration in the UserData script. As a result, CloudFormation automatically transitions to the UPDATE_ROLLBACK_IN_PROGRESS state to revert the ASG to its previous launch template. However, the rollback process fails, and the stack status changes to UPDATE_ROLLBACK_FAILED. The error details indicate that CloudFormation is unauthorized to associate the previous IAM instance profile with the EC2 instances. Which action should the administrator take to successfully restore the stack to a stable state?
- Add the iam:PassRole permission for the previous instance profile role to the CloudFormation execution role policy, and then perform the Continue Update Rollback action.Cevap
- BPerform a standard stack update using the CloudFormation Console to remove the new IAM instance profile reference, and then force a new deployment.
- CModify the trust relationship of the old IAM instance profile's role to allow the sts:AssumeRole action for the autoscaling.amazonaws.com service principal, and then retry the update.
- DTerminate all instances in the Auto Scaling group to trigger automatic replacement under the old configuration, and then update the stack with rollback configuration disabled.