reference deployment

CI/CD Pipeline for AWS CloudFormation templates on AWS

Use AWS TaskCat, AWS CodePipeline, and AWS CodeBuild to test and deploy your templates

This Quick Start deploys a continuous integration and continuous delivery (CI/CD) pipeline on the Amazon Web Services (AWS) Cloud in about 15 minutes, to automatically test AWS CloudFormation templates from a GitHub repository.  

The CI/CD environment includes AWS TaskCat for testing, AWS CodePipeline for continuous integration, and AWS CodeBuild as your build service.

TaskCat is an open-source tool that tests AWS CloudFormation templates. It creates stacks in multiple AWS Regions simultaneously and generates a report with a pass/fail grade for each region. You can specify the regions, indicate the number of Availability Zones you want to include in the test, and pass in the AWS CloudFormation parameter values you want to test. You can use the CI/CD pipeline to test any AWS CloudFormation templates, including nested templates, from a GitHub repository.

taskcat-logo

This Quick Start was developed by
AWS solutions architects.

 

  •  What you'll build
  •  How to deploy
  •  Cost and licenses
  •  What you'll build
  • Use this Quick Start to set up the following on AWS:

    • A pipeline created by CodePipeline, which is triggered when a commit is made to the referenced branch of the Github repository used in the source stage.
    • A build project in CodeBuild to run TaskCat and launch AWS CloudFormation templates for testing.
    • An AWS Lambda function that merges the source branch of the Github repository with the release branch.
    • AWS Identity and Access Management (IAM) roles for the Lambda function and the build project.
    • An Amazon Simple Storage Service (Amazon S3) bucket to stash the build artifacts temporarily and to store the TaskCat report.
     
    The CI/CD pipeline consists of three stages:
     
    • Source stage. When a commit is made into the source branch of the GitHub repository, it triggers the CI/CD pipeline. The repository contents are pulled, zipped, and stored in an S3 bucket.
    • Build/test stage. CodeBuild creates a Linux container, installs TaskCat and its dependencies in the container, downloads the zipped file that contains the source code from the S3 bucket, unpacks it, and runs tests using TaskCat. TaskCat generates a report that is uploaded to the S3 bucket. If the tests are successful, the deploy stage is triggered.
    • Deploy stage. CodePipeline runs a Lambda function that merges the source branch of the GitHub repository into the release branch. The code is now ready to deploy from the GitHub repository.  
  •  How to deploy
  • To build your CI/CD environment for testing AWS CloudFormation templates on AWS, follow the instructions in the deployment guide. The Quick Start requires a GitHub repository that contains a configuration file, a parameters file, and the AWS CloudFormation templates you want to test.

    The deployment process includes these steps:

    1. If you don't already have an AWS account, sign up at https://aws.amazon.com.
    2. Set up a GitHub OAuth 2 token with the scopes admin:repo_hook and repo.
    3. Launch the Quick Start. The deployment takes about 15 minutes.
    4. Verify the deployment by viewing the CI/CD pipeline in the CodePipeline console.
  •  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.

    The AWS CloudFormation template for this Quick Start includes configuration parameters that you can customize. For cost estimates, see the pricing pages for each AWS service you will be using. Prices are subject to change.

    Tip  After you deploy the Quick Start, we recommend that you enable the AWS Cost and Usage Report to track costs associated with the Quick Start. This report delivers billing metrics to an S3 bucket in your account. It provides cost estimates based on usage throughout each month, and finalizes the data at the end of the month. For more information about the report, see the AWS documentation.

    This Quick Start deploys AWS TaskCat, which is open source and free to use under the Apache 2.0 license.