EstimateTemplateCostCommand

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.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CloudFormationClient, EstimateTemplateCostCommand } from "@aws-sdk/client-cloudformation"; // ES Modules import
// const { CloudFormationClient, EstimateTemplateCostCommand } = require("@aws-sdk/client-cloudformation"); // CommonJS import
const client = new CloudFormationClient(config);
const input = { // EstimateTemplateCostInput
  TemplateBody: "STRING_VALUE",
  TemplateURL: "STRING_VALUE",
  Parameters: [ // Parameters
    { // Parameter
      ParameterKey: "STRING_VALUE",
      ParameterValue: "STRING_VALUE",
      UsePreviousValue: true || false,
      ResolvedValue: "STRING_VALUE",
    },
  ],
};
const command = new EstimateTemplateCostCommand(input);
const response = await client.send(command);
// { // EstimateTemplateCostOutput
//   Url: "STRING_VALUE",
// };

EstimateTemplateCostCommand Input

Parameter
Type
Description
Parameters
Parameter[] | undefined

A list of Parameter structures that specify input parameters.

TemplateBody
string | undefined

Structure containing 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.

TemplateURL
string | undefined

The URL of a file containing 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://.

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

EstimateTemplateCostCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Url
string | undefined

An Amazon Web Services Simple Monthly Calculator URL with a query string that describes the resources required to run the template.

Throws

Name
Fault
Details
CloudFormationServiceException
Base exception class for all service exceptions from CloudFormation service.