Question

Difficulty: HardAWS Elastic Beanstalk

A developer is deploying an update to a production web application hosted on AWS Elastic Beanstalk. The update must satisfy the following constraints:

* The application must maintain its full capacity of active instances throughout the deployment process to handle consistent user traffic.
* If the new version fails to deploy or pass health checks, the environment must roll back to the previous version automatically and as quickly as possible.
* The update must not require a DNS CNAME swap, as the domain name is mapped to a static resource external to the environment.
* The configuration must be managed programmatically as code inside the application source bundle.

Which configuration file path and content structure will satisfy these requirements?

  1. A
    A file named `.ebextensions/deployment.config` with the following content:

    yaml
    option_settings:
    aws:elasticbeanstalk:command:
    DeploymentPolicy: RollingWithAdditionalBatch
  2. B
    A file named `ebextensions/deployment.config` with the following content:

    yaml
    option_settings:
    aws:elasticbeanstalk:command:
    DeploymentPolicy: Immutable
  3. A file named `.ebextensions/deployment.config` with the following content:

    yaml
    option_settings:
    aws:elasticbeanstalk:command:
    DeploymentPolicy: Immutable
    Answer
  4. D
    A file named `.ebextensions/deployment.config` with the following content:

    yaml
    option_settings:
    aws:elasticbeanstalk:command:
    DeploymentPolicy: AllAtOnce

Answer

A file named `.ebextensions/deployment.config` with the `DeploymentPolicy` set to `Immutable` under the `aws:elasticbeanstalk:command` namespace.
The correct option specifies a file inside the `.ebextensions/` directory with the `DeploymentPolicy` configured as `Immutable`. The Immutable policy meets all requirements: it maintains 100% capacity by deploying a temporary Auto Scaling group, requires no CNAME swap since it updates the existing environment, and performs an immediate, automated rollback by terminating the new Auto Scaling group if the deployment or health checks fail.

Step-by-Step Solution

1
Analyze the capacity and rollback requirements.
The requirement to maintain 100% capacity during updates rules out All at Once and Rolling deployments. The requirement for immediate, automatic rollback rules out Rolling with Additional Batch.
Immutable deployments launch a full set of new instances in a separate Auto Scaling group, keeping the old ones at 100% capacity. If health checks fail, the new Auto Scaling group is terminated instantly.
2
Evaluate the DNS CNAME swap constraint.
The requirement to avoid DNS or CNAME swaps rules out Blue/Green deployments.
Blue/Green deployment requires swapping the CNAMEs of two separate Elastic Beanstalk environments, which violates the constraint.
3
Identify the correct configuration mechanism and folder path.
The configuration must be defined inside the `.ebextensions/` folder at the root of the source bundle.
Elastic Beanstalk configuration files must reside in the `.ebextensions/` directory (with a leading dot). Files in directories without the leading dot, such as `ebextensions/`, are ignored.

Key Concept

AWS Elastic Beanstalk Immutable deployment policy and configuration files
Rate this question