Show / Hide Table of Contents

Class CfnInstanceProps

Properties for defining a CfnInstance.

Inheritance
object
CfnInstanceProps
Implements
ICfnInstanceProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnInstanceProps : ICfnInstanceProps
Syntax (vb)
Public Class CfnInstanceProps Implements ICfnInstanceProps
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.EC2;

             var cfnInstanceProps = new CfnInstanceProps {
                 AdditionalInfo = "additionalInfo",
                 Affinity = "affinity",
                 AvailabilityZone = "availabilityZone",
                 BlockDeviceMappings = new [] { new BlockDeviceMappingProperty {
                     DeviceName = "deviceName",

                     // the properties below are optional
                     Ebs = new EbsProperty {
                         DeleteOnTermination = false,
                         Encrypted = false,
                         Iops = 123,
                         KmsKeyId = "kmsKeyId",
                         SnapshotId = "snapshotId",
                         VolumeSize = 123,
                         VolumeType = "volumeType"
                     },
                     NoDevice = new NoDeviceProperty { },
                     VirtualName = "virtualName"
                 } },
                 CpuOptions = new CpuOptionsProperty {
                     CoreCount = 123,
                     ThreadsPerCore = 123
                 },
                 CreditSpecification = new CreditSpecificationProperty {
                     CpuCredits = "cpuCredits"
                 },
                 DisableApiTermination = false,
                 EbsOptimized = false,
                 ElasticGpuSpecifications = new [] { new ElasticGpuSpecificationProperty {
                     Type = "type"
                 } },
                 ElasticInferenceAccelerators = new [] { new ElasticInferenceAcceleratorProperty {
                     Type = "type",

                     // the properties below are optional
                     Count = 123
                 } },
                 EnclaveOptions = new EnclaveOptionsProperty {
                     Enabled = false
                 },
                 HibernationOptions = new HibernationOptionsProperty {
                     Configured = false
                 },
                 HostId = "hostId",
                 HostResourceGroupArn = "hostResourceGroupArn",
                 IamInstanceProfile = "iamInstanceProfile",
                 ImageId = "imageId",
                 InstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior",
                 InstanceType = "instanceType",
                 Ipv6AddressCount = 123,
                 Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
                     Ipv6Address = "ipv6Address"
                 } },
                 KernelId = "kernelId",
                 KeyName = "keyName",
                 LaunchTemplate = new LaunchTemplateSpecificationProperty {
                     Version = "version",

                     // the properties below are optional
                     LaunchTemplateId = "launchTemplateId",
                     LaunchTemplateName = "launchTemplateName"
                 },
                 LicenseSpecifications = new [] { new LicenseSpecificationProperty {
                     LicenseConfigurationArn = "licenseConfigurationArn"
                 } },
                 MetadataOptions = new MetadataOptionsProperty {
                     HttpEndpoint = "httpEndpoint",
                     HttpProtocolIpv6 = "httpProtocolIpv6",
                     HttpPutResponseHopLimit = 123,
                     HttpTokens = "httpTokens",
                     InstanceMetadataTags = "instanceMetadataTags"
                 },
                 Monitoring = false,
                 NetworkInterfaces = new [] { new NetworkInterfaceProperty {
                     DeviceIndex = "deviceIndex",

                     // the properties below are optional
                     AssociateCarrierIpAddress = false,
                     AssociatePublicIpAddress = false,
                     DeleteOnTermination = false,
                     Description = "description",
                     EnaSrdSpecification = new EnaSrdSpecificationProperty {
                         EnaSrdEnabled = false,
                         EnaSrdUdpSpecification = new EnaSrdUdpSpecificationProperty {
                             EnaSrdUdpEnabled = false
                         }
                     },
                     GroupSet = new [] { "groupSet" },
                     Ipv6AddressCount = 123,
                     Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
                         Ipv6Address = "ipv6Address"
                     } },
                     NetworkInterfaceId = "networkInterfaceId",
                     PrivateIpAddress = "privateIpAddress",
                     PrivateIpAddresses = new [] { new PrivateIpAddressSpecificationProperty {
                         Primary = false,
                         PrivateIpAddress = "privateIpAddress"
                     } },
                     SecondaryPrivateIpAddressCount = 123,
                     SubnetId = "subnetId"
                 } },
                 PlacementGroupName = "placementGroupName",
                 PrivateDnsNameOptions = new PrivateDnsNameOptionsProperty {
                     EnableResourceNameDnsAaaaRecord = false,
                     EnableResourceNameDnsARecord = false,
                     HostnameType = "hostnameType"
                 },
                 PrivateIpAddress = "privateIpAddress",
                 PropagateTagsToVolumeOnCreation = false,
                 RamdiskId = "ramdiskId",
                 SecurityGroupIds = new [] { "securityGroupIds" },
                 SecurityGroups = new [] { "securityGroups" },
                 SourceDestCheck = false,
                 SsmAssociations = new [] { new SsmAssociationProperty {
                     DocumentName = "documentName",

                     // the properties below are optional
                     AssociationParameters = new [] { new AssociationParameterProperty {
                         Key = "key",
                         Value = new [] { "value" }
                     } }
                 } },
                 SubnetId = "subnetId",
                 Tags = new [] { new CfnTag {
                     Key = "key",
                     Value = "value"
                 } },
                 Tenancy = "tenancy",
                 UserData = "userData",
                 Volumes = new [] { new VolumeProperty {
                     Device = "device",
                     VolumeId = "volumeId"
                 } }
             };

