create_generated_template
¶
create_generated_template(
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
resources: Optional[ResourceDefinitions] = None,
generated_template_name: Optional[GeneratedTemplateName] = None,
stack_name: Optional[StackName] = None,
template_configuration: Optional[TemplateConfiguration] = None,
) -> CreateGeneratedTemplateOutput
Creates a template from existing resources that are not already managed with CloudFormation. You can check the status of the template generation using the DescribeGeneratedTemplate API action.
Parameters:
-
resources(Optional[ResourceDefinitions], default:None) –An optional list of resources to be included in the generated template.
If no resources are specified,the template will be created without any resources. Resources can be added to the template using the
UpdateGeneratedTemplateAPI action. -
generated_template_name(Optional[GeneratedTemplateName], default:None) –The name assigned to the generated template.
-
stack_name(Optional[StackName], default:None) –An optional name or ARN of a stack to use as the base stack for the generated 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.
-
ConcurrentResourcesLimitExceededException–No more than 5 generated templates can be in an
InProgressorPendingstatus at one time. This error is also returned if a generated template that is in anInProgressorPendingstatus is attempted to be updated or deleted. -
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 create a generated template This example creates a generated template with a resources file.
>>> client.create_generated_template(resources=[{'ResourceType': 'AWS::S3::Bucket', 'ResourceIdentifier': {'BucketName': 'jazz-bucket'}}, {'ResourceType': 'AWS::EC2::DHCPOptions', 'ResourceIdentifier': {'DhcpOptionsId': 'random-id123'}}], generated_template_name='JazzyTemplate')
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | |