Skip to content

estimate_template_cost async

estimate_template_cost(
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    template_body: Optional[TemplateBody] = None,
    template_url: Optional[TemplateURL] = None,
    parameters: Optional[Parameters] = None,
) -> EstimateTemplateCostOutput

Returns the estimated monthly cost of a template. The return value is an Amazon Web Services Simple Monthly Calculator URL with a query string that describes the resources required to run the template.

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 pass TemplateBody or TemplateURL. If both are passed, only TemplateBody is used.

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

    The URL of a file that contains the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. The location for an Amazon S3 bucket must start with https://. URLs from S3 static websites are not supported.

    Conditional: You must pass TemplateURL or TemplateBody. If both are passed, only TemplateBody is used.

  • parameters (Optional[Parameters], default: None ) –

    A list of Parameter structures that specify input parameters.

Raises:

Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
async def estimate_template_cost(
    self,
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    template_body: Optional[
        "capo_cloudformation.types.template_body.TemplateBody"
    ] = None,
    template_url: Optional[
        "capo_cloudformation.types.template_url.TemplateURL"
    ] = None,
    parameters: Optional["capo_cloudformation.types.parameters.Parameters"] = None,
) -> "capo_cloudformation.types.estimate_template_cost_output.EstimateTemplateCostOutput":
    """<p>Returns the estimated monthly cost of a template. The return value is an Amazon Web Services Simple Monthly Calculator URL with a query string that describes the resources required to run the template.</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 pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
        template_url: <p>The URL of a file that contains the template body. The URL must point to a template 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>. URLs from S3 static websites are not supported.</p> <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
        parameters: <p>A list of <code>Parameter</code> structures that specify input parameters.</p>

    Raises:
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudformation.types.estimate_template_cost_input.EstimateTemplateCostInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudformation.types.estimate_template_cost_output.EstimateTemplateCostOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.estimate_template_cost

        (
            output,
            http_response,
        ) = await capo_cloudformation._operations.cloud_formation.estimate_template_cost.async_estimate_template_cost(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EstimateTemplateCost")
    )
    input_: capo_cloudformation.types.estimate_template_cost_input.EstimateTemplateCostInput = {}
    if template_body is not None:
        input_["template_body"] = template_body
    if template_url is not None:
        input_["template_url"] = template_url
    if parameters is not None:
        input_["parameters"] = parameters

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output