Synopsis

Constructors

CfnInstanceProps()

Properties for defining a CfnInstance.

Properties

AdditionalInfo

This property is reserved for internal use.

Affinity

Indicates whether the instance is associated with a dedicated host.

AvailabilityZone

The Availability Zone of the instance.

BlockDeviceMappings

The block device mapping entries that defines the block devices to attach to the instance at launch.

CpuOptions

The CPU options for the instance.

CreditSpecification

The credit option for CPU usage of the burstable performance instance.

DisableApiTermination

Indicates whether termination protection is enabled for the instance.

EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O.

ElasticGpuSpecifications

An elastic GPU to associate with the instance.

ElasticInferenceAccelerators

An elastic inference accelerator to associate with the instance.

EnclaveOptions

Indicates whether the instance is enabled for AWS Nitro Enclaves.

HibernationOptions

Indicates whether an instance is enabled for hibernation.

HostId

If you specify host for the Affinity property, the ID of a dedicated host that the instance is associated with.

HostResourceGroupArn

The ARN of the host resource group in which to launch the instances.

IamInstanceProfile

The name of an IAM instance profile.

ImageId

The ID of the AMI.

InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

InstanceType

The instance type. For more information, see Instance types in the Amazon EC2 User Guide .

Ipv6AddressCount

The number of IPv6 addresses to associate with the primary network interface.

Ipv6Addresses

The IPv6 addresses from the range of the subnet to associate with the primary network interface.

KernelId

The ID of the kernel.

KeyName

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

LaunchTemplate

The launch template.

LicenseSpecifications

The license configurations.

MetadataOptions

The metadata options for the instance.

Monitoring

Specifies whether detailed monitoring is enabled for the instance.

NetworkInterfaces

The network interfaces to associate with the instance.

PlacementGroupName

The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).

PrivateDnsNameOptions

The options for the instance hostname.

PrivateIpAddress

The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.

PropagateTagsToVolumeOnCreation

Indicates whether to assign the tags specified in the Tags property to the volumes specified in the BlockDeviceMappings property.

RamdiskId

The ID of the RAM disk to select.

SecurityGroupIds

The IDs of the security groups.

SecurityGroups

[Default VPC] The names of the security groups. For a nondefault VPC, you must use security group IDs instead.

SourceDestCheck

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.

SsmAssociations

