Skip to content

Nilesh2000/AWSPipelineMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Pipeline Monitor

A Python script to monitor AWS CodePipeline deployments and display pipeline information in a tabulated format.

Features

  • 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

Prerequisites

  • Python 3.6 or higher
  • AWS credentials with appropriate permissions
  • Required Python packages (see Installation)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/aws_pipeline_monitor.git
cd AWSPipelineMonitor
  1. 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
  1. Install the required packages:
pip install -r requirements.txt
  1. Set up your AWS credentials:
# Copy the example environment file
cp .env.example .env
  1. Edit the .env file with your AWS credentials The .env file 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-1

Alternatively, 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-1

Usage

Basic usage with default filter ("kulu"):

python pipeline_monitor.py

Specify a single filter:

python pipeline_monitor.py --filters core

Specify multiple filters:

python pipeline_monitor.py --filters core service

Output Example

=== 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      |
+------------------+--------+-----------+------------------+----------+-------------------------------+

Required AWS Permissions

The script requires your IAM role to have the following AWS permissions:

  • codepipeline:ListPipelines
  • codepipeline:GetPipeline
  • codepipeline:ListPipelineExecutions
  • codepipeline:GetPipelineExecution

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Monitor AWS CodePipeline deployments. View pipeline status, branches, commit messages, and execution details in a clean tabulated format. Built specifically for a client use case.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages