Soru

Zorluk: KolayAWS CodeDeploy

A developer is configuring a deployment for a containerized application to Amazon ECS using AWS CodeDeploy. The developer is writing the AppSpec file in YAML format to manage the lifecycle of the deployment. Which two of the following configurations are valid and supported in the AppSpec file for this Amazon ECS deployment?

  1. The resources section specifying the target ECS service name, task definition, container name, and container port.Cevap
  2. B
    The files section mapping source files from the application bundle to destination directory paths on the host container instances.
  3. The hooks section executing AWS Lambda validation functions during events like BeforeAllowTraffic or AfterAllowTraffic.Cevap
  4. D
    The hooks section executing shell scripts during the ApplicationStart and ApplicationStop lifecycle events.
  5. E
    The parameters section referencing configuration keys stored in AWS Systems Manager Parameter Store.

Cevap

The correct configurations are the resources section specifying target service and task definition details, and the hooks section executing AWS Lambda functions during ECS lifecycle events.
For an Amazon ECS deployment, AWS CodeDeploy uses the AppSpec file to determine which ECS task definition to deploy and how to validate traffic routing. The resources section is required to specify details such as the target service, task definition, container name, and container port. The hooks section allows developers to trigger validation Lambda functions at specific points in the blue/green deployment workflow (like BeforeAllowTraffic and AfterAllowTraffic) to ensure the new version is healthy before complete traffic cutover.

Adım Adım Çözüm

1
Analyze the target compute platform for the CodeDeploy deployment.
The target platform is Amazon ECS.
The structure and valid parameters of the AppSpec file vary depending on whether the deployment is for EC2/on-premises, AWS Lambda, or Amazon ECS.
2
Determine valid top-level sections for an ECS AppSpec file.
An ECS AppSpec file supports 'version', 'resources', and 'hooks'. It does not support 'files' or 'permissions'.
The resources section defines the ECS task definition and service, while hooks are used to coordinate the blue/green deployment traffic routing.
3
Identify valid lifecycle hooks and execution targets for ECS deployments.
ECS hooks only support AWS Lambda functions as targets. Valid hooks include BeforeInstall, AfterInstall, AfterAllowTestTraffic, BeforeAllowTraffic, and AfterAllowTraffic.
EC2-specific hooks (like ApplicationStart and ApplicationStop) and script execution are unsupported in ECS deployments.

Anahtar Kavram

AWS CodeDeploy AppSpec structure for Amazon ECS compute platform
Tahmini Süre:1m 0s
Bu soruyu puanla