:py:mod:`aws_codeseeder.services.cfn` ===================================== .. py:module:: aws_codeseeder.services.cfn Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: aws_codeseeder.services.cfn.deploy_template aws_codeseeder.services.cfn.destroy_stack aws_codeseeder.services.cfn.does_stack_exist aws_codeseeder.services.cfn.get_stack_name aws_codeseeder.services.cfn.get_stack_status Attributes ~~~~~~~~~~ .. autoapisummary:: aws_codeseeder.services.cfn.CHANGESET_PREFIX .. py:function:: deploy_template(stack_name: str, filename: str, seedkit_tag: Optional[str] = None, s3_bucket: Optional[str] = None, parameters: Optional[Dict[str, str]] = None, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) -> None Deploy a local CloudFormation Template The function will automatically calculate a ChangeSet if the Stack already exists and update accordingly. If the local template file is too large, it will be uploaded to the optional ``s3_buckeet`` and deployed from there. :param stack_name: Name of the CloudFormation Stack to deploy :type stack_name: str :param filename: Name of the local CloudFormation template file :type filename: str :param seedkit_tag: Name of the Seedkit to Tag resources in the Stack with, by default None :type seedkit_tag: Optional[str], optional :param s3_bucket: S3 Bucket to upload the template file to if it is too large (> 51200), by default None :type s3_bucket: Optional[str], optional :param parameters: Key/Value set of Input Parameters to pass to the CloudFormation stack, by default None :type parameters: Optional[Dict[str, str]], optional :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional :raises FileNotFoundError: If the local template file is not found :raises ValueError: If the S3 Bucket is not found .. py:function:: destroy_stack(stack_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) -> None Destroy the CloudFormation Stack :param stack_name: Name of the CloudFormation Stack to destroy :type stack_name: str :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional .. py:function:: does_stack_exist(stack_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) -> Tuple[bool, Dict[str, str]] Checks for existence of a CloudFormation Stack while also returning Stack Outputs if it does exist :param stack_name: Name of the CloudFormation Stack to query :type stack_name: str :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional :returns: Tuple2 with a boolean indicating Stack existence and a dict of any Stack Outputs :rtype: Tuple[bool, Dict[str, str]] .. py:function:: get_stack_name(seedkit_name: str) -> str Helper function to calculate the name of a CloudFormation Stack for a given Seedkit :param seedkit_name: Name of the Seedkit :type seedkit_name: str :returns: Name of the Stack Name associated with the Seedkit :rtype: str .. py:function:: get_stack_status(stack_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) -> str Retrieve the status of a CloudFormation Stack :param stack_name: Name of the CloudFormation Stack to query :type stack_name: str :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional :returns: The status of the CloudFormation Stack, see official ``boto3`` documentation for potential status values: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation.html#CloudFormation.Client.describe_stacks :rtype: str :raises ValueError: If the Stack is not found .. py:data:: CHANGESET_PREFIX :value: 'aws-codeseeder-'