Public | Automated Build

Last pushed: 2 days ago
Short Description
Automated development build (master)
Full Description


This program requires python3

Currently in (beta release)

Please Report bugs here Issues

For helpful information see Frequently Asked Questions

Python Module documentation

Class <a href="" target="_top">[taskcat.Taskcat]</a>

Sub Class <a href="" target="_parent">[taskcat.Sweeper]</a>

What is TaskCat?

TaskCat is a tool that tests AWS CloudFormation templates. It deploys your AWS CloudFormation template in multiple AWS Regions and generates a report with a pass/fail grade for each region. You can specify the regions and number of Availability Zones you want to include in the test, and pass in parameter values from your AWS CloudFormation template. TaskCat is implemented as a Python class that you import, instantiate, and run.

TestCat was developed by the AWS Quick Start team to test AWS CloudFormation templates that automatically deploy workloads on AWS. We’re pleased to make the tool available to all developers who want to validate their custom AWS CloudFormation
templates across AWS Regions

Files you’ll need

  • config.yml - This file contains the test cases
  • JSON input - This file contains the inputs that you want to pass to AWS CloudFormation template that is being tested

  • Step 1 Building your configuration file

  • Step 2 Building your JSON input file.

Step 1 Creating a config.yml

Open the config.yml file with and editor and update the filenames to match your need.

example here:

Example of config.yml

  project: sample-cloudformation-project <- Must match the root directory of project (usually the name of git repo)
  #s3bucket: projectx-templates <- (Optional) Only needed if you want to use a specific bucket 
    - us-east-1
    - us-east-2
    - us-west-1
    - us-west-2
  # The following test will test in both us-west-1 and us-east-1 using sample-cloudformation-input.json as inputs
      - us-west-1
      - us-east-1
    template_file: sample-cloudformation-project-novpc.template
    parameter_input: sample-cloudformation-input-novpc.json
  # The following test will test in both all 4 region defined in the global region section using sample-cloudformation-input.json as inputs
    parameter_input: sample-cloudformation-input-withvpc.json
    template_file: sample-cloudformation-project-withvpc.template

Example of project directory structure

├── LICENSE.txt
├── ci
│   ├── config.yml <- This the config file that will hold all the test definitions 
│   ├──  sample-cloudformation-input-novpc.json <-  This file contain input that will pass in during stack creation [vpc version] (See auto parms for more info)
│   └──  sample-cloudformation-input-withvpc.json <-  This file contain input that will pass in during stack creation [no-vpc version](See auto parms for more info)
├── scripts
│   └── <- If you have userdata scripts you can load then in the scripts directory
├── submodules  <- If you have git submodules you can load them in the submodules directory
│   └── quickstart-aws-vpc
│       └── templates
│           └── aws-vpc.template
└── templates
    ├── sample-cloudformation-project-novpc.template 
    └── sample-cloudformation-project-withvpc.template <- Second version on template that will create a vpc with the workload 

Step 2 Building a json input file

The example below shows an input file for a stack that requires four parameters KeyPair,InstanceType, AvailablityZones and Password

Note: you can auto generate values at runtime using special tokens (see example below).

The following json will evaluate


    "ParameterKey": "KeyPair",
    "ParameterValue": "mykey"
}, {
    "ParameterKey": "InstanceType",
    "ParameterValue": "t2.small"
}, {
    "ParameterKey": "AvailablityZones",
    "ParameterValue": "$[taskcat_genaz_2]"
}, {
    "ParameterKey": "RandomString",
    "ParameterValue": "$[taskcat_random-string]"
}, {
    "ParameterKey": "RandomNumbers",
    "ParameterValue": "$[taskcat_random-numbers]"
}, {
    "ParameterKey": "GenerateUUID",
    "ParameterValue": "$[taskcat_genuuid]"
}, {
    "ParameterKey": "Password",
    "ParameterValue": "$[taskcat_genpass_8A]"


    "ParameterKey": "KeyPair",
    "ParameterValue": "mykey"
}, {
    "ParameterKey": "InstanceType",
    "ParameterValue": "t2.small"
} {
    "ParameterKey": "AvailablityZones",
    "ParameterValue": "us-east-1a, us-east1b"
}, {
    "ParameterKey": "RandomString",
    "ParameterValue": "yysuawpwubvotiqgwjcu"
}, {
    "ParameterKey": "RandomNumbers",
    "ParameterValue": "56188163597280820763"
}, {
    "ParameterKey": "GenerateUUID",
    "ParameterValue": "1c2e3483-2c99-45bb-801d-8af68a3b907b"
}, {
    "ParameterKey": "Password",
    "ParameterValue": "tI8zN3iX8"

More information on Auto-generated stack inputs


Value that matches the following pattern will be replaced

  • Parameters must start with $[
  • Parameters must end with ]
  • genpass in invoked when _genpass_X is found
  • X is length of the string

(Optionally - you can specify the type of password by adding A or S)

  • A alpha-numeric passwords
  • S passwords with special characters

Example: $[taskcat_genpass_8A]
Generates: tI8zN3iX8
Example: $[taskcat_genpass_8S]
Generates: mA5@cB5!

(Availability Zones)

Value that matches the following pattern will be replaced

  • Parameters must start with $[
  • Parameters must end with ]
  • genaz in invoked when _genaz_X is found
  • A number of AZ's will be selected from the region the stack is attempting to launch

Example: $[taskcat_genaz_2]
Generates: us-east-1a, us-east-2b
(if the region is us-east-1)

(Auto generated s3 bucket )

Example: $[taskcat_autobucket]
Generates: <evaluates to auto generated bucket name>

(Generate UUID String)

Example: $[taskcat_genuuid]
Generates: 1c2e3483-2c99-45bb-801d-8af68a3b907b

(Generate Random String)

Example: $[taskcat_random-string]
Generates: yysuawpwubvotiqgwjcu

Example: $[taskcat_random-numbers]
Generates: 56188163597280820763

Installing TaskCat

Installing TaskCat (Docker install is recommended)

Prerequisites: docker

curl -s| sudo python -E

Note: (If you do not have root privileges taskcat will install in the current directory)

Installing via pip

Prerequisites: Python 3.5+ and pip3

curl -s| python -E

Running TaskCat

If you have AWS credentials sourced (or default boto profile is available)

taskcat -c sample-taskcat-project/ci/config.yml

If you need to pass ACCESS and SECRET keys

taskcat -c sample-taskcat-project/ci/config.yml -A YOUR_ACCESS_KEY -S YOUR_SECRET_KEY

If you want to use a different account or profile

taskcat -c sample-taskcat-project/ci/config.yml -P boto-profile-name
Docker Pull Command
Source Repository

Comments (0)