updateGeneratedTemplate
inline suspend fun CloudFormationClient.updateGeneratedTemplate(crossinline block: UpdateGeneratedTemplateRequest.Builder.() -> Unit): UpdateGeneratedTemplateResponse
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.
Samples
// This example adds resources to a generated template
val resp = cloudFormationClient.updateGeneratedTemplate {
generatedTemplateName = "JazzyTemplate"
addResources = listOf<ResourceDefinition>(
ResourceDefinition {
resourceType = "AWS::S3::Bucket"
resourceIdentifier = mapOf<String, String>(
"BucketName" to "jazz-bucket"
)
},
ResourceDefinition {
resourceType = "AWS::EC2::DHCPOptions"
resourceIdentifier = mapOf<String, String>(
"DhcpOptionsId" to "random-id123"
)
}
)
}Content copied to clipboard
// This example updates a generated template with a new name.
val resp = cloudFormationClient.updateGeneratedTemplate {
generatedTemplateName = "JazzyTemplate"
newGeneratedTemplateName = "JazzierTemplate"
}Content copied to clipboard
// This example removes resources from a generated template
val resp = cloudFormationClient.updateGeneratedTemplate {
generatedTemplateName = "JazzyTemplate"
removeResources = listOf<String>(
"LogicalResourceId1",
"LogicalResourceId2"
)
}Content copied to clipboard