CloudFormation / Client / update_generated_template
update_generated_template#
- CloudFormation.Client.update_generated_template(**kwargs)#
- Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the - DeletionPolicyand- UpdateReplacePolicysettings. You can check the status of the update to the generated template using the- DescribeGeneratedTemplateAPI action.- See also: AWS API Documentation - Request Syntax- response = client.update_generated_template( GeneratedTemplateName='string', NewGeneratedTemplateName='string', AddResources=[ { 'ResourceType': 'string', 'LogicalResourceId': 'string', 'ResourceIdentifier': { 'string': 'string' } }, ], RemoveResources=[ 'string', ], RefreshAllResources=True|False, TemplateConfiguration={ 'DeletionPolicy': 'DELETE'|'RETAIN', 'UpdateReplacePolicy': 'DELETE'|'RETAIN' } ) - Parameters:
- GeneratedTemplateName (string) – - [REQUIRED] - The name or Amazon Resource Name (ARN) of a generated template. 
- NewGeneratedTemplateName (string) – An optional new name to assign to the generated template. 
- AddResources (list) – - An optional list of resources to be added to the generated template. - (dict) – - A resource included in a generated template. This data type is used with the - CreateGeneratedTemplateand- UpdateGeneratedTemplateAPI actions.- ResourceType (string) – [REQUIRED] - The type of the resource, such as - AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide
- LogicalResourceId (string) – - The logical resource id for this resource in the generated template. 
- ResourceIdentifier (dict) – [REQUIRED] - A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the - primaryIdentifierlist in the resource schema.) The value is the value of that primary identifier. For example, for a- AWS::DynamoDB::Tableresource, the primary identifiers is- TableNameso the key-value pair could be- "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.- (string) – - (string) – 
 
 
 
 
- RemoveResources (list) – - A list of logical ids for resources to remove from the generated template. - (string) – 
 
- RefreshAllResources (boolean) – 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.
- TemplateConfiguration (dict) – - The configuration details of the generated template, including the - DeletionPolicyand- UpdateReplacePolicy.- DeletionPolicy (string) – - The - DeletionPolicyassigned to resources in the generated template. Supported values are:- DELETE- delete all resources when the stack is deleted.
- RETAIN- retain all resources when the stack is deleted.
 - For more information, see DeletionPolicy attribute in the CloudFormation User Guide. 
- UpdateReplacePolicy (string) – - The - UpdateReplacePolicyassigned to resources in the generated template. Supported values are:- DELETE- delete all resources when the resource is replaced during an update operation.
- RETAIN- retain all resources when the resource is replaced during an update operation.
 - For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide. 
 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'GeneratedTemplateId': 'string' } - Response Structure- (dict) – - GeneratedTemplateId (string) – - The Amazon Resource Name (ARN) of the generated template. The format is - arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, ``arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc ``.
 
 
 - Exceptions- CloudFormation.Client.exceptions.AlreadyExistsException
- CloudFormation.Client.exceptions.GeneratedTemplateNotFoundException
- CloudFormation.Client.exceptions.LimitExceededException