update_generated_template
¶
update_generated_template(
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
generated_template_name: Optional[GeneratedTemplateName] = None,
new_generated_template_name: Optional[GeneratedTemplateName] = None,
add_resources: Optional[ResourceDefinitions] = None,
remove_resources: Optional[JazzLogicalResourceIds] = None,
refresh_all_resources: Optional[RefreshAllResources] = None,
template_configuration: Optional[TemplateConfiguration] = None,
) -> UpdateGeneratedTemplateOutput
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.
Parameters:
-
generated_template_name(Optional[GeneratedTemplateName], default:None) –The name or Amazon Resource Name (ARN) of a generated template.
-
new_generated_template_name(Optional[GeneratedTemplateName], default:None) –An optional new name to assign to the generated template.
-
add_resources(Optional[ResourceDefinitions], default:None) –An optional list of resources to be added to the generated template.
-
remove_resources(Optional[JazzLogicalResourceIds], default:None) –A list of logical ids for resources to remove from the generated template.
-
refresh_all_resources(Optional[RefreshAllResources], default:None) –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. -
template_configuration(Optional[TemplateConfiguration], default:None) –The configuration details of the generated template, including the
DeletionPolicyandUpdateReplacePolicy.
Raises:
-
AlreadyExistsException–The resource with the name requested already exists.
-
GeneratedTemplateNotFoundException–The generated template was not found.
-
LimitExceededException–The quota for the resource has already been reached.
For information about resource and stack limitations, see CloudFormation quotas in the CloudFormation User Guide.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To add resources to a generated template This example adds resources to a generated template
>>> client.update_generated_template(generated_template_name='JazzyTemplate', add_resources=[{'ResourceType': 'AWS::S3::Bucket', 'ResourceIdentifier': {'BucketName': 'jazz-bucket'}}, {'ResourceType': 'AWS::EC2::DHCPOptions', 'ResourceIdentifier': {'DhcpOptionsId': 'random-id123'}}])
To update a generated template's name
This example updates a generated template with a new name.
>>> client.update_generated_template(generated_template_name='JazzyTemplate', new_generated_template_name='JazzierTemplate')
To remove resources from a generated template
This example removes resources from a generated template
>>> client.update_generated_template(generated_template_name='JazzyTemplate', remove_resources=['LogicalResourceId1', 'LogicalResourceId2'])
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 | |