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/cloud_formation.py
| def estimate_template_cost(
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,
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.
"""
def _handler(
req: "OperationRequest[capo_cloudformation.types.estimate_template_cost_input.EstimateTemplateCostInput]",
) -> OperationResponse[
"capo_cloudformation.types.estimate_template_cost_output.EstimateTemplateCostOutput"
]:
import capo_cloudformation._operations.cloud_formation.estimate_template_cost
output, http_response = (
capo_cloudformation._operations.cloud_formation.estimate_template_cost.estimate_template_cost(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|