The SSM document and parameter values in AWS Systems Manager to associate with this instance. To use this property, you must specify an IAM instance profile role for the instance. For more information, see Create an IAM instance profile for Systems Manager in the AWS Systems Manager User Guide .

SubnetId

The ID of the subnet to launch the instance into.

Tags

The tags to add to the instance.

Tenancy

The tenancy of the instance.

UserData

The parameters or scripts to store as user data.

Volumes

The volumes to attach to the instance.

Constructors

CfnInstanceProps()

Properties for defining a CfnInstance.

public CfnInstanceProps()
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.EC2;

             var cfnInstanceProps = new CfnInstanceProps {
                 AdditionalInfo = "additionalInfo",
                 Affinity = "affinity",
                 AvailabilityZone = "availabilityZone",
                 BlockDeviceMappings = new [] { new BlockDeviceMappingProperty {
                     DeviceName = "deviceName",

                     // the properties below are optional
                     Ebs = new EbsProperty {
                         DeleteOnTermination = false,
                         Encrypted = false,
                         Iops = 123,
                         KmsKeyId = "kmsKeyId",
                         SnapshotId = "snapshotId",
                         VolumeSize = 123,
                         VolumeType = "volumeType"
                     },
                     NoDevice = new NoDeviceProperty { },
                     VirtualName = "virtualName"
                 } },
                 CpuOptions = new CpuOptionsProperty {
                     CoreCount = 123,
                     ThreadsPerCore = 123
                 },
                 CreditSpecification = new CreditSpecificationProperty {
                     CpuCredits = "cpuCredits"
                 },
                 DisableApiTermination = false,
                 EbsOptimized = false,
                 ElasticGpuSpecifications = new [] { new ElasticGpuSpecificationProperty {
                     Type = "type"
                 } },
                 ElasticInferenceAccelerators = new [] { new ElasticInferenceAcceleratorProperty {
                     Type = "type",

                     // the properties below are optional
                     Count = 123
                 } },
                 EnclaveOptions = new EnclaveOptionsProperty {
                     Enabled = false
                 },
                 HibernationOptions = new HibernationOptionsProperty {
                     Configured = false
                 },
                 HostId = "hostId",
                 HostResourceGroupArn = "hostResourceGroupArn",
                 IamInstanceProfile = "iamInstanceProfile",
                 ImageId = "imageId",
                 InstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior",
                 InstanceType = "instanceType",
                 Ipv6AddressCount = 123,
                 Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
                     Ipv6Address = "ipv6Address"
                 } },
                 KernelId = "kernelId",
                 KeyName = "keyName",
                 LaunchTemplate = new LaunchTemplateSpecificationProperty {
                     Version = "version",

                     // the properties below are optional
                     LaunchTemplateId = "launchTemplateId",
                     LaunchTemplateName = "launchTemplateName"
                 },
                 LicenseSpecifications = new [] { new LicenseSpecificationProperty {
                     LicenseConfigurationArn = "licenseConfigurationArn"
                 } },
                 MetadataOptions = new MetadataOptionsProperty {
                     HttpEndpoint = "httpEndpoint",
                     HttpProtocolIpv6 = "httpProtocolIpv6",
                     HttpPutResponseHopLimit = 123,
                     HttpTokens = "httpTokens",
                     InstanceMetadataTags = "instanceMetadataTags"
                 },
                 Monitoring = false,
                 NetworkInterfaces = new [] { new NetworkInterfaceProperty {
                     DeviceIndex = "deviceIndex",

                     // the properties below are optional
                     AssociateCarrierIpAddress = false,
                     AssociatePublicIpAddress = false,
                     DeleteOnTermination = false,
                     Description = "description",
                     EnaSrdSpecification = new EnaSrdSpecificationProperty {
                         EnaSrdEnabled = false,
                         EnaSrdUdpSpecification = new EnaSrdUdpSpecificationProperty {
                             EnaSrdUdpEnabled = false
                         }
                     },
                     GroupSet = new [] { "groupSet" },
                     Ipv6AddressCount = 123,
                     Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
                         Ipv6Address = "ipv6Address"
                     } },
                     NetworkInterfaceId = "networkInterfaceId",
                     PrivateIpAddress = "privateIpAddress",
                     PrivateIpAddresses = new [] { new PrivateIpAddressSpecificationProperty {
                         Primary = false,
                         PrivateIpAddress = "privateIpAddress"
                     } },
                     SecondaryPrivateIpAddressCount = 123,
                     SubnetId = "subnetId"
                 } },
                 PlacementGroupName = "placementGroupName",
                 PrivateDnsNameOptions = new PrivateDnsNameOptionsProperty {
                     EnableResourceNameDnsAaaaRecord = false,
                     EnableResourceNameDnsARecord = false,
                     HostnameType = "hostnameType"
                 },
                 PrivateIpAddress = "privateIpAddress",
                 PropagateTagsToVolumeOnCreation = false,
                 RamdiskId = "ramdiskId",
                 SecurityGroupIds = new [] { "securityGroupIds" },
                 SecurityGroups = new [] { "securityGroups" },
                 SourceDestCheck = false,
                 SsmAssociations = new [] { new SsmAssociationProperty {
                     DocumentName = "documentName",

                     // the properties below are optional
                     AssociationParameters = new [] { new AssociationParameterProperty {
                         Key = "key",
                         Value = new [] { "value" }
                     } }
                 } },
                 SubnetId = "subnetId",
                 Tags = new [] { new CfnTag {
                     Key = "key",
                     Value = "value"
                 } },
                 Tenancy = "tenancy",
                 UserData = "userData",
                 Volumes = new [] { new VolumeProperty {
                     Device = "device",
                     VolumeId = "volumeId"
                 } }
             };

