Skip to content

get_template_summary

get_template_summary(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    template_body: Optional[TemplateBody] = None,
    template_url: Optional[TemplateURL] = None,
    stack_name: Optional[StackNameOrId] = None,
    stack_set_name: Optional[StackSetNameOrId] = None,
    call_as: Optional[CallAs] = None,
    template_summary_config: Optional[TemplateSummaryConfig] = None,
) -> GetTemplateSummaryOutput

Returns information about a new or existing template. The GetTemplateSummary action is useful for viewing parameter information, such as default parameter values and parameter types, before you create or update a stack or StackSet.

You can use the GetTemplateSummary action when you submit a template, or you can get template information for a StackSet, or a running or deleted stack.

For deleted stacks, GetTemplateSummary returns the template information for up to 90 days after the stack has been deleted. If the template doesn't exist, a ValidationError is returned.

Parameters:

  • template_body (Optional[TemplateBody], default: None ) –

    Structure that contains the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.

    Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

  • template_url (Optional[TemplateURL], default: None ) –

    The URL of a file that contains the template body. The URL must point to a template (max size: 1 MB) that's located in an Amazon S3 bucket or a Systems Manager document. The location for an Amazon S3 bucket must start with https://.

    Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

  • stack_name (Optional[StackNameOrId], default: None ) –

    The name or the stack ID that's associated with the stack, which aren't always interchangeable. For running stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the unique stack ID.

    Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

  • stack_set_name (Optional[StackSetNameOrId], default: None ) –

    The name or unique ID of the StackSet from which the stack was created.

    Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

  • call_as (Optional[CallAs], default: None ) –

    [Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.

    By default, SELF is specified. Use SELF for StackSets with self-managed permissions.

    • If you are signed in to the management account, specify SELF.

    • If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN.

      Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide.

  • template_summary_config (Optional[TemplateSummaryConfig], default: None ) –

    Specifies options for the GetTemplateSummary API action.

Raises:

Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def get_template_summary(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    template_body: Optional[
        "capo_cloudformation.types.template_body.TemplateBody"
    ] = None,
    template_url: Optional[
        "capo_cloudformation.types.template_url.TemplateURL"
    ] = None,
    stack_name: Optional[
        "capo_cloudformation.types.stack_name_or_id.StackNameOrId"
    ] = None,
    stack_set_name: Optional[
        "capo_cloudformation.types.stack_set_name_or_id.StackSetNameOrId"
    ] = None,
    call_as: Optional["capo_cloudformation.types.call_as.CallAs"] = None,
    template_summary_config: Optional[
        "capo_cloudformation.types.template_summary_config.TemplateSummaryConfig"
    ] = None,
) -> (
    "capo_cloudformation.types.get_template_summary_output.GetTemplateSummaryOutput"
):
    """<p>Returns information about a new or existing template. The <code>GetTemplateSummary</code> action is useful for viewing parameter information, such as default parameter values and parameter types, before you create or update a stack or StackSet.</p> <p>You can use the <code>GetTemplateSummary</code> action when you submit a template, or you can get template information for a StackSet, or a running or deleted stack.</p> <p>For deleted stacks, <code>GetTemplateSummary</code> returns the template information for up to 90 days after the stack has been deleted. If the template doesn't exist, a <code>ValidationError</code> is returned.</p>

    Args:
        template_body: <p>Structure that contains the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.</p> <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>, <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
        template_url: <p>The URL of a file that contains the template body. The URL must point to a template (max size: 1 MB) that's located in an Amazon S3 bucket or a Systems Manager document. The location for an Amazon S3 bucket must start with <code>https://</code>.</p> <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>, <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
        stack_name: <p>The name or the stack ID that's associated with the stack, which aren't always interchangeable. For running stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the unique stack ID.</p> <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>, <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
        stack_set_name: <p>The name or unique ID of the StackSet from which the stack was created.</p> <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>, <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
        call_as: <p>[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p> <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for StackSets with self-managed permissions.</p> <ul> <li> <p>If you are signed in to the management account, specify <code>SELF</code>.</p> </li> <li> <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p> <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p> </li> </ul>
        template_summary_config: <p>Specifies options for the <code>GetTemplateSummary</code> API action.</p>

    Raises:
        capo_cloudformation.errors.stack_set_not_found_exception.StackSetNotFoundException: <p>The specified StackSet doesn't exist.</p>
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudformation.types.get_template_summary_input.GetTemplateSummaryInput]",
    ) -> OperationResponse[
        "capo_cloudformation.types.get_template_summary_output.GetTemplateSummaryOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.get_template_summary

        output, http_response = (
            capo_cloudformation._operations.cloud_formation.get_template_summary.get_template_summary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTemplateSummary")
    )
    input_: capo_cloudformation.types.get_template_summary_input.GetTemplateSummaryInput = {}
    if template_body is not None:
        input_["template_body"] = template_body
    if template_url is not None:
        input_["template_url"] = template_url
    if stack_name is not None:
        input_["stack_name"] = stack_name
    if stack_set_name is not None:
        input_["stack_set_name"] = stack_set_name
    if call_as is not None:
        input_["call_as"] = call_as
    if template_summary_config is not None:
        input_["template_summary_config"] = template_summary_config

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output