├── .bumpversion.cfg ├── .coveragerc ├── .gitallowed ├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .pre-commit-config.yaml ├── .project_automation ├── deprecation │ └── entrypoint.sh ├── functional_tests │ ├── Dockerfile │ └── entrypoint.sh ├── init │ ├── Dockerfile │ └── entrypoint.sh ├── provision │ └── entrypoint.sh ├── publication │ ├── Dockerfile │ └── entrypoint.sh ├── static_tests │ └── entrypoint.sh └── update │ └── entrypoint.sh ├── .project_config.yml ├── .pylintrc ├── .travis.yml ├── CODEOWNERS ├── LICENSE.txt ├── MANIFEST ├── MANIFEST.in ├── README.md ├── THIRD_PARTY ├── VERSION ├── assets ├── css │ └── taskcat_reporting.css └── docs │ └── images │ ├── logo.png │ ├── taskcat-green-bg.svg │ ├── taskcat.svg │ └── tcat.png ├── bin └── taskcat ├── dev-requirements.txt ├── do_docs_generate.sh ├── do_e2e_tests.sh ├── docs ├── INSTALLATION.md ├── README.md ├── administrative │ ├── CODE_OF_CONDUCT.md │ └── CONTRIBUTING.md ├── custom.css ├── preso │ ├── _content.html │ ├── _footer.html │ ├── _header.html │ └── index.html ├── readme.amiupdater.md ├── schema │ ├── schema_doc.css │ ├── schema_doc.min.js │ └── taskcat_schema.md └── usage │ ├── GENERAL_USAGE.md │ ├── PARAMETER_OVERRIDES.md │ └── PSUEDO_PARAMETERS.md ├── e2e ├── codebuild │ ├── Dockerfile │ ├── Dockerfile-local │ ├── buildspec.yaml │ ├── dockerd-entrypoint.sh │ ├── install.sh │ ├── local-entrypoint.sh │ ├── results_comment.py │ └── run-e2e.sh ├── pr_bot │ ├── handler.py │ └── requirements.txt └── tests │ ├── help.sh │ ├── lint.sh │ ├── package.sh │ ├── test_cli.sh │ ├── test_import.sh │ ├── test_imported │ └── test_retain.py │ └── test_stack_url_helper.sh ├── examples └── sample-taskcat-project │ └── scripts │ └── scripts_userdata.sh ├── generate_config_docs.py ├── generate_schema.py ├── installer ├── docker-installer.sh ├── dockerfiles │ ├── alpine-develop │ │ ├── .dockerignore │ │ └── Dockerfile │ └── alpine-main │ │ ├── .dockerignore │ │ └── Dockerfile └── ec2 │ └── templates │ └── taskcat.template ├── poetry.lock ├── pyproject.toml ├── requirements.txt ├── setup.cfg ├── taskcat ├── .DS_Store ├── __init__.py ├── _amiupdater.py ├── _cfn │ ├── __init__.py │ ├── _log_stack_events.py │ ├── stack.py │ ├── stack_url_helper.py │ ├── template.py │ └── threaded.py ├── _cfn_lint.py ├── _cli.py ├── _cli_core.py ├── _cli_modules │ ├── __init__.py │ ├── config.py │ ├── delete.py │ ├── deploy.py │ ├── generate_config.py │ ├── generate_iam_policy.py │ ├── lint.py │ ├── list.py │ ├── package.py │ ├── package_single.py │ ├── test.py │ ├── update_ami.py │ └── upload.py ├── _client_factory.py ├── _common_utils.py ├── _config.py ├── _dataclasses.py ├── _generate_reports.py ├── _lambda_build.py ├── _legacy_config.py ├── _logger.py ├── _name_generator.py ├── _s3_stage.py ├── _s3_sync.py ├── _template_params.py ├── _tui.py ├── cfg │ ├── amiupdater.cfg.yml │ ├── animals.txt │ ├── cfn_resource_iam_policy.json │ ├── config_schema.json │ └── descriptors.txt ├── exceptions.py ├── iam_policy │ ├── __init__.py │ ├── policy.py │ └── tools.py ├── local_zones.py ├── project_config │ ├── __init__.py │ ├── config.py │ └── tools.py ├── project_templates │ └── quickstart │ │ ├── README.md.jinja │ │ ├── ci │ │ ├── debug-input.json.jinja │ │ ├── taskcat-autobucket-json.yml.jinja │ │ ├── taskcat-autobucket.yml.jinja │ │ └── taskcat.yml.jinja │ │ ├── scripts │ │ └── scripts_userdata.sh.jinja │ │ └── templates │ │ ├── debug-yaml.template.jinja │ │ └── debug.template.jinja ├── regions_to_partitions.py └── testing │ ├── __init__.py │ ├── _abstract_test.py │ ├── _cfn_test.py │ ├── _hooks.py │ ├── _lint_test.py │ ├── _unit_test.py │ └── base_test.py ├── taskcat_plugin_testhook └── __init__.py ├── tests ├── __init__.py ├── data │ ├── config_full_example │ │ └── .taskcat.yml │ ├── config_inheritance │ │ ├── .taskcat.yml │ │ ├── .taskcat_global.yml │ │ └── .taskcat_overrides.yml │ ├── config_output │ │ └── cfg_source │ │ │ ├── .taskcat.yaml │ │ │ └── .taskcat_empty.yaml │ ├── create_fail │ │ ├── ci │ │ │ ├── input.json │ │ │ └── taskcat.yml │ │ └── templates │ │ │ └── test.template.yaml │ ├── create_no_params │ │ ├── .taskcat.yml │ │ └── templates │ │ │ └── test.template.yaml │ ├── delete_fail │ │ ├── ci │ │ │ ├── input.json │ │ │ └── taskcat.yml │ │ └── templates │ │ │ └── test.template.yaml │ ├── fn-foreach-resource-fail │ │ ├── .taskcat.yml │ │ └── templates │ │ │ ├── test.template.yaml │ │ │ ├── test.template_inner.yaml │ │ │ ├── test.template_middle.yaml │ │ │ ├── test.template_middle2.yaml │ │ │ └── test.template_middle3.yaml │ ├── git_branch_without_repo │ │ └── .taskcat.yml │ ├── hook_plugin │ │ ├── .taskcat.yml │ │ └── templates │ │ │ └── test.template.yaml │ ├── lambda_build_with_relative_commits │ │ ├── .taskcat.yml │ │ ├── docker_archive.tar │ │ ├── functions │ │ │ └── source │ │ │ │ ├── TestFuncPip │ │ │ │ ├── a_file │ │ │ │ └── requirements.txt │ │ │ │ └── TestFuncRaw │ │ │ │ └── a_file │ │ ├── lambda_functions │ │ │ └── source │ │ │ │ └── TestFunc │ │ │ │ ├── Dockerfile │ │ │ │ ├── a_file │ │ │ │ └── requirements.txt │ │ ├── submodules │ │ │ └── SomeSub │ │ │ │ ├── lambda_functions │ │ │ │ └── source │ │ │ │ │ └── TestFunc │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── a_file │ │ │ │ │ └── requirements.txt │ │ │ │ └── submodules │ │ │ │ └── DeepSub │ │ │ │ └── lambda_functions │ │ │ │ └── source │ │ │ │ └── TestFunc │ │ │ │ ├── Dockerfile │ │ │ │ ├── c_file │ │ │ │ └── requirements.txt │ │ └── templates │ │ │ └── test.template.yaml │ ├── lambda_build_with_submodules │ │ ├── .taskcat.yml │ │ ├── docker_archive.tar │ │ ├── functions │ │ │ └── source │ │ │ │ ├── TestFuncPip │ │ │ │ ├── a_file │ │ │ │ └── requirements.txt │ │ │ │ └── TestFuncRaw │ │ │ │ └── a_file │ │ ├── lambda_functions │ │ │ └── source │ │ │ │ └── TestFunc │ │ │ │ ├── Dockerfile │ │ │ │ ├── a_file │ │ │ │ └── requirements.txt │ │ ├── submodules │ │ │ └── SomeSub │ │ │ │ ├── lambda_functions │ │ │ │ └── source │ │ │ │ │ └── TestFunc │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── a_file │ │ │ │ │ └── requirements.txt │ │ │ │ └── submodules │ │ │ │ └── DeepSub │ │ │ │ └── lambda_functions │ │ │ │ └── source │ │ │ │ └── TestFunc │ │ │ │ ├── Dockerfile │ │ │ │ ├── c_file │ │ │ │ └── requirements.txt │ │ └── templates │ │ │ └── test.template.yaml │ ├── legacy_test │ │ ├── .taskcat.yml │ │ ├── .taskcat_overrides.yml │ │ ├── ci │ │ │ ├── input.json │ │ │ ├── taskcat.yml │ │ │ └── taskcat_project_override.json │ │ └── templates │ │ │ └── test.template.yaml │ ├── lint-error │ │ ├── .taskcat.yml │ │ └── debug.template │ ├── lint-warning │ │ ├── .taskcat.yml │ │ └── debug.template │ ├── nested-create │ │ ├── .taskcat.yml │ │ └── templates │ │ │ ├── test.template.yaml │ │ │ └── test.template_nested.yaml │ ├── nested-fail │ │ ├── .taskcat.yml │ │ └── templates │ │ │ ├── test.template.yaml │ │ │ ├── test.template_inner.yaml │ │ │ ├── test.template_middle.yaml │ │ │ ├── test.template_middle2.yaml │ │ │ └── test.template_middle3.yaml │ ├── regional_client_and_bucket │ │ ├── .taskcat.yml │ │ ├── .taskcat_global.yml │ │ ├── .taskcat_global_regional_bucket.yml │ │ ├── .taskcat_overrides.yml │ │ └── templates │ │ │ ├── debug-yaml.template │ │ │ └── debug.template │ ├── retain-resources │ │ ├── .taskcat.yml │ │ └── test.template.yaml │ ├── schema │ │ ├── global_config.yml │ │ ├── legacy_project_config.yml │ │ └── project_config.yml │ ├── stackurlhelper │ │ ├── badtemplateurl │ │ │ ├── .taskcat.yml │ │ │ ├── ci │ │ │ │ ├── input.json │ │ │ │ ├── taskcat.yml │ │ │ │ └── upload.yml │ │ │ ├── templates │ │ │ │ ├── test.template.yaml │ │ │ │ └── test.template_nested.yaml │ │ │ └── us-east-1 │ │ │ │ └── test.template_nested.yaml │ │ ├── templates │ │ │ ├── aws-vpc.template │ │ │ ├── create_test_from_template.py │ │ │ ├── sigv2-fixed.yml │ │ │ ├── sigv2.yml │ │ │ ├── test_if_child.yml │ │ │ ├── test_if_master.yml │ │ │ ├── test_join_child.yml │ │ │ ├── test_join_master.yml │ │ │ ├── test_mappings_child.yml │ │ │ └── test_mappings_master.yml │ │ └── test.json │ ├── standalone_template │ │ ├── test.template_no_tc_meta.yaml │ │ ├── test.template_tc_empty_meta.yaml │ │ ├── test.template_tc_full_meta.yaml │ │ └── test.template_w_parameters.yaml │ ├── standalone_template_no_metadata │ │ ├── params.json │ │ └── test.template.yaml │ └── update_ami │ │ └── generic │ │ ├── .taskcat.yml │ │ └── generic.template.json ├── test_amiupdater.py ├── test_cfn_lint.py ├── test_cfn_stack.py ├── test_cfn_template.py ├── test_cfn_threaded.py ├── test_cli.py ├── test_cli_core.py ├── test_cli_module_lint.py ├── test_cli_module_package.py ├── test_cli_module_test.py ├── test_client_factory.py ├── test_common_utils.py ├── test_config.py ├── test_dataclasses.py ├── test_generate_config.py ├── test_lambda_package.py ├── test_s3_sync.py ├── test_stack_url_helper.py ├── test_template_params.py └── testing_module │ ├── __init__.py │ ├── test_abstract.py │ ├── test_base.py │ ├── test_cfn.py │ ├── test_hooks.py │ ├── test_lint.py │ └── test_unit.py ├── travis-specific-requirements.txt ├── update_local_zones.py └── update_partition_region_map.py /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.9.41 3 | commit = False 4 | tag = False 5 | parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? 6 | serialize = 7 | {major}.{minor}.{patch}.{release}{build} 8 | {major}.{minor}.{patch} 9 | 10 | [bumpversion:part:release] 11 | optional_value = prod 12 | first_value = dev 13 | values = 14 | dev 15 | prod 16 | 17 | [bumpversion:part:build] 18 | 19 | [bumpversion:file:VERSION] 20 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = taskcat/ 3 | 4 | [report] 5 | fail_under = 75 6 | -------------------------------------------------------------------------------- /.gitallowed: -------------------------------------------------------------------------------- 1 | 123412341234 2 | 123456789012 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Template to report bugs 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Are you testing a *QuickStart* or *Custom template*? 13 | 2. Attach or link a copy of the template if possible (**remove any sensitive info**) 14 | 3. Provide the parameters that you passed. (**remove any sensitive info**) 15 | 4. How did you install taskcat? (docker or pip3) 16 | 5. Are you using a *profile*, *an instance role* or *access keys* to run taskcat? 17 | 6. Is your AWS environment configured via `aws configure`? 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Version (Please make sure you are running the latest version of taskcat) 26 | - Taskcat Version (ex: [2018.817.210357]) 27 | 28 | Note: Python Version (python3 required) 29 | 30 | To find versions: 31 | *Via taskcat*: `taskcat -V` 32 | *Via pip3*: `pip3 show taskcat` 33 | 34 | Note: both version should match 35 | 36 | To update taskcat run: 37 | *for docker* : `docker pull taskcat/taskcat` 38 | *for pip3*: `pip3 install --upgrade taskcat` 39 | 40 | **Additional context** 41 | Add any other context about the problem here. 42 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | Brief description of what this PR does, and why it is needed (use case)? 4 | 5 | ## Testing/Steps taken to ensure quality 6 | 7 | How did you validate the changes in this PR? 8 | 9 | ### Notes 10 | 11 | Optional. Caveats, Alternatives, Other relevant information. 12 | 13 | ## Testing Instructions 14 | 15 | How to test this PR Start after checking out this branch (bulleted) 16 | * Include test case, and expected output 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compile Source # 2 | ################## 3 | *.pyc 4 | build/ 5 | include/ 6 | share/ 7 | lib/ 8 | dist/ 9 | .cache/ 10 | 11 | # Files generate during legacy cfg converstions 12 | tests/data/legacy_test/.taskcat.yml 13 | tests/data/legacy_test/.taskcat_overrides.yml 14 | 15 | # Misc # 16 | .idea/ 17 | .project 18 | .eggs/ 19 | *.egg-info/ 20 | venv/ 21 | .venv/ 22 | .coverage 23 | .coverage.* 24 | coverage.xml 25 | /.pytest_cache/ 26 | /.mypy_cache/ 27 | taskcat_outputs/ 28 | docs/apidocs/ 29 | # Doc Site 30 | site/ 31 | *.zip 32 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: ^(.travis.yml|.pre-commit-config.yaml|.bumpversion.cfg)$ 2 | fail_fast: true 3 | repos: 4 | - repo: https://github.com/pre-commit/mirrors-isort 5 | rev: v5.10.1 6 | hooks: 7 | - id: isort 8 | # language_version: python3.6 9 | - repo: https://github.com/ambv/black 10 | rev: 22.3.0 11 | hooks: 12 | - id: black 13 | exclude: regions_to_partitions.py 14 | - repo: https://github.com/pre-commit/pre-commit-hooks 15 | rev: v2.4.0 16 | hooks: 17 | - id: check-case-conflict 18 | - id: end-of-file-fixer 19 | - id: mixed-line-ending 20 | args: 21 | - --fix=lf 22 | - id: trailing-whitespace 23 | - id: flake8 24 | additional_dependencies: 25 | - flake8-bugbear>=19.3.0 26 | - flake8-builtins>=1.4.1 27 | - flake8-commas>=2.0.0 28 | - flake8-comprehensions>=2.1.0 29 | - flake8-debugger>=3.1.0 30 | - flake8-pep3101>=1.2.1 31 | - flake8-print>=3.1.0 32 | # language_version: python3.6 33 | - id: pretty-format-json 34 | args: 35 | - --autofix 36 | - --indent=4 37 | - --no-sort-keys 38 | - id: check-merge-conflict 39 | - repo: https://github.com/pre-commit/pygrep-hooks 40 | rev: v1.9.0 41 | hooks: 42 | - id: python-check-blanket-noqa 43 | - id: python-check-mock-methods 44 | - id: python-no-log-warn 45 | - repo: https://github.com/PyCQA/bandit 46 | rev: 1.7.4 47 | hooks: 48 | - id: bandit 49 | files: "^taskcat/" 50 | #- repo: https://github.com/pre-commit/mirrors-mypy 51 | # rev: v0.761 52 | # hooks: 53 | # - id: mypy 54 | # files: "^taskcat/" 55 | - repo: local 56 | hooks: 57 | - id: update-schema 58 | name: update-schema 59 | description: generate schema from dataclasses 60 | entry: ./generate_schema.py 61 | language: system 62 | pass_filenames: false 63 | always_run: true 64 | - id: git-secrets-register-aws 65 | name: git-secrets-register-aws 66 | description: Register AWS patterns with git-secrets 67 | entry: git-secrets --register-aws 68 | language: system 69 | always_run: true 70 | pass_filenames: false 71 | - id: git-secrets 72 | name: git-secrets 73 | description: Run git-secrets 74 | entry: git-secrets --scan 75 | language: system 76 | always_run: true 77 | - id: update-region-mappings 78 | name: update-region-mappings 79 | description: update region-partition mappings 80 | entry: ./update_partition_region_map.py 81 | language: system 82 | pass_filenames: false 83 | always_run: true 84 | - id: pylint-local 85 | name: pylint-local 86 | description: Run pylint in the local virtualenv 87 | entry: pylint "--disable=C0209" "taskcat/" "bin/" 88 | language: system 89 | pass_filenames: false 90 | always_run: true 91 | - id: pytest-local 92 | name: pytest-local 93 | description: Run pytest in the local virtualenv 94 | entry: pytest --cov="./taskcat/" 95 | language: system 96 | pass_filenames: false 97 | always_run: true 98 | -------------------------------------------------------------------------------- /.project_automation/deprecation/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | -------------------------------------------------------------------------------- /.project_automation/functional_tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 2 | RUN pip3 install taskcat 3 | -------------------------------------------------------------------------------- /.project_automation/functional_tests/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | 8 | cd $PROJECT_PATH 9 | pip install pytest 10 | pip install -r dev-requirements.txt -r requirements.txt 11 | pytest 12 | -------------------------------------------------------------------------------- /.project_automation/init/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 2 | 3 | RUN yum update -y &&\ 4 | yum install -y yum-utils 5 | RUN yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \ 6 | yum install -y gh 7 | RUN pip3 install copier 8 | -------------------------------------------------------------------------------- /.project_automation/init/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | 8 | echo "running copier" 9 | cd "${PROJECT_PATH}" 10 | copier copy --defaults -f "${PROJECT_TYPE_PATH}" . 11 | 12 | if [ -n "${BASE_PATH}" ] 13 | then 14 | echo "committing results and pushing to repo" 15 | git add . 16 | git commit -m "initial commit" 17 | git push --force 18 | else 19 | echo "Local build mode (skipping git commit)" 20 | fi 21 | -------------------------------------------------------------------------------- /.project_automation/provision/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | -------------------------------------------------------------------------------- /.project_automation/publication/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 2 | RUN yum install -y yum-utils && yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && yum install -y gh 3 | RUN pip install copier 4 | RUN pip install bump2version 5 | -------------------------------------------------------------------------------- /.project_automation/publication/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | 8 | cd ${PROJECT_PATH} 9 | 10 | pip install poetry 11 | 12 | LAST_COMMIT_MESSAGE=$(git log --format=%B -n 1 | head -n 1) 13 | set +x 14 | poetry config pypi-token.pypi $(aws --region us-west-2 secretsmanager get-secret-value --secret-id pypi --query SecretString --output text) 15 | set -x 16 | 17 | function new_release(){ 18 | LAST_RELEASE_COMMIT=$(git rev-list --tags --max-count=1) 19 | TAG_BODY=$(git --no-pager log --no-merges --oneline ${LAST_RELEASE_COMMIT}..HEAD --pretty='- %h %s') 20 | VERSION=$(poetry version | awk '{print $2}') 21 | git tag -a "${VERSION}" -m "${TAG_BODY}" 22 | git push --tags 23 | } 24 | 25 | update_release_branch(){ 26 | poetry version patch 27 | VERSION=$(poetry version | awk '{print $2}') 28 | git add pyproject.toml 29 | git commit -m "Release: v${VERSION}" 30 | git push origin main:release/v0.x --force 31 | } 32 | 33 | function _gh_release(){ 34 | VERSION=$(poetry version | awk '{print $2}') 35 | gh release create ${VERSION} --title ${VERSION} --generate-notes 36 | } 37 | function _pypi_release(){ 38 | poetry publish --build 39 | } 40 | 41 | set +e 42 | echo ${LAST_COMMIT_MESSAGE} | egrep -i "Merge pull request.*from aws-ia/release.*$"; EC=$? 43 | set -e 44 | if [[ $EC -eq 0 ]]; then 45 | new_release 46 | _gh_release 47 | _pypi_release 48 | else 49 | update_release_branch 50 | fi 51 | -------------------------------------------------------------------------------- /.project_automation/static_tests/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | ## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between 4 | # managed and local tasks always use these variables for the project and project type path 5 | PROJECT_PATH=${BASE_PATH}/project 6 | PROJECT_TYPE_PATH=${BASE_PATH}/projecttype 7 | export NO_DOCKER=true 8 | cd $(mktemp -d) 9 | git clone https://github.com/awslabs/git-secrets.git 10 | cd git-secrets 11 | make install 12 | cd ${PROJECT_PATH} 13 | pip install -r dev-requirements.txt -r requirements.txt 14 | pre-commit run --all-files 15 | if [ $? -ne 0 ]; then 16 | git status 17 | fi 18 | -------------------------------------------------------------------------------- /.project_automation/update/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Do not remove 3 | exit 0 4 | -------------------------------------------------------------------------------- /.project_config.yml: -------------------------------------------------------------------------------- 1 | version: "1.0.0" 2 | 3 | #level 2 4 | init: 5 | dockerfile: .project_automation/init/Dockerfile 6 | entrypoint: .project_automation/init/entrypoint.sh 7 | github_permissions: 8 | contents: write 9 | update: 10 | entrypoint: .project_automation/update/entrypoint.sh 11 | static_tests: 12 | entrypoint: .project_automation/static_tests/entrypoint.sh 13 | functional_tests: 14 | enable_docker: true 15 | entrypoint: .project_automation/functional_tests/entrypoint.sh 16 | publication: 17 | dockerfile: .project_automation/publication/Dockerfile 18 | entrypoint: .project_automation/publication/entrypoint.sh 19 | github_permissions: 20 | contents: write 21 | deprecation: 22 | entrypoint: .project_automation/deprecation/entrypoint.sh 23 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Do not add any additional owners to this file, this is being used to ensure that 2 | # functional tests are run before merge, the taskcat-ci bot will auto-approve once 3 | # tests have passed 4 | * @aws-ia-automator-prod @jaymccon @andrew-glenn @tonynv @tlindsay42 5 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | # file GENERATED by distutils, do NOT edit 2 | setup.cfg 3 | setup.py 4 | taskcat/__init__.py 5 | taskcat/taskcat.py 6 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include requirements.txt 2 | include VERSION 3 | recursive-include taskcat/project_templates * 4 | recursive-include taskcat/cfg * 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![logo](https://raw.githubusercontent.com/aws-ia/taskcat/main/assets/docs/images/tcat.png)](https://taskcat.io/) 2 | [![Build Status](https://travis-ci.com/aws-ia/taskcat.svg?branch=main)](https://travis-ci.com/aws-ia/taskcat) [![PyPI version](https://badge.fury.io/py/taskcat.svg)](https://badge.fury.io/py/taskcat) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 3 | 4 | 5 | 6 | ## What is TaskCat? 7 | **TaskCat** is a tool that tests AWS CloudFormation templates. It deploys your AWS 8 | CloudFormation template in multiple AWS Regions and generates a report with a pass/fail 9 | grade for each region. You can specify the regions and number of Availability Zones you 10 | want to include in the test, and pass in parameter values from your AWS CloudFormation 11 | template. TaskCat is implemented as a Python class that you import, instantiate, and run. 12 | 13 | TaskCat was developed by the aws-ia team to test AWS CloudFormation templates 14 | that automatically deploy workloads on AWS. We’re pleased to make the tool available to 15 | all developers who want to validate their custom AWS CloudFormation templates across 16 | AWS Regions 17 | 18 | __See [TaskCat documentation](https://aws-ia.github.io/taskcat/).__ 19 | 20 | ## Support 21 | [![Feature Request](https://img.shields.io/badge/Open%20Issues-Feature%20Request-green.svg)](https://github.com/aws-ia/taskcat/issues/new/choose) 22 | [![Report Bugs](https://img.shields.io/badge/Open%20Issue-Report%20Bug-red.svg)](https://github.com/aws-ia/taskcat/issues/new/choose) 23 | 24 | ## GitHub 25 | 26 | [![GitHub stars](https://img.shields.io/github/stars/aws-ia/taskcat.svg?style=social&label=Stars)](https://github.com/aws-ia/taskcat) 27 | [![GitHub issues](https://img.shields.io/github/issues/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/issues) 28 | [![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/issues?q=is%3Aissue+is%3Aclosed) 29 | [![GitHub pull requests](https://img.shields.io/github/issues-pr/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/pulls) 30 | [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/pulls?q=is%3Apr+is%3Aclosed) 31 | 32 | ## PyPi 33 | 34 | [![PyPI - Downloads](https://img.shields.io/pypi/dw/taskcat.svg)](https://pypi.org/project/taskcat/#history) 35 | [![PyPI - Downloads](https://img.shields.io/pypi/dm/taskcat.svg)](https://pypi.org/project/taskcat/#history) 36 | -------------------------------------------------------------------------------- /THIRD_PARTY: -------------------------------------------------------------------------------- 1 | Copyright 2022, Caleb P. Burns <2126043+cpburnz@users.noreply.github.com> 2 | 3 | SPDX-License-Identifier: MPL-2.0 4 | This Source Code Form is subject to the terms of the Mozilla Public 5 | License, v. 2.0. If a copy of the MPL was not distributed with this 6 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | https://github.com/cpburnz/python-pathspec/releases/tag/v0.10.3 9 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.9.42 2 | -------------------------------------------------------------------------------- /assets/docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-ia/taskcat/bfa51dbffa1e6812b99060692ade5f9178dde90a/assets/docs/images/logo.png -------------------------------------------------------------------------------- /assets/docs/images/tcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-ia/taskcat/bfa51dbffa1e6812b99060692ade5f9178dde90a/assets/docs/images/tcat.png -------------------------------------------------------------------------------- /bin/taskcat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | 4 | from taskcat._cli import main 5 | from taskcat.exceptions import TaskCatException 6 | 7 | if __name__ == "__main__": 8 | if sys.version_info[0] == 3 and sys.version_info[1] >= 6: 9 | main() 10 | else: 11 | raise TaskCatException("Please use Python 3.6+") 12 | -------------------------------------------------------------------------------- /dev-requirements.txt: -------------------------------------------------------------------------------- 1 | pre-commit~=2.9.2 2 | black~=24.3.0 3 | pylint~=3.2 4 | pytest-cov~=2.7 5 | codecov~=2.0 6 | -------------------------------------------------------------------------------- /do_docs_generate.sh: -------------------------------------------------------------------------------- 1 | # Clean up docs 2 | mkdir -p docs/apidocs 3 | mkdir -p docs/schema 4 | # Install docs tools 5 | pip install portray pdocs json-schema-for-humans 6 | 7 | # Gererate API docs 8 | portray as_html taskcat -o docs/apidocs/ --overwrite 9 | 10 | # Generate taskcat schema docs 11 | python3 generate_schema.py 12 | generate-schema-doc --config expand_buttons=true taskcat/cfg/config_schema.json docs/schema/taskcat_schema.md 13 | 14 | printf "\n\nReformatting schema files to specifications. Ignore the end-of-file-fixer error.\n\n" 15 | pre-commit run --all-files 16 | 17 | # Push to gh_pages 18 | portray on_github_pages --overwrite 19 | -------------------------------------------------------------------------------- /do_e2e_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | echo "Building codebuild image..." 4 | cd e2e/codebuild/ 5 | docker build . -t taskcat-e2e:latest > /dev/null 6 | docker build . -f Dockerfile-local -t taskcat-e2e-local:latest > /dev/null 7 | cd ../../ 8 | 9 | 10 | echo "getting temporary credentials..." 11 | ROLE_ARN=$(aws iam list-roles --region us-east-1 \ 12 | --query 'Roles[?RoleName == `taskcat-e2e-test`].Arn' --output text) 13 | if [[ $(echo "${ROLE_ARN}" | grep -c "taskcat-e2e-test") -eq 0 ]] ; then 14 | echo "creating AdministratorAccess role taskcat-e2e-test..." 15 | ARN=$(aws sts get-caller-identity --query 'Arn' --output text --region us-east-1) 16 | POLICY_DOC="{\"Version\": \"2012-10-17\", \"Statement\": [{\"Sid\": \"\", \"Effect\": \"Allow\", \"Principal\": {\"AWS\": \"${ARN}\"}, \"Action\": \"sts:AssumeRole\"}]}" 17 | ROLE_ARN=$(aws iam create-role --role-name "taskcat-e2e-test" \ 18 | --description "taskcat e2e test role" \ 19 | --assume-role-policy-document "${POLICY_DOC}" \ 20 | --region us-east-1 --query 'Role.Arn') 21 | aws iam attach-role-policy --role-name "taskcat-e2e-test" \ 22 | --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --region us-east-1 23 | fi 24 | read -r AKI SAK ST <<< $(aws sts assume-role --role-arn ${ROLE_ARN} \ 25 | --role-session-name local-e2e-test \ 26 | --query '[Credentials.AccessKeyId, Credentials.SecretAccessKey, Credentials.SessionToken]' \ 27 | --output text) 28 | 29 | 30 | echo "executing e2e test container... (privileged mode needed for docker in docker)" 31 | docker run -it --privileged --rm --name taskcat-e2e \ 32 | --mount type=bind,source="$(pwd)",target=/taskcat -e AWS_ACCESS_KEY_ID=${AKI} \ 33 | -e AWS_SECRET_ACCESS_KEY=${SAK} -e AWS_SESSION_TOKEN=${ST} \ 34 | taskcat-e2e-local:latest 35 | 36 | echo "" 37 | cat ./cov_report 38 | rm ./cov_report 39 | -------------------------------------------------------------------------------- /docs/INSTALLATION.md: -------------------------------------------------------------------------------- 1 | 2 | ## Installation 3 | 4 | Currently only installation via pip is supported. 5 | 6 | ### Requirements 7 | ![Python pip](https://img.shields.io/badge/Prerequisites-pip-blue.svg) 8 | [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/taskcat.svg)](https://pypi.org/project/taskcat/#history) 9 | ![Python pip](https://img.shields.io/badge/Prerequisites-docker-yellow.svg) 10 | 11 | The host taskcat is run on requires access to an AWS account, this can be done by any 12 | of the following mechanisms: 13 | 14 | 1. Environment variables 15 | 2. Shared credential file (~/.aws/credentials) 16 | 3. AWS config file (~/.aws/config) 17 | 4. Assume Role provider 18 | 5. Boto2 config file (/etc/boto.cfg and ~/.boto) 19 | 6. Instance metadata service on an Amazon EC2 instance that has an IAM role configured. 20 | 21 | for more info see the [boto3 credential configuration documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html). 22 | 23 | !!! note 24 | docker is only required if building lambda functions using a Dockerfile 25 | 26 | ### Installing via pip3 27 | 28 | ```python 29 | pip3 install taskcat 30 | ``` 31 | ### Installing via pip3 --user 32 | *will install taskcat into homedir, useful if you get permissions errors with the regular method* 33 | 34 | ```python 35 | pip3 install taskcat --user 36 | ``` 37 | 38 | ???+note 39 | The user install dir is platform specific 40 | 41 | On Mac: 42 | 43 | - `~/Library/Python/3.x/bin/taskcat` 44 | 45 | On Linux: 46 | 47 | - `~/.local/bin` 48 | 49 | !!! warning 50 | Be sure to add the python bin dir to your **$PATH** 51 | 52 | ### Windows 53 | 54 | Taskcat on Windows is **not supported**. 55 | 56 | If you are running Windows 10 we recommend that you install [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) and then install taskcat inside the WSL environment. For details, see [Install and configure TaskCat on Microsoft Windows 10](https://aws.amazon.com/blogs/infrastructure-and-automation/install-and-configure-taskcat-on-microsoft-windows-10/). 57 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | [![logo](https://raw.githubusercontent.com/aws-ia/taskcat/main/assets/docs/images/tcat.png)](https://taskcat.io/) 2 | 3 | [![Build Status](https://travis-ci.com/aws-ia/taskcat.svg?branch=main)](https://travis-ci.com/aws-ia/taskcat) [![PyPI version](https://badge.fury.io/py/taskcat.svg)](https://badge.fury.io/py/taskcat) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 4 | 5 | 6 | ## What is taskcat? 7 | **taskcat** is a tool that tests AWS CloudFormation templates. It deploys your AWS 8 | CloudFormation template in multiple AWS Regions and generates a report with a pass/fail 9 | grade for each region. You can specify the regions and number of Availability Zones you 10 | want to include in the test, and pass in parameter values from your AWS CloudFormation 11 | template. taskcat is implemented as a Python class that you import, instantiate, and run. 12 | 13 | taskcat was developed by the aws-ia team to test AWS CloudFormation templates 14 | that automatically deploy workloads on AWS. We’re pleased to make the tool available to 15 | all developers who want to validate their custom AWS CloudFormation templates across 16 | AWS Regions 17 | 18 | 19 | ## Support 20 | [![Feature Request](https://img.shields.io/badge/Open%20Issues-Feature%20Request-green.svg)](https://github.com/aws-ia/taskcat/issues/new/choose) 21 | [![Report Bugs](https://img.shields.io/badge/Open%20Issue-Report%20Bug-red.svg)](https://github.com/aws-ia/taskcat/issues/new/choose) 22 | 23 | ## GitHub 24 | 25 | [![GitHub stars](https://img.shields.io/github/stars/aws-ia/taskcat.svg?style=social&label=Stars)](https://github.com/aws-ia/taskcat) 26 | [![GitHub issues](https://img.shields.io/github/issues/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/issues) 27 | [![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/issues?q=is%3Aissue+is%3Aclosed) 28 | [![GitHub pull requests](https://img.shields.io/github/issues-pr/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/pulls) 29 | [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/aws-ia/taskcat.svg)](https://github.com/aws-ia/taskcat/pulls?q=is%3Apr+is%3Aclosed) 30 | 31 | ## PyPi 32 | 33 | [![PyPI - Downloads](https://img.shields.io/pypi/dw/taskcat.svg)](https://pypi.org/project/taskcat/#history) 34 | [![PyPI - Downloads](https://img.shields.io/pypi/dm/taskcat.svg)](https://pypi.org/project/taskcat/#history) 35 | -------------------------------------------------------------------------------- /docs/administrative/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community. 4 | 5 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution. 6 | 7 | Documentation Links: 8 | 9 | [Module Documentation](https://aws-ia.github.io/taskcat/) 10 | 11 | [User Guide](https://aws-ia.github.io/auto-testing.html) 12 | 13 | ## Reporting Bugs/Feature Requests 14 | 15 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 16 | 17 | When filing an issue, please check [existing open](https://github.com/aws-ia/taskcat/issues), or [recently closed](https://github.com/aws-ia/taskcat/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 18 | 19 | * A reproducible test case or series of steps 20 | * The version of our code being used 21 | * Any modifications you've made relevant to the bug 22 | * Anything unusual about your environment or deployment 23 | 24 | ## Contributing via Pull Requests (Pull request template provided) 25 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 26 | 27 | 1. All changes are staged into the *develop* branch (Send PR to the *develop* branch) 28 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 29 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 30 | 31 | To send us a pull request, please: 32 | 33 | 1. Fork the repository. 34 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 35 | 3. Ensure local tests pass. 36 | 4. Commit to your fork using clear commit messages. 37 | 5. Send us a pull request, answering any default questions in the pull request interface. 38 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 39 | 40 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | ## Licensing 43 | We may ask you to affirm the Apache 2.0 agreement for larger changes. 44 | -------------------------------------------------------------------------------- /docs/preso/_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/preso/_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Remark 8 | 120 | 121 | 122 |