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 Amazon Web Services 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 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.

Parameter templateURL : 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.

Implementation

Future<EstimateTemplateCostOutput> estimateTemplateCost({
  List<Parameter>? parameters,
  String? templateBody,
  String? templateURL,
}) async {
  final $request = <String, String>{
    if (parameters != null)
      if (parameters.isEmpty)
        'Parameters': ''
      else
        for (var i1 = 0; i1 < parameters.length; i1++)
          for (var e3 in parameters[i1].toQueryMap().entries)
            'Parameters.member.${i1 + 1}.${e3.key}': e3.value,
    if (templateBody != null) 'TemplateBody': templateBody,
    if (templateURL != null) 'TemplateURL': templateURL,
  };
  final $result = await _protocol.send(
    $request,
    action: 'EstimateTemplateCost',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'EstimateTemplateCostResult',
  );
  return EstimateTemplateCostOutput.fromXml($result);
}