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
6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 | |