getTemplateSummary method

Future<GetTemplateSummaryOutput> getTemplateSummary({
  1. CallAs? callAs,
  2. String? stackName,
  3. String? stackSetName,
  4. String? templateBody,
  5. TemplateSummaryConfig? templateSummaryConfig,
  6. String? templateURL,
})

Returns information about a new or existing template. The GetTemplateSummary action is useful for viewing parameter information, such as default parameter values and parameter types, before you create or update a stack or StackSet.

You can use the GetTemplateSummary action when you submit a template, or you can get template information for a StackSet, or a running or deleted stack.

For deleted stacks, GetTemplateSummary returns the template information for up to 90 days after the stack has been deleted. If the template doesn't exist, a ValidationError is returned.

May throw StackSetNotFoundException.

Parameter callAs : [Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.

By default, SELF is specified. Use SELF for StackSets with self-managed permissions.

  • If you are signed in to the management account, specify SELF.
  • If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN.

    Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide.

Parameter stackName : The name or the stack ID that's associated with the stack, which aren't always interchangeable. For running stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the unique stack ID.

Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

Parameter stackSetName : The name or unique ID of the StackSet from which the stack was created.

Conditional: You must specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

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 specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

Parameter templateSummaryConfig : Specifies options for the GetTemplateSummary API action.

Parameter templateURL : The URL of a file that contains the template body. The URL must point to a template (max size: 1 MB) 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 specify only one of the following parameters: StackName, StackSetName, TemplateBody, or TemplateURL.

Implementation

Future<GetTemplateSummaryOutput> getTemplateSummary({
  CallAs? callAs,
  String? stackName,
  String? stackSetName,
  String? templateBody,
  TemplateSummaryConfig? templateSummaryConfig,
  String? templateURL,
}) async {
  final $request = <String, String>{
    if (callAs != null) 'CallAs': callAs.value,
    if (stackName != null) 'StackName': stackName,
    if (stackSetName != null) 'StackSetName': stackSetName,
    if (templateBody != null) 'TemplateBody': templateBody,
    if (templateSummaryConfig != null)
      for (var e1 in templateSummaryConfig.toQueryMap().entries)
        'TemplateSummaryConfig.${e1.key}': e1.value,
    if (templateURL != null) 'TemplateURL': templateURL,
  };
  final $result = await _protocol.send(
    $request,
    action: 'GetTemplateSummary',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'GetTemplateSummaryResult',
  );
  return GetTemplateSummaryOutput.fromXml($result);
}