A Python script to monitor AWS CodePipeline deployments and display pipeline information in a tabulated format.
- List all pipelines matching specified filters
- Display current branch, status, and last execution time
- Show commit messages and execution duration
- Filter pipelines by name
- Command-line argument support for filters
- Python 3.6 or higher
- AWS credentials with appropriate permissions
- Required Python packages (see Installation)
- Clone the repository:
git clone https://github.com/yourusername/aws_pipeline_monitor.git
cd AWSPipelineMonitor- Create and activate a virtual environment:
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate- Install the required packages:
pip install -r requirements.txt- Set up your AWS credentials:
# Copy the example environment file
cp .env.example .env- Edit the
.envfile with your AWS credentials The.envfile should contain:
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_SESSION_TOKEN=your_session_token
AWS_REGION=your_region # Optional, defaults to eu-west-1Alternatively, you can set the environment variables directly:
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_SESSION_TOKEN=your_session_token
export AWS_REGION=your_region # Optional, defaults to eu-west-1Basic usage with default filter ("kulu"):
python pipeline_monitor.pySpecify a single filter:
python pipeline_monitor.py --filters coreSpecify multiple filters:
python pipeline_monitor.py --filters core service=== AWS CodePipeline Deployment Monitor ===
Last updated: 01/01/2024 12:00
Filtering pipelines containing: core
+------------------+--------+-----------+------------------+----------+-------------------------------+
| Pipeline | Branch | Status | Last Run | Duration | Commit Message |
+==================+========+===========+==================+==========+===============================+
| core-service-1 | main | Succeeded | 01/01/2024 11:30 | 5m 30s | Update dependencies |
+------------------+--------+-----------+------------------+----------+-------------------------------+
| core-service-2 | dev | Failed | 01/01/2024 10:45 | 2m 15s | Fix authentication issue |
+------------------+--------+-----------+------------------+----------+-------------------------------+
The script requires your IAM role to have the following AWS permissions:
codepipeline:ListPipelinescodepipeline:GetPipelinecodepipeline:ListPipelineExecutionscodepipeline:GetPipelineExecution
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.