AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to GetLaunchTemplateDataAsync.

Namespace: Amazon.EC2
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public virtual GetLaunchTemplateDataResponse GetLaunchTemplateData(
         GetLaunchTemplateDataRequest request
)

Parameters

request
Type: Amazon.EC2.Model.GetLaunchTemplateDataRequest

Container for the necessary parameters to execute the GetLaunchTemplateData service method.

Return Value


The response from the GetLaunchTemplateData service method, as returned by EC2.

Examples

This example gets the launch template data for the specified instance.

To get the launch template data for an instance


var client = new AmazonEC2Client();
var response = client.GetLaunchTemplateData(new GetLaunchTemplateDataRequest 
{
    InstanceId = "0123d646e8048babc"
});

ResponseLaunchTemplateData launchTemplateData = response.LaunchTemplateData;

            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also