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.
This is the response object from the CreateLaunchTemplate operation.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class CreateLaunchTemplateResponse : AmazonWebServiceResponse
The CreateLaunchTemplateResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
CreateLaunchTemplateResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
LaunchTemplate | Amazon.EC2.Model.LaunchTemplate |
Gets and sets the property LaunchTemplate. Information about the launch template. |
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
Warning | Amazon.EC2.Model.ValidationWarning |
Gets and sets the property Warning. If the launch template contains parameters or parameter combinations that are not valid, an error code and an error message are returned for each issue that's found. |
This example creates a launch template that specifies the subnet in which to launch the instance, assigns a public IP address and an IPv6 address to the instance, and creates a tag for the instance.
var client = new AmazonEC2Client(); var response = client.CreateLaunchTemplate(new CreateLaunchTemplateRequest { LaunchTemplateData = new RequestLaunchTemplateData { ImageId = "ami-8c1be5f6", InstanceType = "t2.small", NetworkInterfaces = new List<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> { new LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { AssociatePublicIpAddress = true, DeviceIndex = 0, Ipv6AddressCount = 1, SubnetId = "subnet-7b16de0c" } }, TagSpecifications = new List<LaunchTemplateTagSpecificationRequest> { new LaunchTemplateTagSpecificationRequest { ResourceType = "instance", Tags = new List<Tag> { new Tag { Key = "Name", Value = "webserver" } } } } }, LaunchTemplateName = "my-template", VersionDescription = "WebVersion1" }); LaunchTemplate launchTemplate = response.LaunchTemplate;
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5