getLaunchTemplateData
inline suspend fun Ec2Client.getLaunchTemplateData(crossinline block: GetLaunchTemplateDataRequest.Builder.() -> Unit): GetLaunchTemplateDataResponse
Retrieves the configuration data of the specified instance. You can use this data to create a launch template.
This action calls on other describe actions to get instance information. Depending on your instance configuration, you may need to allow the following actions in your IAM policy: DescribeSpotInstanceRequests
, DescribeInstanceCreditSpecifications
, DescribeVolumes
, and DescribeInstanceAttribute
. Or, you can allow describe*
depending on your instance requirements.
Samples
fun main() {
//sampleStart
// This example gets the launch template data for the specified instance.
val resp = ec2Client.getLaunchTemplateData {
instanceId = "0123d646e8048babc"
}
//sampleEnd
}