update_generated_template
async
¶
update_generated_template(
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = 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
>>> await 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.
>>> await 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
>>> await client.update_generated_template(generated_template_name='JazzyTemplate', remove_resources=['LogicalResourceId1', 'LogicalResourceId2'])
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 | |