Deployment choices determine which resources change, how users reach a new version, and what recovery requires. These sections compare the behavior of the AWS platform named in each scenario.
Deployment strategies basics
A deployment strategy decides how a new version replaces the old one. The main choices are updating servers in place or switching traffic to a new environment.
How it works
- In-place: update existing servers in batchesA subset of instances processed together during a rolling deployment..
- Blue/green: start the new version on new resources.
- Move traffic to the new version, keeping the old one for rollback.
Exam cues
- If the question says easy rollback with no changes to running servers, think blue/green.
Remember
- In-place updates existing instances; blue/green uses replacement resources.
Trap: A rolling in-place update cannot switch back instantly; blue/green keeps the old environment for that.
Mutable and immutable deployments
A deployment can change existing servers or create replacements. In-place deploymentA release changes application software on existing servers. changes the application on existing instances. Immutable deploymentA release starts a new server set from the desired configuration or application version. starts a new server set from the desired configuration. The AWS deployment methods guide explains these choices.
How it works
- Choose the object being changed. CodeDeploy in-place updates an application revisionA packaged version of application files is selected for deployment., meaning a packaged version of application files, on existing EC2 instances.
- For an immutable server release, prepare the new configuration or image and launch replacement capacity. EC2 Image Builder can build, test, and distribute the machine image first.
- An Auto Scaling group is a managed set of EC2 instances. Its rolling instance refreshAn Auto Scaling operation applies a desired configuration through instance or root-volume replacement. replaces instances in batchesA subset of instances processed together during a rolling deployment. using the desired configuration. Instance refresh also offers a separate root-volume replacement strategy that preserves the instance and its network interfaces.
- Blue/green uses separate old and new environments. Test the replacement environment, shift traffic, and retain the old environment for rollback if needed.
- On Beanstalk, choose the application deployment policy and instance-replacing configuration update policy separately. Use immutable policies for both, or separate the changes, when one release needs both.
Exam cues
- If the question says update code on the same EC2 instances, think CodeDeploy in-place, because it installs a revision on existing servers.
- If the question says replace an Auto Scaling fleet with a new AMI or instance type, think rolling instance refresh, because it applies the desired launch configuration in batches.
- If the question says ECS rolling update, think replacement tasks, because ECS does not update the application inside each running task.
Remember
- Mutable means changing existing systems. Immutable server deployment creates new systems from the desired configuration.
- Rolling describes a gradual rollout; the platform determines what gets updated or replaced.
- Blue/green separates environments and shifts traffic after testing.
- Beanstalk application and configuration update policies are configured separately.
Trap: Selecting immutable application deployments in Beanstalk does not automatically select immutable configuration updates. A combined change needs both policies or separate updates.
Da documentação da AWS (10)
- An in-place CodeDeploy EC2 deployment updates the application revision on existing instances.
- An immutable deployment starts a new server set with the new configuration or application version.
- Blue/green creates another environment, tests it, shifts traffic to it, and can retain the old environment for rollback.
- ECS rolling deployments replace tasks with new tasks rather than updating the running tasks in place.
- The rolling instance refresh strategy replaces EC2 instances in batches using a desired configuration.
- Instance refresh also supports replacing root volumes without terminating instances; this preserves network interfaces and non-root storage.
- EC2 Image Builder automates building, testing, and distributing customized machine images.
- Beanstalk application deployment policy and instance-replacing configuration update policy are separate settings.
- For Beanstalk changes combining a new application version with instance-replacing configuration, use separate updates or configure immutable policies for both.
- For EC2 blue/green behind one Application Load Balancer, changing the listener rule to forward to the green target group switches traffic at once, with no DNS caching delay.
Rollout capacity and cost
Deployment capacity planning asks how much of the old application can stay available while the new version starts. The Beanstalk deployment policies provide a concrete comparison for EC2-based Beanstalk Standard environments. Other platforms have their own capacity controls.
How it works
- For all-at-once, update every existing instance together. The application can briefly lose service while its servers restart.
- For rolling, update a batchA subset of instances processed together during a rolling deployment. while the remaining batches serve traffic. A batch is a subset of instances, configured by count or percentage. Old and new versions can coexist.
- For rolling with an additional batch, start extra instances first to retain serving capacity. Remove the extra batch after deployment.
- For immutable or traffic splitting, reserve a full replacement fleet. Immutable updates briefly double instance capacity; traffic splitting maintains both fleet sizes throughout evaluation. Blue/green uses a separate environment.
- For ECS rolling, size the lower and upper task bounds so the scheduler can make progress. The lower bound rounds up; the upper bound rounds down. ECS linear deploymentsTraffic moves to a new version in equal percentage increments with waits between them. also keep both revisions running temporarily and may double resource usage.
Exam cues
- If the question says Beanstalk must keep full capacity with only one extra batch, think Rolling with additional batch, because replacement capacity starts before existing instances leave service.
- If the question says Beanstalk immutable or traffic splitting, think capacity for a full second fleet, because these policies start new instance sets.
- If the question says ECS cannot start or stop any task during deployment, think minimumHealthyPercent and maximumPercent, because their rounded bounds can prevent progress.
Remember
| Beanstalk Standard policy | Temporary capacity implication |
|---|---|
| All at once | Updates the existing fleet together; can briefly interrupt service |
| Rolling | Uses existing batches; a batch leaves service during its update |
| Rolling with additional batch | Adds one batch before updating existing instances |
| Immutable | Creates a full replacement set in a temporary Auto Scaling group |
| Traffic splitting | Keeps a full new set alongside the original set during evaluation |
| Blue/green | Runs the new application in a separate environment |
Trap: A small canary traffic share does not imply a small replacement fleet. Beanstalk traffic splitting starts a full new instance set even while that set receives only a fraction of traffic.
Da documentação da AWS (13)
- For Beanstalk Standard, all-at-once deploys to every instance together and can cause a short outage.
- Beanstalk Standard rolling deployment updates existing instances in batches while other batches keep serving.
- During a Beanstalk rolling deployment, old and new application versions can serve requests simultaneously.
- Beanstalk Standard Rolling with additional batch launches a batch before removing any instance from service and terminates the extra batch afterwards.
- Beanstalk immutable deployment launches a full replacement set in a temporary Auto Scaling group.
- Beanstalk immutable environment updates briefly double instance capacity and require enough instance quota.
- Beanstalk traffic splitting launches as many new instances as the original fleet and keeps both group sizes constant during evaluation.
- Beanstalk blue/green deploys to a separate environment and swaps environment CNAME records to redirect traffic.
- Beanstalk Standard rolling batch size can be configured as an instance count or a percentage.
- ECS minimumHealthyPercent is a lower healthy-task bound rounded up from desired count.
- ECS maximumPercent is an upper running-task bound rounded down from desired count.
- ECS rolling deployment settings must permit at least one task to start or stop for the rollout to progress.
- ECS linear deployments temporarily run both old and new revisions and may double resource usage.
Traffic shifting and health gates
Traffic shifting controls how many requests reach a new version while it is evaluated. A health gateA health check or alarm condition can stop a deployment from proceeding. is a check that can stop rollout when the new version is not ready. The ECS canary workflow combines limited initial exposure with evaluation before the remaining traffic moves.
How it works
- Prepare the new version alongside the old one. A canary sends it an initial traffic share and then the remainder after evaluation. Linear deploymentTraffic moves to a new version in equal percentage increments with waits between them. uses equal traffic increments with a wait between each.
- Test readiness and application behavior before increasing exposure. In CodeDeploy, a hook is a validation function or script at a named point: EC2 uses ValidateService after application start; Lambda uses BeforeAllowTraffic and AfterAllowTraffic; ECS also offers AfterAllowTestTraffic.
- Watch health and application metrics. CloudWatch alarms compare a measured signal with a configured condition. CodeDeploy alarm-based stopping and automatic rollback are separate configuration choices.
- In ECS rolling deploymentsA rollout updates or replaces one portion of application capacity at a time., the circuit breakerA deployment control detects startup or health failure and can initiate a configured rollback. detects startup or health failure. It needs a previously COMPLETED deployment for rollback. EKS readiness probes, which test whether a podA Kubernetes workload unit runs one or more containers. can accept requests, remove an unready pod from Service traffic without using a liveness restart.
- Keep an observation interval before cleanup. ECS deployment bake timeAn observation period keeps both ECS revisions running after production traffic has shifted. retains both revisions after the final traffic shift. Instance refreshAn Auto Scaling operation applies a desired configuration through instance or root-volume replacement. offers checkpointsA pause after partial instance replacement allows progress to be evaluated., which pause after partial replacement, and a final bake time before completion.
Exam cues
- If the question says expose a small share then move the remainder after a pause, think canary, because it has an initial evaluation phase. Equal repeated increments indicate linear.
- If the question says CodeDeploy must recover after an alarm stops rollout, think configure automatic rollback as well, because stopping alone does not select that recovery behavior.
- If the question says temporary EKS unavailability without restart, think readiness, because unready pods stop receiving Service traffic.
- If the question says AppConfig must revert a bad configuration during deployment, think configured CloudWatch alarms, because ALARM or INSUFFICIENT_DATA can trigger rollback while alarm actions are enabled.
Remember
| Platform | Relevant controls |
|---|---|
| CodeDeploy EC2 | AllAtOnce, HalfAtATime, OneAtATime; default OneAtATime; ValidateService and alarms |
| CodeDeploy Lambda / ECS | Canary, linear, all-at-once; platform-specific validation hooks and alarms |
| ECS native | ROLLING, BLUE_GREEN, LINEAR, CANARY; circuit breaker is specific to rolling |
| Beanstalk Standard | BatchA subset of instances processed together during a rolling deployment. health and command timeout; traffic splitting requires an Application Load Balancer |
| EKS | Readiness controls Service traffic; liveness addresses failures by restarting the workload |
| EC2 Auto Scaling instance refresh | Checkpoints, final bake time, configured alarm-based auto rollback |
| AppConfig | Alarm-based rollback of configuration during deployment |
Trap: An ECS circuit breaker cannot invent a working revision. Without a COMPLETED deployment, it has no rollback target.
The original version continues serving its traffic share.
The load balancer sends the configured initial share to the replacement version.
Observe application metrics during evaluation.
Use the configured deployment controls to stop or roll back a bad release; otherwise move the remaining traffic after evaluation.
Da documentação da AWS (20)
- ECS canary sends a selected share of traffic to the new revision, waits for evaluation, then moves the remaining traffic together.
- ECS linear moves traffic in equal percentage increments with waits between increments.
- ECS deployment bake time keeps both revisions running after all production traffic has shifted and before the old revision is terminated.
- The ECS deployment configuration supports ROLLING, BLUE_GREEN, LINEAR, and CANARY strategies.
- CodeDeploy ECS and Lambda deployments support canary, linear, or all-at-once traffic shifting.
- CodeDeploy EC2 predefined deployment configurations are AllAtOnce, HalfAtATime, and OneAtATime; the default is OneAtATime.
- A CodeDeploy deployment group can stop deployment when an associated CloudWatch alarm activates.
- CodeDeploy automatic rollback must be configured to redeploy the last known good revision on deployment failure or a specified monitoring threshold.
- CodeDeploy EC2 ValidateService hooks run validation scripts after ApplicationStart.
- CodeDeploy Lambda deployments have BeforeAllowTraffic and AfterAllowTraffic validation hooks.
- CodeDeploy ECS deployments provide validation hooks including AfterAllowTestTraffic and BeforeAllowTraffic.
- Beanstalk rolling deployments wait for batch health before continuing and fail if the command timeout expires.
- Beanstalk traffic splitting requires an Application Load Balancer.
- The ECS deployment circuit breaker is supported only with rolling deployments and can roll back to the latest COMPLETED deployment.
- An ECS circuit breaker without a COMPLETED deployment cannot start rollback tasks and the deployment stalls.
- ECS rolling deployments can use circuit breaker failure detection for task startup or health and CloudWatch alarms for application metrics.
- A failed EKS readiness probe removes a pod from Kubernetes Service traffic until it becomes ready; a liveness probe addresses failures by restarting the workload.
- Instance refresh can pause at checkpoints and use final bake time to validate health before completion.
- Instance refresh auto rollback can reverse a failed refresh or one stopped by a configured CloudWatch alarm in ALARM.
- During deployment, AppConfig rolls configuration back for configured alarms in ALARM or INSUFFICIENT_DATA, unless their actions are disabled.
Golden images and bootstrap
A golden AMIA reusable machine image contains preinstalled software and settings for application instances. is a reusable EC2 launch image prepared with the software and settings an application needs. PrebakingApplication components are installed in a machine image before instances launch. puts application componentsInstallation, configuration, or test instructions form a reusable part of an image recipe. into that image. BootstrappingInstallation and configuration run when a new instance starts. runs installation or configuration when an instance starts. AWS deployment guidance recommends combining the two when instances need both quick startup and environment-specific customization.
How it works
- Define an Image Builder recipe, the base image plus build and test components. A component is a set of installation, configuration, or testing instructions. The parent image can come from a Systems Manager parameter, which stores a named configuration value.
- Start the pipeline on demand or evaluate its schedule. With the default dependency-update condition, a scheduled run builds only when matching dependencies have changed. A changed base-image parameter counts as such an update.
- Image Builder launches EC2 infrastructure, applies the recipe, and runs tests. It distributes the image only when all configured tests succeed.
- Distribution can copy the AMI to Regions, grant launch permissions to accounts or organizational groups, write its ID to Parameter Store, and create a launch templateStored EC2 launch settings identify the image and configuration for new instances. version. A launch template stores settings for new EC2 instances.
- Start a rolling instance refreshAn Auto Scaling operation applies a desired configuration through instance or root-volume replacement. to apply the new launch configuration to existing fleet instances. Use warmup, checkpointsA pause after partial instance replacement allows progress to be evaluated., and supported rollback settings to control replacement. Keep remaining environment customization in bootstrap logic such as user dataStartup configuration or scripts are supplied to an EC2 instance at launch., the startup configuration supplied to EC2.
- For cross-account AMI copies, create the Image Builder distribution role in each destination with its managed policy and trust for the source. Encrypted copies also need destination role KMS permissions and key policies that permit destination access in the source and destination Regions. A distribution-phase failure can be retried without rebuilding.
Exam cues
- If the question says large downloads delay EC2 scaling, think prebaking, because the software is installed before instances launch.
- If the question says a new Image Builder AMI must reach an existing fleet, think launch template plus instance refresh, because image publication and fleet replacement are separate operations.
- If the question says publish the tested AMI for later infrastructure deployment, think an output Parameter Store value or launch template version, because distribution can expose the image identifier to consumers.
- If an account only needs to launch a shared encrypted AMI, grant launch and KMS key access; its snapshots do not need separate sharing for launch. An AMI encrypted with the default AWS managed key cannot be shared.
- If a Linux bootstrap script calls AWS APIs, use an instance profile with the required permissions and inspect
/var/log/cloud-init-output.logfor output. - If Image Builder build diagnosis needs the failed instance, turn off termination on failure in the infrastructure configuration.
Remember
- AMIs are Region-specific. Copy them for use in another Region.
- Output parameter data type aws:ec2:image validates the AMI ID.
- Image Builder launch-template setDefaultVersion defaults to true.
- The schedule defaults to EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE; EXPRESSION_MATCH_ONLY builds at every matching time.
- Linux user data runs on first launch by default.
- User data is limited to 16 KB before encoding and is not included in an AMI created from the instance.
Trap: Publishing a new AMI and launch template version does not update existing instances. Start an instance refresh to replace them.
Start the pipeline on demand or evaluate its schedule. The dependency-update condition can skip a scheduled build when dependencies have not changed.
Image Builder uses the recipe and components to build and test an image on EC2 infrastructure.
Only distribute the output image after all configured tests succeed.
Distribution copies or shares the AMI and can publish its ID to a Parameter Store parameter.
Distribution can create a launch template version referencing the new AMI; setDefaultVersion defaults to true.
Start a rolling instance refresh to replace running instances. Image publication alone does not refresh the fleet.
Detalhes das caixas (7)
- Base image
The image recipe selects a parent AMI directly or through a Systems Manager parameter. A changed parameter value can count as a dependency update at schedule evaluation.
- Image Builder
Build and test components customize and validate the image. Configured tests must pass before Image Builder distributes it.
- New AMI
Owned by the build account. AMIs are regional.
- Distribution
Distribution can copy AMIs to Regions, grant launch permissions to accounts or organizational groups, and publish AMI IDs or launch template versions.
- Parameter Store
Data type
aws:ec2:imagemakes Systems Manager validate the value as an AMI ID. Consumers read this parameter.- Launch template
Distribution adds a launch template version with the new AMI ID. It becomes the default version unless
setDefaultVersionis false.- Auto Scaling
A rolling instance refresh replaces existing instances in batches. Warmup and checkpoints support rollout validation; optional rollback has launch-template restrictions.
Da documentação da AWS (27)
- An AMI contains the software configuration used to launch EC2 instances.
- Prebaking embeds application components in an AMI and can reduce instance startup work.
- Bootstrapping installs or customizes software at instance launch; large downloads and complex setup can slow deployment and scaling.
- Prebaking and bootstrapping can be combined to start instances with software already installed and customize them for their environment.
- An Image Builder recipe selects the base image and build and test components; components contain installation, configuration, or test instructions.
- Image Builder distributes an image only after all configured tests succeed.
- Image Builder launches EC2 instances in the account to customize images and run validation tests.
- AMIs are Region-specific and can be copied to another Region.
- Image Builder AMI distribution settings can copy images to Regions and grant launch permission to accounts, organizations, or organizational units.
- Image Builder distribution can write an output AMI ID into a Systems Manager Parameter Store parameter.
- The Image Builder output parameter data type aws:ec2:image makes Systems Manager validate the value as an AMI ID.
- Image Builder distribution can create a launch template version for the output AMI; setDefaultVersion defaults to true.
- The Image Builder schedule start condition defaults to EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE; EXPRESSION_MATCH_ONLY builds at every matching schedule time.
- When an Image Builder recipe selects its base through a Parameter Store parameter, a changed parameter value counts as a dependency update.
- An Image Builder schedule determines when the pipeline evaluates whether its start condition is satisfied.
- To update existing instances with a new AMI, create or update a launch template and start a rolling instance refresh.
- Rolling instance refresh supports instance warmup, checkpoints, and optional rollback.
- EC2 user data is limited to 16 KB before base64 encoding and is not included when an AMI is created from an instance.
- Linux user data scripts that call AWS APIs need an instance profile with permissions for those calls; cloud-init output is recorded in /var/log/cloud-init-output.log.
- Sharing an encrypted AMI requires access to its KMS key; AMIs backed by snapshots encrypted with the default AWS managed key cannot be shared. Referenced snapshots need not be shared for instance launch.
- Image Builder cross-account AMI copying requires EC2ImageBuilderDistributionCrossAccountRole in each destination account, a managed distribution policy, and trust for the source account.
- For encrypted Image Builder cross-account copies, destination roles need KMS permissions and source key policies must allow destination accounts to use the keys in the source and destination Regions.
- After a distribution-phase failure, Image Builder can retry distribution without rebuilding the image.
- Image Builder terminates build or test instances on failure by default; infrastructure configuration can retain them for troubleshooting.
- To get an encrypted AMI from an unencrypted one, copy it with encryption turned on and a KMS key; the copy's snapshots are encrypted.
- Instance metadata is data about a running EC2 instance, such as its ID and type, that software on the instance can read; it is not the launch script, which is user data.
- EC2 user data can run configuration scripts at launch; Linux user data scripts and cloud-init directives run on first launch by default.
Rollback and schema compatibility
Rollback restores an earlier application revisionA packaged version of application files is selected for deployment. or returns traffic to a retained version. Its mechanism depends on the deployment platform. A database schemaThe structure of a database defines its tables, fields, and relationships. is the structure of tables and fields; AWS schema guidance explains why that structure must remain compatible with both application versions during a shared-database release.
How it works
- Identify what recovery actually changes. CodeDeploy creates a new deployment of a previous revision. It does not automatically reverse actions that earlier lifecycle scripts performed.
- For a failed Beanstalk rolling application deployment, deploy a fixed or known good version. Some completed batchesA subset of instances processed together during a rolling deployment. can already run the new version. A failed immutable deploymentA release starts a new server set from the desired configuration or application version. terminates its new group; traffic splitting can return requests to the original instances before terminating the new group.
- With Beanstalk blue/green, keep old blue available until DNS changes propagate and cached records expire. A CNAMEA DNS alias record redirects an environment name to its destination. is a DNS alias record; swapping the environment aliases redirects requests as clients resolve them.
- Separate shared database schema changes from code changes. If schema goes first, old code must work with it. If code goes first, new code must work with the old schema.
- Add fields while preserving compatibility, then remove obsolete fields only when earlier application versions are no longer needed. Additive changes still require code that tolerates extra fields. Both environments need current data for a usable rollback.
Exam cues
- If the question says redeploying old code must undo a database migration script, think separate handling of script effects, because CodeDeploy does not automatically reverse them.
- If the question says old and new applications share one database, think backward compatibilityA changed schema remains usable by older application code, or new code works with an older schema., meaning old code can still use the changed data structure.
- If the question says immediate cleanup after a Beanstalk CNAME swap, think DNS propagation and cache expiry, because some clients can still use the old destination.
Remember
- CodeDeploy rollback is a new deployment with a new ID.
- Beanstalk rolling application failure can leave mixed application versions until another deployment.
- Removing a required database field can make rollback to old code unusable.
- An instance refreshAn Auto Scaling operation applies a desired configuration through instance or root-volume replacement. can roll back only while it is in progress; a completed refresh needs another refresh.
Trap: Returning traffic to old application code does not make incompatible database fields reappear. Preserve compatibility with the retained version before depending on traffic rollback.
Da documentação da AWS (12)
- CodeDeploy rollback redeploys a previous revision as a new deployment with a new deployment ID.
- CodeDeploy does not automatically revert actions performed by scripts in a previous deployment.
- After a failed Beanstalk rolling application deployment, deploy a fixed or known good version; completed batches can be on the new version while pending batches remain old.
- A failed Beanstalk immutable application deployment is reversed by terminating its new Auto Scaling group.
- Aborting or failing Beanstalk traffic splitting moves traffic back to the original instances and terminates the new instances.
- Beanstalk blue/green swaps environment CNAME records; retain the old environment until DNS changes propagate and cached records expire.
- Blue and green applications need current data both for serving new traffic and for rollback to the old application.
- If a shared database schema changes before code, the schema must remain compatible with the old application.
- If application code changes before the shared schema, the new code must remain compatible with the old schema.
- Adding fields and entities before code deployment can preserve compatibility, provided application code tolerates additional fields.
- Removing database fields after code deployment can make the earlier application version unusable.
- An instance refresh can be rolled back while in progress; after completion another refresh is required.
Image pipeline controls and rollback
EC2 Image Builder pipelines depend on instance connectivity and permissions to build, test, log, and publish AMIs. A scan result condition can gate distribution, while instance refreshAn Auto Scaling operation applies a desired configuration through instance or root-volume replacement. rollback needs a supported launch configuration.
How it works
- Give build and test instances access to Systems Manager and an instance profile with permissions for their componentsInstallation, configuration, or test instructions form a reusable part of an image recipe.. Image Builder uses Run Command to operate those instances. If build logs go to Amazon S3, the instance profile also needs
s3:PutObjectfor the bucket. - For an output Parameter Store value, grant the execution role
ssm:PutParameterand, foraws:ec2:imagevalidation,ec2:DescribeImages. Enable a targeted opt-in Region in the source account for parameter writes. - Enable an Amazon Inspector on-demand AMI scan and set a scan result condition to make Image Builder wait for the result. Findings above the allowed severity fail the image. This scan does not require Inspector account activation.
- For instance refresh rollback, specify a desired configuration and use an explicit numbered previous launch templateStored EC2 launch settings identify the image and configuration for new instances. version. Rollback does not support
$Latest,$Default, or a Parameter Store AMI alias.
Exam cues
- If a private build or test instance cannot run components, think Systems Manager access and instance profile permissions, because Image Builder sends actions through Run Command.
- If an AMI copy reaches an opt-in Region but its output parameter fails, think source account Region enablement and execution role permissions, because the parameter write has its own prerequisites.
- If findings above a severity must block AMI distribution, think on-demand scanning with a scan result condition, because the condition makes Image Builder wait and evaluate the results.
- If a release needs instance refresh rollback, think a desired configuration and a numbered previous launch template version, because aliases and symbolic versions are unsupported.
Remember
- The instance profile needs
s3:PutObjectfor configured S3 build logs. - The execution role needs
ssm:PutParameterfor output parameters andec2:DescribeImagesforaws:ec2:imagevalidation. - On-demand AMI scanning does not require Inspector account activation.
Trap: Enabling an on-demand AMI scan alone does not make distribution wait. Set a scan result condition to fail the image when findings exceed the allowed severity.
Da documentação da AWS (6)
- Instance refresh rollback requires a desired configuration and an explicit numbered previous launch template version; $Latest, $Default, and Parameter Store AMI aliases are not supported.
- Image Builder output parameters require ssm:PutParameter on the execution role and ec2:DescribeImages for aws:ec2:image validation; the source account must enable a targeted opt-in Region for parameter writes.
- Image Builder build and test instances must reach Systems Manager. Image Builder uses Run Command and requires an instance profile with permissions for the build and test components.
- If Image Builder writes build logs to an S3 bucket, its instance profile needs s3:PutObject for that bucket.
- Image Builder added on-demand AMI scanning with Amazon Inspector in October 2026.
- On-demand AMI scanning does not require Inspector account activation. A scan result condition makes Image Builder wait and fail the image for findings above the allowed severity; without one, it can distribute before the scan finishes.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 45 flashcards em lista
Which AWS compute service provides the existing instances that CodeDeploy can update during an in-place deployment?
Amazon EC2 provides the instances that CodeDeploy updates in place.
A team runs a new application version on a separate set of resources, then moves production traffic to it. Which deployment approach is this?
A blue/green deployment.
For EC2 application releases, what separates an in-place CodeDeploy deployment from an immutable deployment?
In-place updates the revision on existing instances. Immutable launches replacement servers with the new configuration or version. Image Builder can build, test, and distribute images for replacement fleets.
An EC2 Auto Scaling group needs a new AMI or instance type across its fleet. Which deployment mechanism should the team choose?
Use an instance refresh with the rolling strategy and the desired launch configuration. It replaces instances in batches. Use CodeDeploy in-place when the requirement is to change the application revision on existing instances.
Does an Amazon ECS rolling deployment modify the application inside each existing task?
No. ECS rolling deployments replace running tasks with new tasks. The term rolling describes gradual rollout and does not imply in-place mutation.
A Beanstalk application uses immutable deployments but an update also changes instance configuration. Is the application deployment policy alone sufficient?
No. Configure immutable updates for both application and instance configuration, or perform separate updates. The two policies are separate.
A blue/green EC2 deployment must switch all traffic instantly with no DNS caching delay. How?
Point the Application Load Balancer listener rule at the green target group.
For Beanstalk Standard, which deployment policies need a full replacement fleet and which needs only an extra batch?
Immutable and traffic splitting create a full replacement instance set. Rolling with additional batch temporarily adds one batch. Plain rolling updates existing batches; blue/green runs a separate environment.
A Beanstalk Standard application must retain serving capacity during a rolling release while adding only one temporary batch. Which policy fits?
Rolling with additional batch. Beanstalk starts the extra batch before taking existing instances out of service.
A Beanstalk immutable environment update cannot launch its replacement fleet because the EC2 quota is too low. What was missing from the capacity plan?
Headroom for a full second set of instances. Immutable updates briefly double instance capacity.
An ECS rolling service has minimumHealthyPercent 100 and maximumPercent 100 with no tasks allowed to stop or start. Why is deployment stuck?
Its configuration permits no progress. The lower healthy bound prevents stopping tasks and the upper bound prevents starting replacements. Adjust the bounds so at least one task can start or stop.
How can Beanstalk Standard rolling deployment batch size be expressed?
As an instance count or a percentage. Smaller batches update fewer instances at a time while old and new versions can coexist.
Which health controls fit CodeDeploy, Beanstalk, ECS rolling, EKS, and an EC2 Auto Scaling instance refresh?
Use CodeDeploy validation hooks and deployment-group alarms; Beanstalk batch health and timeout; ECS circuit breaker or metric alarms; EKS readiness probes for traffic eligibility; instance refresh checkpoints, bake time, and configured auto rollback.
An ECS team wants a small initial traffic share, an evaluation pause, then all remaining traffic moved together. Which strategy fits?
Canary. Linear uses repeated equal increments; canary uses an initial share followed by the remainder.
An EKS application is temporarily unable to serve requests but should not restart. Which probe should remove it from Service traffic?
A readiness probe. Its failure removes the pod from Service traffic until readiness succeeds.
An ECS rolling deployment fails on a newly created service with no COMPLETED deployment. Can the circuit breaker restore a previous revision?
No. It needs a COMPLETED deployment as the rollback target; without one, deployment stalls.
A CodeDeploy CloudWatch alarm stops a deployment. Does that alone configure automatic rollback?
No. Configure automatic rollback on the deployment or deployment group as well as alarm-based stopping.
What does ECS deployment bake time protect after all traffic has moved to the new revision?
An observation interval while both revisions still run. The old revision is terminated after that interval.
An Amazon ECS deployment must shift traffic to a new revision in equal increments. Which strategy fits?
Use a linear deployment. It moves traffic in equal percentage increments with waits between increments.
When should an EC2 deployment combine a prebaked AMI with launch-time bootstrapping?
Prebake application components to reduce launch work, then bootstrap environment-specific customization. Complex setup and large downloads at launch can slow deployment or scaling.
An EC2 Auto Scaling fleet starts slowly because every new instance downloads large dependencies. Which deployment preparation helps?
Prebake those application components into an AMI, then use launch-time bootstrapping only for the remaining customization.
Image Builder published a new AMI and launch template version, but existing Auto Scaling instances still use the old software. What rollout step is missing?
Start an instance refresh using the desired launch configuration. Publishing the image and template version alone does not replace existing instances.
An EC2 Auto Scaling fleet needs a new application version using immutable instances. How should the team roll it out?
Build a new AMI, update the launch template, and start an instance refresh to replace existing instances.
An EC2 fleet takes too long to scale because every instance downloads application software at launch. What image strategy helps?
Prebake the application components into an AMI to reduce startup work.
An administrator creates an EC2 AMI from an instance whose user data configures the application. Will instances launched from that AMI inherit the user data?
No. User data is an instance attribute and is not included in the AMI. Supply it when launching, within the 16 KB raw limit.
An EC2 Linux user data script calls an AWS API and fails during boot. Where should an operator check permissions and output?
Check the instance profile role's API permissions and /var/log/cloud-init-output.log for script output.
An encrypted EC2 AMI must be shared with another account for instance launches. What must be shared?
Grant AMI launch permission and access to its customer managed KMS key. The referenced snapshots need not be separately shared for launch; the default AWS managed key cannot be used for a shared AMI.
A team needs the same tested EC2 image available in multiple AWS Regions. How can Image Builder support an immutable deployment?
Distribute copies of the AMI to the required Regions, then launch instances from those images.
A team publishes a new AMI for its EC2 Auto Scaling group. Does publishing the image replace running instances?
No. Update the launch template and start an instance refresh to replace the existing instances.
An EC2 team wants fast instance startup and environment-specific configuration. How can it combine image and launch strategies?
Prebake common software into the AMI and use bootstrapping for environment-specific customization.
An EC2 Image Builder pipeline must prevent an image from being distributed when validation fails. What should the team configure?
Configure image tests. Image Builder distributes the image only after all configured tests succeed.
How does a team turn an existing unencrypted AMI into an encrypted one?
Copy the AMI with encryption on and a KMS key; the new AMI's snapshots are encrypted.
A company wants each EC2 instance to install software automatically at first launch. Should it use instance metadata or user data?
User data, which runs scripts at launch. Instance metadata only describes the running instance.
How do rollback mechanisms differ between Beanstalk rolling application deployment, immutable deployment, and traffic splitting?
Rolling needs another deployment of a fixed or known good version. A failed immutable deployment terminates its new Auto Scaling group. Traffic splitting can return traffic to the old instances and terminate the new ones during deployment.
A CodeDeploy lifecycle script changes a database schema. Does redeploying the prior application revision automatically reverse that script action?
No. CodeDeploy does not automatically reverse previous script actions. Keep shared schema changes compatible with the application version that rollback would restore.
A team changes a shared database schema before a blue/green code release. What keeps rollback to old code viable?
The new schema must remain compatible with the old application. Additive changes can help if old code tolerates extra fields; removing required fields can make the old version unusable.
A team deploys new application code before changing its shared database schema. What compatibility must it preserve?
The new code must work with the old schema until the database change is applied.
A Beanstalk team has swapped blue/green environment URLs. Can it immediately terminate old blue?
No. Retain it until DNS changes propagate and cached records expire. Some clients can still resolve the old environment.
Does a CodeDeploy rollback restore the original deployment ID?
No. It creates a new deployment of an earlier application revision, with a new deployment ID.
An Auto Scaling instance refresh has completed and the team discovers a problem. Can it invoke rollback on that completed refresh?
No. Rollback applies while the refresh is in progress. Start another refresh to apply the required configuration after completion.
An Auto Scaling instance refresh needs rollback, but the group uses $Latest or an AMI alias from Parameter Store. What must the release plan change?
Use a supported explicit numbered launch template version and specify a desired configuration. Instance refresh rollback does not support $Latest, $Default, or Parameter Store AMI aliases.
Image Builder copies an AMI to an opt-in Region but fails to publish its ID to Parameter Store. What permissions and Region setting should be checked?
Enable the opt-in Region in the source account and grant the execution role ssm:PutParameter and, for aws:ec2:image validation, ec2:DescribeImages.
An Image Builder AMI build in a private subnet cannot run its test components. Which Systems Manager prerequisites should an operator check?
Ensure build and test instances can reach Systems Manager and their instance profile has permissions for the components. Image Builder uses Run Command to operate the instances.
An Image Builder instance cannot upload build logs to the configured Amazon S3 bucket. What permission does its instance profile need?
Grant s3:PutObject for the target bucket's objects.
An Image Builder pipeline must block AMI distribution when an Amazon Inspector on-demand scan finds vulnerabilities above an allowed severity. What must it configure?
Enable on-demand AMI scanning and set a scan result condition. Without the condition, distribution can proceed before the scan finishes. This scan option was added in October 2026.