Deployment Strategies

83 questions

Question 21Question

A company is deploying a new version of a microservice on Amazon ECS (Fargate) behind an Application Load Balancer (ALB). The deployment uses AWS CodeDeploy to perform a blue/green deployment. The ALB is configured with two target groups: one for production traffic on port 80, and one for test traffic on port 8080.

The deployment must satisfy the following requirements:
1. Route 10%10\% of production traffic to the replacement task set (Green) initially, and then route the remaining 90%90\% after a 15-minute wait period.
2. Run automated validation tests against the replacement task set using the test traffic port (8080) before any production traffic is shifted.
3. Automatically roll back the deployment if the validation tests fail or if a CloudWatch alarm monitoring 5XX errors triggers during the 15-minute wait period.

Which configuration should the developer specify in the CodeDeploy deployment configuration and the AppSpec file to meet these requirements?

Show answer & explanation

Answer: Use CodeDeployDefault.ECSCanary10Percent15Minutes as the deployment configuration. In the AppSpec file, specify the validation test Lambda function under the AfterAllowTestTraffic hook.

Answer

Use CodeDeployDefault.ECSCanary10Percent15Minutes as the deployment configuration and run the validation tests under the AfterAllowTestTraffic hook in the AppSpec file.
The configuration using CodeDeployDefault.ECSCanary10Percent15Minutes correctly implements the required traffic shifting (10% initially, wait 15 minutes, then shift the remaining 90%). In an ECS blue/green deployment, the AfterAllowTestTraffic hook is executed after the test listener begins routing traffic to the green task set, making it the correct place to run validation tests on port 8080 before production traffic begins shifting.

Step-by-Step Solution

1
Analyze the traffic shifting requirement
The requirement is to route 10% of traffic initially, wait 15 minutes, and then route the remaining 90%. This matches the Canary deployment pattern with a 10% initial shift and a 15-minute bake period, represented by the built-in configuration CodeDeployDefault.ECSCanary10Percent15Minutes.
Choosing the correct deployment configuration ensures traffic shifting conforms to the SLA and rollback windows.
2
Identify the lifecycle hook for testing on the test port
The AfterAllowTestTraffic hook is run immediately after the test listener starts routing test traffic to the replacement task set, but before any production traffic is shifted. This is the correct lifecycle hook to trigger a Lambda function to perform validation tests.
Placing validation tests in the correct lifecycle hook ensures that failures can trigger a rollback before production users are affected.
3
Configure the rollback mechanism
If the validation Lambda function fails (returns a failure status to CodeDeploy) or if the CloudWatch alarm triggers during the 15-minute baking period, CodeDeploy will automatically initiate a rollback to the original task set.
Ensures the deployment is safe and automatically rolls back on error detection.

Key Concept

AWS CodeDeploy ECS Blue/Green Deployment Lifecycle Hooks and Deployment Configurations
Estimated Time:3m 0s
Question 22Question

A developer is designing a deployment strategy for a high-traffic microservice running on Amazon ECS (Fargate). The service has a desired count of 8 tasks. Due to strict vCPU and memory service quotas in the AWS region, the deployment process must never run more than the 8 desired tasks at any point during the update. Additionally, to handle baseline traffic and prevent downtime, at least 4 healthy tasks must remain in service throughout the deployment. Which deployment strategy and configuration should the developer choose to meet these requirements?

Show answer & explanation

Answer: An ECS rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%.

Answer

An ECS rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%.
The correct strategy is a rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%. In Amazon ECS, setting the minimum healthy percent to 50% with a desired task count of 8 guarantees that at least 4 tasks (8 * 0.50) will remain running and healthy at all times during the deployment, preventing downtime. Setting the maximum percent to 100% restricts the total number of tasks to 8 (8 * 1.00), ensuring the service never exceeds the desired task count and respects the strict resource quotas. ECS will stop 4 old tasks first to make room under the 100% limit, start 4 new tasks, wait for them to become healthy, and then repeat the process for the remaining tasks.

Step-by-Step Solution

1
Analyze the constraints given in the scenario.
Desired count is 8 tasks. Maximum allowed concurrent tasks is 8 (100% of desired). Minimum required healthy tasks is 4 (50% of desired).
This establishes the bounds for the maximum capacity percent and the minimum healthy capacity percent.
2
Evaluate the rolling update configuration options against the constraints.
A minimum healthy percent of 50% (4 tasks) and a maximum percent of 100% (8 tasks) matches the capacity bounds exactly.
ECS calculates these percentages relative to the desired task count to determine how many tasks can be stopped and started during a deployment.
3
Evaluate the Blue/Green deployment option.
CodeDeploy Blue/Green deployments for ECS spin up a full replacement task set (8 additional tasks, totaling 16), which violates the resource quota constraint.
Blue/Green deployment requires duplicate resource capacity during the cutover phase.

Key Concept

Configuring rolling update parameters (minimumHealthyPercent and maximumPercent) in Amazon ECS to control deployment capacity limits and maintain service availability.
Estimated Time:2m 0s
Question 23Question

An organization runs an internal test environment on AWS Elastic Beanstalk. The system administrator wants to update the application version with zero budget for temporary resource overhead, meaning no additional EC2 instances can be launched during the update. A temporary reduction in application performance or brief downtime is acceptable during the process. Which of the following deployment strategies can be used to meet these requirements? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: All at once; Rolling

Answer

The correct deployment strategies are All at once and Rolling.
The All at once and Rolling deployment strategies perform the update on the existing EC2 instances in the environment. Neither strategy provisions additional instances, ensuring that no extra costs are incurred. The All at once strategy updates all instances simultaneously (causing downtime), whereas the Rolling strategy updates instances in batches (temporarily reducing capacity), both of which fit within the allowed constraints.

Step-by-Step Solution

1
Analyze the resource and cost constraints.
The scenario requires zero additional budget for temporary resource overhead, meaning no new EC2 instances can be provisioned.
This rules out any deployment strategies that launch new instances (e.g., Rolling with additional batch, Immutable, and Blue/Green).
2
Analyze the availability and capacity constraints.
Temporary capacity reduction or complete downtime is acceptable during the update.
This allows for strategies that take instances out of service or deploy to all instances simultaneously.
3
Identify strategies matching both criteria.
All at once updates all existing instances at once (causing downtime but no extra cost). Rolling updates existing instances in batches (reducing capacity but no extra cost). Both satisfy the constraints.
Both strategies perform in-place deployments on existing instances without provisioning new ones.

Key Concept

AWS Elastic Beanstalk Deployment Strategies and Cost Trade-offs
Estimated Time:1m 0s
Question 24Question

A developer is planning the deployment strategy for a critical, high-volume API hosted on AWS Elastic Beanstalk. The API is highly sensitive to performance fluctuations under load and must maintain 100%100\% of its provisioned capacity throughout the deployment process. Additionally, company compliance requires that the update must be deployed onto brand-new EC2 instances to ensure compliance with a fresh OS base image, and any deployment failure must support an immediate rollback to minimize service disruption. Which two AWS Elastic Beanstalk deployment strategies should the developer choose to satisfy these requirements? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Immutable; Traffic Splitting

Answer

The correct strategies are Immutable and Traffic Splitting because both launch a separate, temporary Auto Scaling group to host the new version on brand-new instances while keeping the original instances fully operational, thereby maintaining 100%100\% capacity and allowing for immediate rollback if a failure occurs.
The correct strategies are the ones that deploy to a temporary Auto Scaling group rather than performing in-place updates. The Immutable strategy creates a parallel Auto Scaling group with the new version, maintaining 100%100\% capacity on the old instances, and swaps traffic once healthy. Similarly, the Traffic Splitting strategy launches a temporary Auto Scaling group and routes a set percentage of traffic to it to perform canary testing. Both options use brand-new EC2 instances and support fast, clean rollbacks by destroying the temporary resources.

Step-by-Step Solution

1
Analyze the capacity requirement
The requirement to maintain 100%100\% capacity eliminates the standard Rolling strategy, which takes batches of existing instances offline during the deployment, and the All at once strategy, which takes all instances offline.
Maintaining capacity ensures no performance degradation occurs under high-volume load.
2
Analyze the infrastructure requirement
The requirement to deploy the new application version onto brand-new EC2 instances eliminates the Rolling with additional batch strategy. While it launches an initial extra batch, subsequent batches are updated in-place on the existing EC2 instances.
Compliance policies often require fresh operating system baselines rather than patching running hosts.
3
Evaluate the remaining strategies against rollback requirements
Both Immutable and Traffic Splitting deployment strategies satisfy all conditions. They launch a temporary Auto Scaling group with the new application version, keeping the existing environment fully scaled, and allow an immediate rollback by terminating the new group if health checks fail.
Validating both strategies confirms they fulfill the capacity, new instance, and rapid rollback criteria.

Key Concept

AWS Elastic Beanstalk Deployment Policies and Strategies
Question 25Question

A developer needs to deploy an update to a non-production web application running in an AWS Elastic Beanstalk environment. The update must be deployed as quickly as possible, and the developer can tolerate a brief period of downtime during the deployment. Additionally, no new EC2 instances should be provisioned to avoid temporary cost increases. Which deployment policy should the developer select?

Show answer & explanation

Answer: All at once

Answer

All at once
The 'All at once' deployment policy is the fastest way to deploy an update because it deploys the new application version to all instances at the same time. Since it uses the existing instances in-place without launching new ones, it incurs no additional costs. While it causes temporary downtime because all instances are out of service during the update, this is acceptable under the given constraints.

Step-by-Step Solution

1
Analyze the deployment constraints.
The requirements specify: maximum speed of deployment, acceptable downtime, and no additional EC2 instances (zero extra cost).
Understanding the constraints is necessary to choose the correct AWS Elastic Beanstalk deployment policy.
2
Evaluate the deployment policies against the constraints.
The 'All at once' policy stops all instances, deploys the new version, and starts them up. This is the fastest method, uses only existing instances (no extra cost), but causes downtime. Other methods like Rolling, Rolling with additional batch, or Immutable focus on avoiding downtime, which increases deployment duration and, in some cases, temporary resource costs.
Comparing available deployment policies identifies the policy that matches the constraints.

Key Concept

AWS Elastic Beanstalk deployment policies and their trade-offs between speed, cost, and availability.
Question 26Question

A developer is updating a serverless application where traffic is routed to an AWS Lambda function. The developer needs to update the function version using AWS CodeDeploy so that 10%10\% of the traffic is routed to the new version for a 1010-minute trial period, after which all remaining traffic is routed to the new version. Which AWS CodeDeploy deployment configuration meets this requirement?

Show answer & explanation

Answer: CodeDeployDefault.LambdaCanary10Percent10Minutes

Answer

CodeDeployDefault.LambdaCanary10Percent10Minutes
The configuration CodeDeployDefault.LambdaCanary10Percent10Minutes shifts 10%10\% of the traffic to the new Lambda version immediately, waits for a 1010-minute interval to monitor for errors or alarms, and then shifts the remaining 90%90\% of the traffic to the new version.

Step-by-Step Solution

1
Analyze the traffic routing requirements.
The requirements specify shifting a small portion (10%10\%) of traffic initially, holding it for a trial period (1010 minutes), and then shifting the remaining traffic (90%90\%) all at once.
This matches a canary deployment pattern rather than a linear or all-at-once deployment pattern.
2
Identify the correct AWS CodeDeploy deployment configuration prefix for AWS Lambda.
The configuration must start with the prefix 'CodeDeployDefault.Lambda'.
CodeDeploy uses specific prefixes depending on the compute platform (Lambda, ECS, or EC2/On-Premises).
3
Select the configuration that matches Canary 10%10\% with a 1010-minute interval.
CodeDeployDefault.LambdaCanary10Percent10Minutes fits this description exactly.
The 'Canary10Percent10Minutes' suffix routes 10%10\% of traffic to the new version and then routes the rest after 1010 minutes.

Key Concept

AWS CodeDeploy configurations for AWS Lambda support Canary deployments (shifting a percentage of traffic for a set time before shifting the rest) and Linear deployments (shifting equal increments of traffic at regular intervals).
Question 27Question

A developer is planning an update for a non-critical internal application deployed on AWS Elastic Beanstalk. Because the application has low usage, the developer wants to minimize deployment duration and is comfortable with the environment's capacity being temporarily reduced or offline during the update. Which two Elastic Beanstalk deployment strategies will result in a temporary reduction of active instance capacity during the deployment? (Select TWO).

Select all that apply

Show answer & explanation

Answer: All-at-once; Rolling

Answer

All-at-once and Rolling
The correct strategies are All-at-once and Rolling. The All-at-once strategy deploys the update to all instances at the same time, which temporarily takes all instances out of service and reduces active capacity to zero. The Rolling strategy updates the environment in batches, taking one batch of instances out of service at a time, which temporarily reduces the overall active capacity of the environment.

Step-by-Step Solution

1
Analyze the capacity behavior of each Elastic Beanstalk deployment strategy.
Identify how each strategy handles active instances during an update.
The requirement specifies selecting strategies that temporarily reduce the active instance capacity of the environment.
2
Evaluate which strategies take existing instances out of service without pre-provisioning replacement capacity.
All-at-once takes all instances out of service simultaneously. Rolling takes a subset (batch) of instances out of service at a time.
Both of these strategies deploy directly to existing instances in-place, leading to a temporary reduction in capacity.
3
Verify that the remaining strategies maintain 100% capacity.
Rolling with additional batch, Immutable, and Traffic splitting all provision new instances before taking old ones out of service to maintain full capacity.
Confirming these strategies are incorrect because they preserve full capacity during deployment.

Key Concept

Understanding the impact of AWS Elastic Beanstalk deployment strategies on environment capacity and instance count.
Question 28Question

A developer is configuring an in-place deployment in AWS CodeDeploy for an application running on a fleet of 1212 Amazon EC2 instances. To prevent performance degradation during peak hours, the application must maintain at least 75%75\% of its serving capacity online and healthy at all times during the update. The developer wants to configure the deployment to update the maximum number of instances simultaneously while strictly adhering to this availability constraint. Which configuration should the developer use?

Show answer & explanation

Answer: Create a custom deployment configuration with Minimum Healthy Hosts defined as a type of FLEET_PERCENT with a value of 7575.

Answer

Create a custom deployment configuration with Minimum Healthy Hosts defined as a type of FLEET_PERCENT with a value of 7575.
The correct option ensures that 75%75\% of the instance capacity (99 instances) remains healthy and online during the deployment. This allows CodeDeploy to update the remaining 33 instances (25%25\%) in parallel, completing the deployment as quickly as possible without violating the availability threshold.

Step-by-Step Solution

1
Calculate the minimum number of healthy instances required.
At least 99 instances must remain online (12×0.75=912 \times 0.75 = 9).
This establishes the target capacity baseline that cannot be breached during the rolling update.
2
Evaluate the maximum number of instances that can be updated simultaneously.
A maximum of 33 instances can be updated at any given time (129=312 - 9 = 3).
To complete the deployment as fast as possible, CodeDeploy should update the maximum allowable instances (33) in each batch.
3
Determine the type and value for the Minimum Healthy Hosts parameter.
Set Minimum Healthy Hosts to a type of FLEET_PERCENT with a value of 7575 (or HOST_COUNT with a value of 99).
Using FLEET_PERCENT with 75%75\% ensures that 99 instances remain online. The predefined configurations (such as HalfAtATime) or setting HOST_COUNT to 33 would violate the constraint or deploy slower than necessary.

Key Concept

Custom deployment configurations in AWS CodeDeploy allow developers to define availability requirements using the Minimum Healthy Hosts parameter, specified as either a percentage or absolute host count.
Estimated Time:2m 0s
Question 29Question

A developer needs to update an Amazon ECS service that runs behind an Application Load Balancer. To prevent any service degradation, the service must maintain 100% of its desired task capacity at all times during the update. Additionally, the service is allowed to provision up to double its desired capacity temporarily to perform the rolling update. Which configuration of deployment parameters should the developer apply to the ECS service?

Show answer & explanation

Answer: Set the minimum healthy percent to 100% and the maximum percent to 200%

Answer

Set the minimum healthy percent to 100% and the maximum percent to 200%
Setting the minimum healthy percent to 100% ensures that the desired capacity is maintained at all times, preventing any service degradation. Setting the maximum percent to 200% allows ECS to launch the new version of tasks up to double the desired count before stopping any of the existing tasks, enabling a smooth rolling update with zero downtime.

Step-by-Step Solution

1
Identify the minimum capacity requirement from the scenario.
The minimum healthy percent must be set to 100% to ensure that the service capacity never drops below 100% of the desired task count at any point.
To prevent service degradation, the application must maintain full capacity during the update.
2
Identify the maximum allowable capacity during the update.
The maximum percent must be set to 200% to allow the service to temporarily scale up to double its desired task count.
Provisioning up to double the capacity allows Amazon ECS to start new version tasks before draining and terminating the old version tasks.

Key Concept

Amazon ECS service rolling update parameters (minimum healthy percent and maximum percent)
Question 30Question

A developer is updating a critical production web application deployed on AWS Elastic Beanstalk. The deployment process must ensure zero downtime and support an immediate rollback to the previous version if the new version fails health checks. Which two Elastic Beanstalk deployment strategies or options meet these requirements?

Select all that apply

Show answer & explanation

Answer: Blue/Green deployment using a CNAME swap; Immutable deployment

Answer

The correct options are Blue/Green deployment using a CNAME swap and Immutable deployment.
Blue/Green deployment using a CNAME swap and Immutable deployment both satisfy the requirements. A Blue/Green deployment routes traffic to a completely separate environment, allowing an immediate rollback by swapping CNAME records back if the new version fails. An Immutable deployment deploys the new version to a temporary Auto Scaling group alongside the original one. If health checks fail, the temporary group is deleted immediately, leaving the original instances unaffected.

Step-by-Step Solution

1
Analyze the application requirements.
The application requires zero downtime and a method to roll back immediately if the update fails.
This filters out deployment strategies that cause downtime or have slow rollback mechanisms.
2
Evaluate the downtime characteristics of the deployment strategies.
All-at-once causes downtime, and Rolling reduces serving capacity. Immutable, Rolling with additional batch, and Blue/Green deployments do not cause downtime.
To maintain zero downtime and full capacity, we must look at strategies that avoid in-place service degradation.
3
Evaluate the rollback speed of the zero-downtime strategies.
Rolling with additional batch requires a slow, sequential redeployment to roll back. Immutable and Blue/Green deployments allow for an immediate rollback because they maintain the old version on separate, untouched instances.
Selecting strategies that support immediate rollback satisfies the final constraint.

Key Concept

AWS Elastic Beanstalk deployment strategies and their trade-offs regarding downtime, capacity, and rollback speed.
Question 31Question

A developer is designing a deployment strategy for a containerized web application running on Amazon ECS (Fargate) behind an Application Load Balancer. The service currently runs with a desired task count of 88. The deployment must satisfy the following constraints:

* The application must maintain 100%100\% of its capacity (at least 88 healthy tasks) during the deployment process.
* The AWS account has a strict service quota that prevents running more than 1010 concurrent tasks for this service.
* If the new container version fails to launch or fails container health checks, the deployment must automatically roll back to the previous version without manual intervention or DNS changes.

Which two configurations should the developer use to meet these requirements? (Select two.)

Select all that apply

Show answer & explanation

Answer: Configure the ECS service rolling update parameters with a minimum healthy percent of 100%100\% and a maximum percent of 125%125\%.; Enable the ECS deployment circuit breaker with the rollback feature enabled on the service.

Answer

Configure the ECS service rolling update parameters with a minimum healthy percent of 100%100\% and a maximum percent of 125%125\%, and enable the ECS deployment circuit breaker with the rollback feature enabled on the service.
To maintain 100%100\% capacity during the deployment of a service with 88 desired tasks, at least 88 tasks must remain healthy, which translates to a minimum healthy percent of 100%100\%. To not exceed 1010 tasks total (which is 125%125\% of 88), the maximum percent must be set to 125%125\%. In this configuration, ECS will launch 22 new tasks, wait for them to pass health checks, and then terminate 22 old tasks, repeating the process. Enabling the ECS deployment circuit breaker with rollback ensures that if these new tasks fail to launch or fail health checks, the deployment is automatically canceled and the service rolls back to the previous stable task definition without manual effort or DNS changes.

Step-by-Step Solution

1
Calculate the capacity and task count boundaries based on the constraints.
The minimum healthy task count must be at least 88 (100%100\% of desired). The maximum concurrent tasks cannot exceed 1010, which represents 125%125\% of the desired 88 tasks (10/8=1.2510 / 8 = 1.25).
This establishes the mathematical bounds for the ECS service's minimumHealthyPercent and maximumPercent configurations.
2
Determine the correct deployment mechanism that respects the task limit.
An ECS rolling update starts a batch of new tasks (up to 22 tasks, which is 25%25\% of desired) before stopping the old ones. A CodeDeploy blue/green deployment requires launching an entire second task set (88 tasks), which violates the 1010 task limit.
This rules out blue/green deployment options in favor of an ECS rolling update.
3
Select the appropriate automated rollback mechanism that doesn't rely on DNS.
Enable the ECS deployment circuit breaker with rollback. This built-in ECS feature detects launch or health check failures and automatically rolls back the deployment to the last stable state.
This fulfills the requirement of automatic, rapid rollback without manual intervention or DNS routing updates.

Key Concept

ECS Rolling Update parameters (minimumHealthyPercent and maximumPercent) control task capacity during deployment, while ECS deployment circuit breaker provides automated rollbacks without DNS modifications.
Estimated Time:2m 30s
Question 32Question

A developer is using AWS CodeDeploy to deploy an update to an in-place application running on a fleet of Amazon EC2 instances. To minimize the risk of application failure, the developer wants to ensure that the update is applied to only a single Amazon EC2 instance at a time, keeping the rest of the fleet online and healthy. Which default CodeDeploy deployment configuration should the developer select?

Show answer & explanation

Answer: CodeDeployDefault.OneAtATime

Answer

CodeDeployDefault.OneAtATime
The default configuration for one at a time deploys the update to a single instance at a time. The deployment succeeds only if each instance is updated successfully, ensuring minimal impact if a deployment fails.

Step-by-Step Solution

1
Identify the deployment platform and type.
The platform is Amazon EC2 and the deployment type is in-place.
This determines which default deployment configurations are compatible.
2
Evaluate the deployment constraints.
The constraint requires deploying to only one instance at a time to minimize risk and maintain maximum availability.
This specifies the target configuration behavior.
3
Match the behavior to the default CodeDeploy configurations for EC2.
The configuration that targets exactly one instance at a time is the one at a time configuration.
This identifies the correct API configuration name.

Key Concept

AWS CodeDeploy deployment configurations define how deployments progress across instances in a deployment group.
Estimated Time:45s
Question 33Question

A developer is configuring a deployment pipeline using AWS CodeDeploy to update an AWS Lambda function. The deployment uses the `CodeDeployDefault.LambdaCanary10Percent10Minutes` configuration, which shifts 10%10\% of the traffic to the new version for a duration of 10 minutes10\text{ minutes}. The traffic is routed through a Lambda alias named `live`. The developer wants to ensure the deployment automatically rolls back if the new function version introduces errors, while preventing false rollbacks caused by test executions on the `$LATEST` version or activity on other development aliases of the function. Which configuration should the developer implement to meet these requirements?

Show answer & explanation

Answer: Create a CloudWatch Alarm for the Lambda `Errors` metric using the `FunctionName` and `Resource` dimensions, with the `Resource` dimension set to `my-function:live`. Associate this alarm with the CodeDeploy deployment group's rollback configuration.

Answer

Create a CloudWatch Alarm for the Lambda Errors metric using the FunctionName and Resource dimensions, with the Resource dimension set to the function name and the live alias. Associate this alarm with the CodeDeploy deployment group's rollback configuration.
The correct answer configuration monitors the specific Lambda alias (live) that is undergoing traffic shifting. Lambda publishes metrics under the Resource dimension in the format of FunctionName:AliasName. Monitoring this specific resource isolates the traffic routed to the production environment, ensuring that errors on other versions or aliases do not cause false alarms, and that any issues introduced by the new canary version are correctly detected.

Step-by-Step Solution

1
Identify how Lambda metrics are published to CloudWatch.
Recall that Lambda emits metrics with dimensions FunctionName (aggregating all traffic) and Resource (tracking a specific version or alias, formatted as FunctionName:Alias or FunctionName:Version).
To monitor the specific deployment's health, we need to know how to filter the metrics.
2
Evaluate which dimension isolates the deployment traffic.
The alias live is being updated by CodeDeploy. Thus, monitoring the Resource dimension with my-function:live isolates all traffic routed to the alias during the deployment, capturing errors from both the new and old versions.
This allows the alarm to trigger a rollback if the new version introduces errors, without being affected by testing on other aliases or $LATEST.
3
Assess the distractors against the requirements.
Distractors using only FunctionName monitor other environments. Distractors using $LATEST miss the canary traffic. Dynamic version monitoring is not supported.
To confirm that the chosen configuration is the only viable option.

Key Concept

AWS CodeDeploy automates Lambda traffic shifting using aliases. Monitoring for automatic rollbacks must use the specific alias Resource dimension to isolate deployment-related errors and avoid false rollbacks from unrelated invocations.
Estimated Time:2m 0s
Question 34Question

A developer is selecting deployment strategies for a production web application. The application has two strict requirements: there must be zero downtime during the deployment process, and the application must be able to roll back to the previous version immediately if a failure is detected. Which of the following deployment strategies satisfy both of these requirements? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Blue/Green deployment; Canary deployment

Answer

Blue/Green deployment and Canary deployment satisfy the requirements because they both allow traffic to be shifted between environments or versions with zero downtime, and can immediately route traffic back to the stable version if a failure occurs.
The correct strategies are Blue/Green deployment and Canary deployment. In a Blue/Green deployment, a separate environment is created, and traffic is cut over, allowing an immediate rollback by shifting traffic back if an error occurs. In a Canary deployment, traffic is shifted incrementally, and if alarms fire, traffic is immediately routed back to the old version. Both methods guarantee zero downtime and immediate rollback.

Step-by-Step Solution

1
Identify the downtime requirements of the candidate deployment strategies.
Blue/Green and Canary strategies support zero downtime by keeping both versions of the application active. All-at-once and standard In-place strategies incur downtime.
To filter out strategies that cause application offline states.
2
Analyze the rollback capabilities of the remaining strategies.
Blue/Green and Canary strategies can roll back immediately by shifting traffic back to the original version. Rolling and All-at-once strategies require a redeployment of the previous version to roll back.
To identify which strategies meet the immediate rollback constraint.

Key Concept

Downtime and rollback trade-offs of AWS deployment strategies.
Estimated Time:45s
Question 35Question

A developer is using AWS Serverless Application Model (SAM) to deploy updates to a critical Lambda function. The deployment must satisfy the following constraints:
- Traffic must be shifted from the old version to the new version gradually, in increments of 10% every 2 minutes.
- The deployment must automatically roll back if the execution error rate or latency metrics exceed predefined thresholds.
- Integration test suites must run before traffic starts shifting, and a cleanup script must run after all traffic has shifted to the new version.

Which TWO configurations must the developer specify in the AWS SAM template to satisfy these requirements?

Select all that apply

Show answer & explanation

Answer: Configure the AutoPublishAlias property under the Serverless Function resource to define the alias that will receive the shifted traffic.; Under DeploymentPreference, set the Type to Linear10PercentEvery2Minutes, list the rollback alarms under Alarms, and define the PreTraffic and PostTraffic lifecycle hooks.

Answer

The developer must specify the AutoPublishAlias property under the Serverless Function resource to define the alias for traffic routing, and configure the DeploymentPreference section with Type: Linear10PercentEvery2Minutes along with the rollback alarms and the PreTraffic and PostTraffic hooks.
To perform gradual traffic shifting with AWS SAM, the function must have AutoPublishAlias enabled. In addition, the deployment strategy must be specified via DeploymentPreference with Type: Linear10PercentEvery2Minutes to shift traffic by 10% every 2 minutes. The template must also reference CloudWatch alarms for automated rollback and specify PreTraffic and PostTraffic hooks to execute validation tests and cleanup operations.

Step-by-Step Solution

1
Enable traffic shifting support by defining an alias configuration.
Define the AutoPublishAlias property under the AWS::Serverless::Function resource.
AWS SAM cannot perform gradual deployment unless a function alias is defined to shift traffic between the old and new versions.
2
Select the correct linear deployment type configuration.
Set the Type under DeploymentPreference to Linear10PercentEvery2Minutes.
This built-in configuration matches the requirement of shifting 10% of the traffic every 2 minutes.
3
Link safety controls and lifecycle hooks for validation.
Reference the CloudWatch alarms under Alarms and the Lambda validation functions under the PreTraffic and PostTraffic hook properties.
Alarms trigger automatic rollback during the deployment, and hooks run integration tests before traffic shifting starts and cleanup after traffic shifting completes.

Key Concept

Configuring AWS SAM safe deployments (DeploymentPreference) using built-in CodeDeploy types, aliases, alarms, and lifecycle hooks.
Estimated Time:2m 30s
Question 36Question

A developer needs to deploy a new version of an application to an AWS Elastic Beanstalk environment. The application is for internal testing and can tolerate a brief period of service unavailability. The developer wants the deployment to be completed as quickly as possible without launching any new instances to keep costs at zero. Which deployment strategy meets these requirements?

Show answer & explanation

Answer: All-at-once

Answer

All-at-once
The All-at-once deployment strategy is correct because it applies the update to all instances in the environment simultaneously. This results in service downtime during the deployment, but it requires no additional resource provisioning (keeping cost at zero) and completes the deployment in the shortest time possible.

Step-by-Step Solution

1
Analyze the requirements from the deployment scenario.
The key constraints are: 1. Service unavailability (downtime) is acceptable. 2. The deployment must complete as quickly as possible. 3. Zero additional costs or new instances should be launched.
Identifying constraints helps filter out strategies that launch temporary instances or focus on zero-downtime at the expense of speed or cost.
2
Evaluate each deployment strategy against the constraints.
All-at-once causes downtime but requires zero new instances and is the fastest. Immutable and Rolling with additional batch launch new instances. Rolling takes longer and reduces serving capacity without using new instances.
Comparing strategies allows us to match the one that satisfies all constraints simultaneously.

Key Concept

Selecting the appropriate AWS Elastic Beanstalk deployment strategy based on cost, speed, and downtime constraints.
Estimated Time:1m 0s
Question 37Question

A developer is managing a production web application deployed on AWS Elastic Beanstalk. The application experiences consistent high traffic, and the environment's capacity must remain at 100%100\% at all times during updates to prevent performance degradation. In the event of a deployment failure, the application must support an immediate rollback with minimal impact, without requiring a manual rollback deployment. Additionally, to avoid issues with client-side DNS caching, the deployment must not involve swapping DNS CNAMEs or changing Route 53 configurations.

Which Elastic Beanstalk deployment strategy should the developer select?

Show answer & explanation

Answer: Immutable

Answer

The immutable deployment strategy
The immutable deployment strategy meets all requirements. It maintains 100%100\% capacity by deploying the new version to a temporary Auto Scaling group alongside the existing one under the same load balancer. If the deployment fails, Elastic Beanstalk immediately deletes the temporary Auto Scaling group, resulting in an immediate rollback with zero downtime. Since it uses the same environment and load balancer, no CNAME swaps or DNS changes are required.

Step-by-Step Solution

1
Analyze capacity constraints.
The requirement to maintain 100%100\% capacity during updates rules out the standard Rolling strategy because it takes active instances out of service, reducing capacity.
To prevent performance degradation on a high-traffic site, capacity cannot drop below the baseline.
2
Evaluate rollback speed and procedure.
The requirement for immediate rollback without a manual rollback deployment rules out Rolling with additional batch.
Rolling with additional batch requires a new deployment of the previous version to revert changes, which is slow and manual.
3
Check DNS and routing constraints.
The requirement to avoid DNS CNAME swapping or Route 53 changes rules out Blue/Green deployment.
Blue/Green deployments rely on switching DNS CNAMEs, which can cause traffic to split due to client-side DNS caching.
4
Identify the matching strategy.
The Immutable strategy satisfies all constraints by deploying to a temporary Auto Scaling group behind the same load balancer, maintaining 100%100\% capacity, and allowing immediate automatic rollback by terminating the new group if health checks fail.
It runs the new version in parallel behind the same load balancer, avoiding DNS changes, and rolls back instantly by deleting the temporary group.

Key Concept

AWS Elastic Beanstalk Deployment Strategies
Estimated Time:2m 30s
Question 38Question

A developer is evaluating deployment strategies for an internal web application hosted on an AWS Elastic Beanstalk environment. The application can tolerate temporary downtime or reduced capacity during the update process. The primary constraint is to avoid any additional costs or the provisioning of temporary instances. Which two deployment strategies should the developer consider? (Select two.)

Select all that apply

Show answer & explanation

Answer: All-at-once; Rolling

Answer

All-at-once and Rolling
The All-at-once strategy updates all instances simultaneously, which causes downtime but incurs no additional instance costs. The Rolling strategy updates instances in batches, which reduces capacity during the deployment process but does not provision any new instances. Both strategies satisfy the requirement of not incurring additional charges or provisioning new instances while accepting downtime or reduced capacity.

Step-by-Step Solution

1
Analyze the application constraints: temporary downtime or reduced capacity is acceptable, and there must be zero additional costs or temporary instance provisioning.
Identified the need for in-place update strategies that do not increase the instance count.
This filters out any strategies that launch temporary instances to maintain capacity.
2
Evaluate the 'All-at-once' strategy against the constraints.
The strategy updates all instances at once, causing downtime, but requires no additional instances.
This is a valid option because downtime is acceptable and no additional costs are incurred.
3
Evaluate the 'Rolling' strategy against the constraints.
The strategy updates instances in batches, temporarily reducing capacity, but requires no additional instances.
This is a valid option because reduced capacity is acceptable and no additional costs are incurred.
4
Evaluate 'Immutable', 'Rolling with additional batch', and 'Traffic splitting' against the constraints.
These strategies launch new/temporary instances, which temporarily increases costs.
These are invalid because they violate the constraint against additional costs.

Key Concept

AWS Elastic Beanstalk deployment strategies trade-offs regarding cost, capacity, and downtime.
Question 39Question

A developer is configuring a blue/green deployment for an Amazon ECS service using AWS CodeDeploy. The deployment must meet the following requirements:
- Provide zero downtime for users during updates.
- Run automated integration tests to validate the replacement task set (Green) using a test port before any production traffic is shifted.
- Automatically and immediately roll back the deployment if the validation tests fail, or if a CloudWatch alarm for HTTP 5xx errors is triggered.
- Shift 10% of the production traffic to the new version initially, and shift the remaining 90% after a 15-minute soak period.

Which two configurations or lifecycle hooks should the developer use to meet these requirements? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Use the AfterAllowTestTraffic lifecycle hook in the AppSpec file to invoke an AWS Lambda function that runs the validation tests.; Select the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration for the deployment group.

Answer

Use the AfterAllowTestTraffic lifecycle hook in the AppSpec file to invoke a Lambda function that runs the validation tests, and select the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration for the deployment group.
The correct configurations are the AfterAllowTestTraffic lifecycle hook (which runs validation tests against the replacement task set while it is accessible via the test listener) and the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration (which routes 10% of traffic to the green deployment and the remaining 90% after 15 minutes).

Step-by-Step Solution

1
Identify the required traffic shifting behavior.
Traffic must shift 10% initially and the rest after 15 minutes.
This matches a canary traffic routing model with a 15-minute soak period, which corresponds to the CodeDeployDefault.ECSCanary10Percent15Minutes configuration.
2
Determine the correct CodeDeploy lifecycle hook for validation testing in an ECS environment.
Use the AfterAllowTestTraffic hook to run validation tests via the test port before production traffic starts shifting.
In ECS blue/green deployments, the AfterAllowTestTraffic hook executes after the replacement task set is reachable via the test listener but before production traffic is routed.
3
Identify the correct execution target for ECS lifecycle hooks.
The hook must invoke an AWS Lambda function.
Unlike EC2 deployments which run shell scripts, ECS deployments require AppSpec hooks to trigger Lambda functions.

Key Concept

Deploying updates to Amazon ECS using AWS CodeDeploy blue/green traffic shifting and lifecycle hooks.
Question 40Question

A developer is updating a microservice hosted on Amazon ECS. Due to budget constraints, the developer cannot provision any additional container instances in the ECS cluster. The application is currently running at its desired task count and must remain at least 50% operational during the deployment. Which deployment configuration for minimum healthy percent and maximum percent will allow the deployment to succeed under these constraints?

Show answer & explanation

Answer: minimumHealthyPercent set to 50, and maximumPercent set to 100

Answer

Setting the minimumHealthyPercent to 50 and maximumPercent to 100 allows Amazon ECS to deploy the updates within the existing cluster capacity while keeping the application partially available.
The configuration specifying minimumHealthyPercent as 50 and maximumPercent as 100 ensures that ECS can terminate up to half of the running tasks before launching new ones. This satisfies the requirement to keep the application 50% operational while ensuring that the task count never exceeds 100% of the desired limit, avoiding the need for additional instances.

Step-by-Step Solution

1
Determine the resource availability limit.
The maximum percent must be set to 100.
Since no additional container instances can be provisioned in the cluster, the deployment cannot scale out. The total number of tasks running at any time must not exceed the desired task count.
2
Determine the minimum service availability requirement.
The minimum healthy percent must be set to 50.
The service is required to remain at least 50% operational during the update, meaning at least 50% of the desired task count must be healthy and running at all times.
3
Combine the parameters to define the deployment configuration.
Select the configuration with minimumHealthyPercent at 50 and maximumPercent at 100.
This allows ECS to stop 50% of the tasks first, then start 50% of the new tasks, proceeding iteratively without exceeding the resource capacity or dropping below the availability threshold.

Key Concept

Amazon ECS Rolling Update Parameters (minimumHealthyPercent and maximumPercent)
Estimated Time:1m 0s
PreviousPage 2 / 5Next
Deployment Strategies Practice Questions — AWS Certified Developer - Associate — Page 2 | Examkin