Course menuDOP-C02

Exams / DOP-C02 / CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) / Question 1

DOP-C02 practice question: CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) (1 of 2)

SDLC Automation A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A hospital network runs its patient-scheduling web application on 60 Linux servers in its own data centers, not on AWS. The servers are not in an Auto Scaling group and cannot be replaced by new instances.

Releases are copied to each server with scripts that stop the web service for several minutes. An error on one server has left the application half-upgraded in the past. The operations team wants releases to roll out in batches, with each server checked after its install and a failed release rolled back automatically.

The servers have outbound HTTPS access to AWS but no inbound access from the internet, and the team wants deployment records kept in AWS.

Which TWO actions meet these requirements? (Choose two.)

Choose two answers.

  1. A. Register each server with AWS CodeDeploy as an on-premises instance by using an IAM user or session ARN, and install the CodeDeploy agent on each server so that it polls the service over HTTPS.
  2. B. Deploy the application with AWS Systems Manager Run Command to all 60 servers at once, running the same install script, and check the results with a command status query afterward.
  3. C. Move the scheduling application onto Amazon EC2 instances in an Auto Scaling group behind a load balancer, and replace the data-center servers with rolling instance refreshes.
  4. D. Add a ValidateService hook to the AppSpec file that calls the application's health endpoint, and set a deployment configuration that updates the fleet in batches and rolls back automatically when a deployment fails.
  5. E. Keep the scripts, but run them as a cron job on each server every night, with a script that restarts the service and writes its log to a central file share.
Show the answer and explanation

Answers: A, D

Explanation

CodeDeploy can deploy to servers outside AWS once they are registered as on-premises instances and run the agent, which polls outbound only. AppSpec hooks run health checks after each install, and a deployment configuration limits how many servers update at a time and rolls back on failure. Run Command, cron jobs and an Auto Scaling migration do not give the same gating.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks)? The 5 full-length practice sets have 9 more CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets