Skip to content

Terraform module to report CodePipeline stage execution status to the GitHub commit status API using a Lambda function and CloudWatch Events.

License

Notifications You must be signed in to change notification settings

rearc/terraform-aws-codepipeline-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-codepipeline-status

Terraform module to report CodePipeline stage execution status to the GitHub commit status API using a Lambda function and CloudWatch Events.

Authenticating to GitHub

This module supports authenticating as a GitHub App or with a GitHub personal access token. Most teams should go through the steps below to setup a GitHub App so the integration will continue to work regardless of individuals leaving.

Creating the GitHub App

In your GitHub organization go to Settings -> GitHub Apps (within Developer settings). Click New GitHub App.

For GitHub App name: ${your organization}-codepipeline (Must be unique.)

Description: This GitHub App updates the commit status when CodePipeline runs.

Homepage: https://github.com/rearc/terraform-aws-codepipeline-status

Register App

Uncheck Active under Webhook.

Webhook Inactive

For Repository permissions add Read & write for Commit statuses.

Status Permissions

Otherwise, leave the defaults and click Create GitHub App.

From the new application's general settings, take note of the App ID, upload a logo that will appear on all the commit statuses and generate a private key that will be used for signing access token requests.

App ID

Then go to Install App and Install in your organization. From there take note of the App installation ID which is the number at the end of the URL:

Installation ID

Adding the key or token to Parameter Store

Login to the AWS Console, go to Systems Manager, go to Parameter Store and click Create parameter.

Name: codepipeline-status-key

Description: GitHub App private key for codepipeline-status-reporter Lambda function

Type: SecureString

Value: Paste the contents of the private key generated for the GitHub App.

Create Parameter

Click Create parameter.

With the GitHub App ID, App installation ID, and the name of the parameter for the private key, you have all the input variables necessary to deploy the Terraform module to your account.

About

Terraform module to report CodePipeline stage execution status to the GitHub commit status API using a Lambda function and CloudWatch Events.

Resources

License

Stars

Watchers

Forks

Packages

No packages published