validateTemplate method

Future<ValidateTemplateOutput> validateTemplate({
  1. String? templateBody,
  2. String? templateURL,
})

Validates a specified template. CloudFormation first checks if the template is valid JSON. If it isn't, CloudFormation checks if the template is valid YAML. If both these checks fail, CloudFormation returns a template validation error.

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 TemplateURL or TemplateBody. 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 (max size: 1 MB) that is 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.

Implementation

Future<ValidateTemplateOutput> validateTemplate({
  String? templateBody,
  String? templateURL,
}) async {
  final $request = <String, String>{
    if (templateBody != null) 'TemplateBody': templateBody,
    if (templateURL != null) 'TemplateURL': templateURL,
  };
  final $result = await _protocol.send(
    $request,
    action: 'ValidateTemplate',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'ValidateTemplateResult',
  );
  return ValidateTemplateOutput.fromXml($result);
}