Properties

AdditionalInfo

This property is reserved for internal use.

public string? AdditionalInfo { get; set; }
Property Value

string

Remarks

If you use it, the stack fails with this error: Bad property set: [Testing this property] (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 0XXXXXX-49c7-4b40-8bcc-76885dcXXXXX) .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-additionalinfo

Affinity

Indicates whether the instance is associated with a dedicated host.

public string? Affinity { get; set; }
Property Value

string

Remarks

If you want the instance to always restart on the same host on which it was launched, specify host . If you want the instance to restart on any available host, but try to launch onto the last host it ran on (on a best-effort basis), specify default .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-affinity

AvailabilityZone

The Availability Zone of the instance.

public string? AvailabilityZone { get; set; }
Property Value

string

Remarks

If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.

This parameter is not supported by DescribeImageAttribute .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-availabilityzone

BlockDeviceMappings

The block device mapping entries that defines the block devices to attach to the instance at launch.

public object? BlockDeviceMappings { get; set; }
Property Value

object

Remarks

By default, the block devices specified in the block device mapping for the AMI are used. You can override the AMI block device mapping using the instance block device mapping. For the root volume, you can override only the volume size, volume type, volume encryption settings, and the DeleteOnTermination setting.

After the instance is running, you can modify only the <code>DeleteOnTermination</code> parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement">replacement</a> .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-blockdevicemappings

CpuOptions

The CPU options for the instance.

public object? CpuOptions { get; set; }
Property Value

object

Remarks

For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-cpuoptions

CreditSpecification

The credit option for CPU usage of the burstable performance instance.

public object? CreditSpecification { get; set; }
Property Value

object

Remarks

Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable performance instances in the Amazon EC2 User Guide .

Default: standard (T2 instances) or unlimited (T3/T3a/T4g instances)

For T3 instances with host tenancy, only standard is supported.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-creditspecification

DisableApiTermination

Indicates whether termination protection is enabled for the instance.

public object? DisableApiTermination { get; set; }
Property Value

object

Remarks

The default is false , which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-disableapitermination

EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O.

public object? EbsOptimized { get; set; }
Property Value

object

Remarks

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

Default: false

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-ebsoptimized

ElasticGpuSpecifications

An elastic GPU to associate with the instance.

