exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 196 discussion

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

  • A. Configure the user data content to use the Multipurpose Internet Mail Extensions (MIME) multipart format. Set the scripts-user parameter to always in the text/cloud-config section.
  • B. Refactor the user data commands to use the cfn-init helper script. Update the user data to install and configure the cfn-hup and cfn-init helper scripts to monitor and apply the metadata changes.
  • C. Configure an EC2 launch template for the EC2 instances. Create a new EC2 Auto Scaling group. Associate the Auto Scaling group with the EC2 launch template. Use the AutoScalingScheduledAction update policy for the Auto Scaling group.
  • D. Refactor the user data commands to use an AWS Systems Manager document (SSM document). Add an AWS CLI command in the user data to use Systems Manager Run Command to apply the SSM document to the EC2 instances.
  • E. Refactor the user data command to use an AWS Systems Manager document (SSM document). Use Systems Manager State Manager to create an association between the SSM document and the EC2 instances.
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
vortegon
Highly Voted 8 months, 1 week ago
Selected Answer: BE
B and E are the most effective in ensuring that updates to the application are installed on the running EC2 instances by leveraging CloudFormation's and AWS Systems Manager's capabilities for managing and applying updates.
upvoted 8 times
...
Srikantha
Most Recent 2 weeks, 6 days ago
Selected Answer: BE
The best combination of steps to ensure the application is updated on the running EC2 instances during a CloudFormation stack update is: B. Refactor the user data commands to use the cfn-init helper script. Update the user data to install and configure the cfn-hup and cfn-init helper scripts to monitor and apply the metadata changes. D. Refactor the user data commands to use an AWS Systems Manager document (SSM document). Add an AWS CLI command in the user data to use Systems Manager Run Command to apply the SSM document to the EC2 instances.
upvoted 1 times
...
dkp
6 months, 1 week ago
Selected Answer: BE
B&E D. Systems Manager Run Command (with user data): Using Run Command within user data to apply an SSM document introduces an unnecessary step. Option E with State Manager automates the process.
upvoted 3 times
...
WhyIronMan
6 months, 3 weeks ago
Selected Answer: BE
B, E. "Association" is the key. Details are everything during an Investigation...
upvoted 2 times
...
Seoyong
6 months, 3 weeks ago
Selected Answer: E
User data is executed when the system starts, not executed in runing EC2.
upvoted 1 times
...
vmahilevskyi
6 months, 3 weeks ago
Selected Answer: BE
EC2 instance profile with AmazonSSMManagedinstanceCore policy doesn't have permissions to SSM Run Command, so D is incorrect. So for me it's BE.
upvoted 3 times
...
ogerber
7 months ago
Selected Answer: BE
"Add an AWS CLI command in the user data to use Systems Manager Run Command to apply the SSM document to the EC2 instances." **Add an AWS CLI command in the ****user data***** it will not help to update running instances, tricky question. Only Systems Manager State Manager will update the running instances in this question
upvoted 2 times
...
fdoxxx
7 months, 3 weeks ago
B and D A. This option is not applicable for updating applications on EC2 instances. B. Refactoring the user data commands to use the cfn-init helper script helps in handling metadata changes and applying them to the EC2 instances. This is especially useful in CloudFormation stack updates. C. Creating a new EC2 Auto Scaling group with an update policy doesn't necessarily address the application update requirement in this scenario. D. Refactoring the user data commands to use an AWS Systems Manager document and using Run Command to apply the SSM document is a valid approach for updating applications on EC2 instances. E. While using Systems Manager documents and State Manager is a valid approach, it might be more complex than needed for a straightforward update of an application on EC2 instances. Therefore, options B and D together provide a good solution for updating the application on the running EC2 instances.
upvoted 1 times
...
Ramdi1
8 months, 1 week ago
Selected Answer: BD
ption B: cfn-init is a powerful tool for managing configuration on EC2 instances. By using cfn-init, the DevOps engineer can ensure that the new application version is installed regardless of the current state of the instances Option D: SSM documents provide a centralized and reusable way to manage configurations. By using Run Command, the engineer can trigger the application update on all instances directly from the template.
upvoted 1 times
Ramdi1
8 months, 1 week ago
Options A, C, and E are not suitable for this scenario:   Option A: MIME multipart format isn't necessary for this scenario. Option C: While Auto Scaling offers flexibility, creating a new launch template and Auto Scaling group is unnecessary for a simple application update. Option E: State Manager is generally used for ongoing configuration management, not one-time deployments like this.   By using both cfn-init and SSM documents, the DevOps engineer can achieve a reliable and manageable way to update the application on the running EC2 instances.
upvoted 1 times
...
...
thanhnv142
8 months, 1 week ago
Selected Answer: BD
B and D: A: irrelevant B: cfn-init is perfectly correct for this purpose C: irrelevant. The question does not mention autoscaling group D: <Systems Manager Run Command > can help install packages, so it is correct E: < Systems Manager State Manager> is used to maintain, not to update
upvoted 2 times
...
Ramdi1
8 months, 1 week ago
Selected Answer: BD
Here's why these options are correct: Option B: cfn-init is a powerful tool for managing configuration on EC2 instances. By using cfn-init, the DevOps engineer can ensure that the new application version is installed regardless of the current state of the instances. cfn-hup helps keep cfn-init updated with the latest configuration changes.   Option D: SSM documents provide a centralized and reusable way to manage configurations. By using Run Command, the engineer can trigger the application update on all instances directly from the template. This approach allows for easier management and updates in the future.
upvoted 2 times
...
hotblooded
8 months, 2 weeks ago
Selected Answer: BD
cfn-hup to chek for updates in cloudformation and ssm run command to run commands if required for application
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago