Question
What are the CodeDeploy deployment types for EC2?
Click to reveal answer
Answer
In-place (stop app, update, restart) and Blue/Green (new instances, traffic shift, terminate old). Blue/green requires an ELB.
Click to flip back
All CI/CD Pipelines Flashcards
Q: What are the CodeDeploy deployment types for EC2?
A: In-place (stop app, update, restart) and Blue/Green (new instances, traffic shift, terminate old). Blue/green requires an ELB.
Q: How does CodePipeline handle cross-account deployments?
A: The pipeline assumes an IAM role in the target account. Artifacts are encrypted with a CMK shared across accounts via key policy grants.
Q: What is a CodeDeploy deployment group?
A: A set of target instances/tasks identified by tags, ASG, or ECS service. Each group has its own deployment configuration and alarm settings.
Q: What are CodeDeploy lifecycle hooks for EC2?
A: ApplicationStop → BeforeInstall → AfterInstall → ApplicationStart → ValidateService. BeforeBlockTraffic and AfterBlockTraffic for ELB.
Q: How do you implement manual approval in CodePipeline?
A: Add a Manual Approval action in a stage. Optionally send SNS notification. Pipeline pauses until approved/rejected or times out (7 days max).
Q: What is CodeBuild batch build?
A: Run multiple build jobs in parallel from a single buildspec. Useful for testing across multiple runtimes or running unit/integration tests simultaneously.
Q: What is CodeDeploy canary deployment for Lambda?
A: Shifts a percentage of traffic (e.g., 10%) to new version, waits, then shifts remaining 100%. Rolls back if alarms trigger during the wait period.
Q: How do you trigger a pipeline from a Git push?
A: EventBridge rule detects CodeCommit/GitHub push events and starts the pipeline. Preferred over polling for lower latency and cost.
Q: What happens when a CodeDeploy deployment fails?
A: If auto-rollback is enabled, CodeDeploy redeploys the last known good revision. For blue/green, it reroutes traffic back to the original instances.
Q: What is a CodePipeline artifact?
A: A ZIP file stored in the pipeline S3 bucket containing source code, build output, or deployment packages passed between stages.