Skip to content

Deploy

taskcat._cli_modules.deploy

Deploy

[ALPHA] installs a stack into an AWS account/regions

list(profiles='default', regions='ALL') staticmethod

:param profiles: comma separated list of aws profiles to search :param regions: comma separated list of regions to search, default is to check all commercial regions

Source code in taskcat/_cli_modules/deploy.py
@staticmethod
def list(profiles: str = "default", regions="ALL"):
    """
    :param profiles: comma separated list of aws profiles to search
    :param regions: comma separated list of regions to search, default is to check
    all commercial regions
    """
    List(profiles=profiles, regions=regions, stack_type="project")

run(project='./', test_names='ALL', regions='ALL', name='', input_file='./.taskcat.yml')

:param project: name of project to install can be a path to a local project, a github org/repo, or an AWS Quick Start name :param test_names: comma separated list of tests (specified in .taskcat.yml) to run defaults to the 'default' test. Set to 'ALL' to deploy every entry :param regions: comma separated list of regions to test in default :param name: stack name to use, if not specified one will be automatically generated :param input_file: path to either a taskcat project config file or a CloudFormation template

Source code in taskcat/_cli_modules/deploy.py
def run(  # noqa: C901
    self,
    project: str = "./",
    test_names: str = "ALL",
    regions: str = "ALL",
    name="",
    input_file: str = "./.taskcat.yml",
):
    """
    :param project: name of project to install can be a path to a local project,\
    a github org/repo, or an AWS Quick Start name
    :param test_names: comma separated list of tests (specified in .taskcat.yml) to run\
        defaults to the 'default' test. Set to 'ALL' to deploy every entry
    :param regions: comma separated list of regions to test in\
    default
    :param name: stack name to use, if not specified one will be automatically\
    generated
    :param input_file: path to either a taskcat project config file or a CloudFormation template
    """
    if not name:
        name = generate_name()
    path = Path(project).resolve()
    if Path(project).resolve().is_dir():
        package_type = "local"
    elif "/" in project:
        package_type = "github"
    else:  # assuming it's an AWS Quick Start
        package_type = "github"
        project = f"aws-quickstart/quickstart-{project}"
    if package_type == "github":
        if project.startswith("https://") or project.startswith("git@"):
            url = project
            org, repo = (
                project.replace(".git", "").replace(":", "/").split("/")[-2:]
            )
        else:
            org, repo = project.split("/")
            url = f"https://github.com/{org}/{repo}.git"
        path = Deploy.PKG_CACHE_PATH / org / repo
        LOG.info(f"fetching git repo {url}")
        self._git_clone(url, path)
        self._recurse_submodules(path, url)
    _extra_tags = [(Tag({"Key": "taskcat-installer", "Value": name}))]
    Test.run(
        regions=regions,
        no_delete=True,
        project_root=path,
        test_names=test_names,
        input_file=input_file,
        _extra_tags=_extra_tags,
    )