AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 187

A DevOps engineer has created an AWS CloudFormation template that deploys an application on Amazon EC2 instances. The EC2 instances run Amazon Linux. The application is deployed to the EC2 instances by using shell scripts that contain user data. The EC2 instances have an IAM instance profile that has an IAM role with the AmazonSSMManagedinstanceCore managed policy attached.

The DevOps engineer has modified the user data in the CloudFormation template to install a new version of the application. The engineer has also applied the stack update. However, the application was not updated on the running EC2 instances. The engineer needs to ensure that the changes to the application are installed on the running EC2 instances.

Which combination of steps will meet these requirements? (Choose two.)

Answer options

Correct answer: B, E

Explanation

Option B is correct because using the cfn-init helper script allows for the application to be updated in response to changes in the CloudFormation stack, ensuring that metadata changes are applied. Option E is also correct as it utilizes Systems Manager State Manager to maintain the desired state of the application. The other options either do not address the specific need to update running instances or involve more complex setups that are unnecessary for this requirement.