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
6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 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 | |