AWS CodePipeline (CI/CD Pipeline)

Basics of AWS CodePipeline

Monitoring

Effective monitoring is crucial for identifying and troubleshooting CI/CD pipeline issues—such as a build stage that never starts. In this guide, we’ll explore how to monitor AWS CodePipeline at multiple levels and integrate with AWS services for alerts and log retention.

What Can You Monitor in CodePipeline?

A single AWS account can host multiple pipelines. Each pipeline consists of stages (Source, Build, Test, Deploy), and each stage contains one or more actions. You can set up monitoring at three levels:

  • Pipeline
  • Stage
  • Action

The image shows a pipeline diagram labeled "MyPipeline" with four stages: Source, Build, Test, and Deploy, each represented by a circle with additional sub-circles below them.

Amazon EventBridge

Amazon EventBridge is the primary service for reacting to CodePipeline events. It follows a publisher/subscriber model: AWS services publish events, and you define rules to trigger targets such as Lambda, SNS, or SQS.

Note

By default, AWS publishes pipeline events to EventBridge at no cost. You only incur charges for custom, cross-account, or third-party events ($1 per 1 million events).

Supported Event Levels

LevelEvent Types
PipelineStarted, Stopped, Succeeded, Failed
StageStarted, Succeeded, Failed
ActionStarted, Succeeded, Failed, Abandoned

The image shows a diagram titled "Pipeline Events" with four stages: Started, Stopped, Succeeded, and Failed, each represented by an icon.

The image is an informational graphic about Amazon EventBridge, highlighting features such as AWS account integration, publisher/subscriber model, free default event publishing, cross-account access, and third-party access.

For more details, see Amazon EventBridge Documentation.

AWS CloudTrail, Amazon S3 & Amazon SNS

While EventBridge handles high-level pipeline events, AWS CloudTrail records every API call and user action across AWS services. Since CodePipeline orchestrates other services (for example, CodeCommit or CodeBuild), CloudTrail captures those underlying API calls.

  • Amazon S3: Store CloudTrail logs for durable, scalable retention.
  • Amazon SNS: Configure notifications for critical events, such as API call failures.

The image is a diagram showing AWS CloudTrail sending notifications to Amazon SNS and log files to Amazon S3.

Warning

Consider the volume of CloudTrail logs when designing S3 lifecycle policies and SNS subscription limits to avoid unexpected costs.

Summary of Monitoring Options

ServiceUse Case
Amazon EventBridgeReal-time response to pipeline, stage, and action events
AWS CloudTrailAudit trail of API calls made by CodePipeline
Amazon S3Durable storage for large volumes of CloudTrail log files
Amazon SNSAlerting and notifications based on log events

The image is a summary slide showing AWS EventBridge and AWS CloudTrail, along with configuration options at pipeline, stage, and action levels.

References

Watch Video

Watch video content

Previous
Cost Structure