estimateTemplateCost method

Future<EstimateTemplateCostOutput> estimateTemplateCost({
  1. List<Parameter>? parameters,
  2. String? templateBody,
  3. String? templateURL,
})

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

Parameter parameters : A list of Parameter structures that specify input parameters.

Parameter templateBody : Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to Template Anatomy in the AWS CloudFormation User Guide.)

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

Parameter templateURL : Location of file containing the template body. The URL must point to a template that is located in an Amazon S3 bucket. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

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

Implementation

Future<EstimateTemplateCostOutput> estimateTemplateCost({
  List<Parameter>? parameters,
  String? templateBody,
  String? templateURL,
}) async {
  _s.validateStringLength(
    'templateBody',
    templateBody,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'templateURL',
    templateURL,
    1,
    1024,
  );
  final $request = <String, dynamic>{};
  parameters?.also((arg) => $request['Parameters'] = arg);
  templateBody?.also((arg) => $request['TemplateBody'] = arg);
  templateURL?.also((arg) => $request['TemplateURL'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'EstimateTemplateCost',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['EstimateTemplateCostInput'],
    shapes: shapes,
    resultWrapper: 'EstimateTemplateCostResult',
  );
  return EstimateTemplateCostOutput.fromXml($result);
}