Building pipelines with CodePipeline
1. Building pipelines with CodePipeline
Welcome back! In the last video we mapped the four AWS Code services to pipeline stages. Now let's go deeper into the orchestrator that ties them together.2. Multi-stage pipelines
Real pipelines are rarely a single step. CodePipeline models your release as a series of stages that run in order, and each stage only starts once the one before it succeeds. That ordering is what makes a pipeline safe. Source has to resolve before you build, the build has to pass before you deploy, and a failure anywhere stops the line before bad code moves forward. Let's break down how those stages fit together.3. Anatomy of a CodePipeline pipeline
A pipeline is a sequence of stages that execute in order. Each stage contains action groups, and each action group contains actions. An action is a single task like pulling source code or starting a build. Actions in the same group run in parallel; groups run sequentially. When an action completes, it produces an output artifact stored in S3. The next stage consumes those artifacts as input.4. Connecting source, build, and deploy
In a basic three-stage pipeline, the Source stage watches CodeCommit. When code is pushed, it downloads the source as an artifact. That artifact flows to the Build stage, where CodeBuild compiles, tests, and produces a build artifact. The build artifact flows to the Deploy stage, where CodeDeploy releases it to your target environment. The entire chain runs automatically on every push. No manual handoffs, no waiting for someone to copy files.5. Manual approval actions
Manual approval actions insert a human checkpoint into your pipeline. When the pipeline reaches an approval action, it pauses until someone approves or rejects. This is commonly used between staging and production deploys. You can configure SNS notifications so the approver gets an email. The console shows the status Waiting for approval until a decision is made. With this gate in place, no code reaches production without a human signing off.6. Stage transitions and pipeline control
CodePipeline gives you fine-grained control. You can disable transitions between stages to pause the pipeline during maintenance windows. If an action fails, you can retry just that action without restarting the entire pipeline. The Release Change button lets you manually trigger the pipeline with the latest source. These controls give you flexibility while keeping automation in place.7. Pipeline event notifications
CodePipeline sends events to Amazon EventBridge for every lifecycle change: pipeline started, stage succeeded, stage failed. You create EventBridge rules to match specific events and route them to targets like SNS topics for email alerts or Lambda functions for custom automation. Each event includes the pipeline name, stage name, and for failures, the reason. This gives your team immediate visibility into pipeline health.8. Multi-environment pipeline design
A well-designed pipeline promotes the same artifact through multiple environments. The build stage produces one artifact, and that exact artifact deploys to dev, staging, then production. This ensures the code you tested in staging is exactly what runs in production; you never rebuild between environments. Add a manual approval between staging and production for a safety gate.9. Let's practice!
Let's now practice what we have learned!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.