public object? ElasticGpuSpecifications { get; set; }
Property Value

object

Remarks
Amazon Elastic Graphics reached end of life on January 8, 2024.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-elasticgpuspecifications

ElasticInferenceAccelerators

An elastic inference accelerator to associate with the instance.

public object? ElasticInferenceAccelerators { get; set; }
Property Value

object

Remarks
Amazon Elastic Inference is no longer available.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-elasticinferenceaccelerators

EnclaveOptions

Indicates whether the instance is enabled for AWS Nitro Enclaves.

public object? EnclaveOptions { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-enclaveoptions

HibernationOptions

Indicates whether an instance is enabled for hibernation.

public object? HibernationOptions { get; set; }
Property Value

object

Remarks

This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide .

You can't enable hibernation and AWS Nitro Enclaves on the same instance.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-hibernationoptions

HostId

If you specify host for the Affinity property, the ID of a dedicated host that the instance is associated with.

public string? HostId { get; set; }
Property Value

string

Remarks

If you don't specify an ID, Amazon EC2 launches the instance onto any available, compatible dedicated host in your account. This type of launch is called an untargeted launch. Note that for untargeted launches, you must have a compatible, dedicated host available to successfully launch instances.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-hostid

HostResourceGroupArn

The ARN of the host resource group in which to launch the instances.

public string? HostResourceGroupArn { get; set; }
Property Value

string

Remarks

If you specify a host resource group ARN, omit the Tenancy parameter or set it to host .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-hostresourcegrouparn

IamInstanceProfile

The name of an IAM instance profile.

public string? IamInstanceProfile { get; set; }
Property Value

string

Remarks

To create a new IAM instance profile, use the AWS::IAM::InstanceProfile resource.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-iaminstanceprofile

ImageId

The ID of the AMI.

public string? ImageId { get; set; }
Property Value

string

Remarks

An AMI ID is required to launch an instance and must be specified here or in a launch template.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-imageid

InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

public string? InstanceInitiatedShutdownBehavior { get; set; }
Property Value

string

Remarks

Default: stop

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-instanceinitiatedshutdownbehavior

InstanceType

The instance type. For more information, see Instance types in the Amazon EC2 User Guide .

public string? InstanceType { get; set; }
Property Value

string

Remarks

When you change your EBS-backed instance type, instance restart or replacement behavior depends on the instance type compatibility between the old and new types. An instance with an instance store volume as the root volume is always replaced. For more information, see Change the instance type in the Amazon EC2 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-instancetype

Ipv6AddressCount

The number of IPv6 addresses to associate with the primary network interface.

public double? Ipv6AddressCount { get; set; }
Property Value

double?

Remarks

Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

You cannot specify this option and the network interfaces option in the same request.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-ipv6addresscount

Ipv6Addresses

The IPv6 addresses from the range of the subnet to associate with the primary network interface.

public object? Ipv6Addresses { get; set; }
Property Value

object

Remarks

You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

You cannot specify this option and the network interfaces option in the same request.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-ipv6addresses

KernelId

The ID of the kernel.

public string? KernelId { get; set; }
Property Value

string

Remarks
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <em>Amazon EC2 User Guide</em> .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-kernelid

KeyName

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

public string? KeyName { get; set; }
Property Value

string

Remarks
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-keyname

LaunchTemplate

The launch template.

public object? LaunchTemplate { get; set; }
Property Value

object

Remarks

Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-launchtemplate

LicenseSpecifications

The license configurations.

public object? LicenseSpecifications { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-licensespecifications

MetadataOptions

The metadata options for the instance.

public object? MetadataOptions { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-metadataoptions

Monitoring

Specifies whether detailed monitoring is enabled for the instance.

public object? Monitoring { get; set; }
Property Value

object

Remarks

Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled. For more information about detailed monitoring, see Enable or turn off detailed monitoring for your instances in the Amazon EC2 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-monitoring

NetworkInterfaces

The network interfaces to associate with the instance.

public object? NetworkInterfaces { get; set; }
Property Value

object

Remarks
If you use this property to point to a network interface, you must terminate the original interface before attaching a new one to allow the update of the instance to succeed.

If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn Attribute to declare a dependency on the VPC-gateway attachment.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-networkinterfaces

PlacementGroupName

The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).

public string? PlacementGroupName { get; set; }
Property Value

string

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-placementgroupname

PrivateDnsNameOptions

The options for the instance hostname.

public object? PrivateDnsNameOptions { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-privatednsnameoptions

PrivateIpAddress

The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.

public string? PrivateIpAddress { get; set; }
Property Value

string

Remarks

Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.

You cannot specify this option and the network interfaces option in the same request.

If you make an update to an instance that requires replacement, you must assign a new private IP address. During a replacement, AWS CloudFormation creates a new instance but doesn't delete the old instance until the stack has successfully updated. If the stack update fails, AWS CloudFormation uses the old instance to roll back the stack to the previous working state. The old and new instances cannot have the same private IP address.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-privateipaddress

PropagateTagsToVolumeOnCreation

Indicates whether to assign the tags specified in the Tags property to the volumes specified in the BlockDeviceMappings property.

public object? PropagateTagsToVolumeOnCreation { get; set; }
Property Value

object

Remarks

Note that using this feature does not assign the tags to volumes that are created separately and then attached using AWS::EC2::VolumeAttachment .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-propagatetagstovolumeoncreation

RamdiskId

The ID of the RAM disk to select.

public string? RamdiskId { get; set; }
Property Value

string

Remarks

Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <em>Amazon EC2 User Guide</em> .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-ramdiskid

SecurityGroupIds

The IDs of the security groups.

public string[]? SecurityGroupIds { get; set; }
Property Value

string[]

Remarks

You can specify the IDs of existing security groups and references to resources created by the stack template.

If you specify a network interface, you must specify any security groups as part of the network interface.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-securitygroupids

SecurityGroups

[Default VPC] The names of the security groups. For a nondefault VPC, you must use security group IDs instead.

public string[]? SecurityGroups { get; set; }
Property Value

string[]

Remarks

You cannot specify this option and the network interfaces option in the same request. The list can contain both the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template.

Default: Amazon EC2 uses the default security group.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-securitygroups

SourceDestCheck

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.

public object? SourceDestCheck { get; set; }
Property Value

object

Remarks

If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-sourcedestcheck

SsmAssociations

The SSM document and parameter values in AWS Systems Manager to associate with this instance. To use this property, you must specify an IAM instance profile role for the instance. For more information, see Create an IAM instance profile for Systems Manager in the AWS Systems Manager User Guide .

public object? SsmAssociations { get; set; }
Property Value

object

Remarks
You can associate only one document with an instance.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-ssmassociations

SubnetId

The ID of the subnet to launch the instance into.

public string? SubnetId { get; set; }
Property Value

string

Remarks

If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-subnetid

Tags

The tags to add to the instance.

public ICfnTag[]? Tags { get; set; }
Property Value

ICfnTag[]

Remarks

These tags are not applied to the EBS volumes, such as the root volume, unless PropagateTagsToVolumeOnCreation is true .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-tags

Tenancy

The tenancy of the instance.

public string? Tenancy { get; set; }
Property Value

string

Remarks

An instance with a tenancy of dedicated runs on single-tenant hardware.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-tenancy

UserData

The parameters or scripts to store as user data.

public string? UserData { get; set; }
Property Value

string

Remarks

Any scripts in user data are run when you launch the instance. User data is limited to 16 KB. You must provide base64-encoded text. For more information, see Fn::Base64 .

If the root volume is an EBS volume and you update user data, CloudFormation restarts the instance. If the root volume is an instance store volume and you update user data, the instance is replaced.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-userdata

Volumes

The volumes to attach to the instance.

public object? Volumes { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-volumes

Implements

ICfnInstanceProps
Back to top Generated by DocFX