createGeneratedTemplate
abstract suspend fun createGeneratedTemplate(input: CreateGeneratedTemplateRequest): CreateGeneratedTemplateResponse
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.
Samples
import aws.sdk.kotlin.services.cloudformation.model.ResourceDefinition
fun main() {
//sampleStart
// This example creates a generated template with a resources file.
val resp = cloudFormationClient.createGeneratedTemplate {
resources = 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"
)
}
)
generatedTemplateName = "JazzyTemplate"
}
//sampleEnd
}