updateGeneratedTemplate method

Future<UpdateGeneratedTemplateOutput> updateGeneratedTemplate({
  1. required String generatedTemplateName,
  2. List<ResourceDefinition>? addResources,
  3. String? newGeneratedTemplateName,
  4. bool? refreshAllResources,
  5. List<String>? removeResources,
  6. TemplateConfiguration? templateConfiguration,
})

Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of the update to the generated template using the DescribeGeneratedTemplate API action.

May throw AlreadyExistsException. May throw GeneratedTemplateNotFoundException. May throw LimitExceededException.

Parameter generatedTemplateName : The name or Amazon Resource Name (ARN) of a generated template.

Parameter addResources : An optional list of resources to be added to the generated template.

Parameter newGeneratedTemplateName : An optional new name to assign to the generated template.

Parameter refreshAllResources : If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

Parameter removeResources : A list of logical ids for resources to remove from the generated template.

Parameter templateConfiguration : The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

Implementation

Future<UpdateGeneratedTemplateOutput> updateGeneratedTemplate({
  required String generatedTemplateName,
  List<ResourceDefinition>? addResources,
  String? newGeneratedTemplateName,
  bool? refreshAllResources,
  List<String>? removeResources,
  TemplateConfiguration? templateConfiguration,
}) async {
  final $request = <String, String>{
    'GeneratedTemplateName': generatedTemplateName,
    if (addResources != null)
      if (addResources.isEmpty)
        'AddResources': ''
      else
        for (var i1 = 0; i1 < addResources.length; i1++)
          for (var e3 in addResources[i1].toQueryMap().entries)
            'AddResources.member.${i1 + 1}.${e3.key}': e3.value,
    if (newGeneratedTemplateName != null)
      'NewGeneratedTemplateName': newGeneratedTemplateName,
    if (refreshAllResources != null)
      'RefreshAllResources': refreshAllResources.toString(),
    if (removeResources != null)
      if (removeResources.isEmpty)
        'RemoveResources': ''
      else
        for (var i1 = 0; i1 < removeResources.length; i1++)
          'RemoveResources.member.${i1 + 1}': removeResources[i1],
    if (templateConfiguration != null)
      for (var e1 in templateConfiguration.toQueryMap().entries)
        'TemplateConfiguration.${e1.key}': e1.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'UpdateGeneratedTemplate',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'UpdateGeneratedTemplateResult',
  );
  return UpdateGeneratedTemplateOutput.fromXml($result);
}