reference deployment

Git webhooks with AWS services

HTTPS endpoint and code for linking your Git repository to the AWS Cloud

This Quick Start deploys an HTTPS endpoint you can use to configure a webhook to link your Git and AWS services. With a webhook in place, each time a Git user pushes a commit, your repository is automatically retrieved, zipped, and uploaded to an Amazon Simple Storage System (Amazon S3) bucket. You can then configure AWS services such as AWS CodePipeline, AWS CodeBuild, and AWS CodeDeploy to use the S3 bucket as a source.

AWS-Logo_Full-Color_100x60

This Quick Start was developed by
AWS solutions architects.

 


AWS Service Catalog administrators can add this architecture to their own catalog.  

  •  What you'll build
  •  How to deploy
  •  Cost and licenses
  •  What you'll build
  • This Quick Start sets up a serverless AWS Cloud environment that includes the following components:

    • An Amazon API Gateway endpoint to receive Git webhook requests and forward them to AWS Lambda.
    • An AWS Lambda function to process Git webhook requests from API Gateway and invoke an AWS CodeBuild project.
    • An AWS CodeBuild project to connect to your Git service, then retrieve, zip, and upload the latest version of your Git repository to Amazon S3.
    • An AWS Key Management Service (AWS KMS) key to encrypt/decrypt SSH (Secure Shell) keys used by CodeBuild to connect to your Git repository using SSH. The SSH key pair is generated by a Lambda-backed AWS CloudFormation custom resource when the stack is deployed.
    • Two Amazon S3 buckets: one for Git repository contents, and another for encrypted SSH keys. A Lambda-backed AWS CloudFormation custom resource deletes the contents of the S3 buckets when you delete the stack. If you need backups, copy the S3 buckets before deleting the stack.
  •  How to deploy
  • To build your Git environment with AWS, follow the instructions in the deployment guide. The deployment process includes these steps:

    1. If you don't already have an AWS account, sign up at https://aws.amazon.com.
    2. Launch the Quick Start. The deployment takes about 15 minutes.
    3. Configure your Git repository to set up webhooks, following the instructions from your Git service. (You must be able to connect to your Git repository over the internet.)
    4. Configure an AWS service to connect to the S3 object.
    5. Test a commit.

    Amazon may share user-deployment information with the AWS Partner that collaborated with AWS on the Quick Start.  

  •  Cost and licenses
  • You are responsible for the cost of the AWS services used while running this Quick Start reference deployment. There is no additional cost for using the Quick Start.

    This Quick Start deploys an AWS Key Management Service (AWS KMS) key which incurs a monthly cost for key storage and usage. (See AWS Key Management Service pricing.)

    API Gateway, Amazon S3, Lambda, and AWS CodeBuild costs vary depending on how often you commit code to the connected Git repository. (See Amazon API Gateway pricing, Amazon S3 pricing, AWS Lambda pricing, and AWS CodeBuild pricing.)