run-instances
Description
Launches the specified number of instances using an AMI for which you have permissions.
You can specify a number of options, or leave the default options. The following rules apply:
- If you don’t specify a subnet ID, we choose a default subnet from your default VPC for you. If you don’t have a default VPC, you must specify a subnet ID in the request.
- All instances have a network interface with a primary private IPv4 address. If you don’t specify this address, we choose one from the IPv4 range of your subnet.
- Not all instance types support IPv6 addresses. For more information, see Instance types .
- If you don’t specify a security group ID, we use the default security group for the VPC. For more information, see Security groups .
- If any of the AMIs have a product code attached for which the user has not subscribed, the request fails.
You can create a launch template , which is a resource that contains the parameters to launch an instance. When you launch an instance using RunInstances , you can specify the launch template instead of specifying the launch parameters.
To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.
RunInstances is subject to both request rate limiting and resource rate limiting. For more information, see Request throttling .An instance is ready for you to use when it’s in the running state. You can check the state of your instance using DescribeInstances . You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging your Amazon EC2 resources .
Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key pairs .
For troubleshooting, see What to do if an instance immediately terminates , and Troubleshooting connecting to your instance .
See also: AWS API Documentation
Synopsis
run-instances
[--block-device-mappings <value>]
[--image-id <value>]
[--instance-type <value>]
[--ipv6-address-count <value>]
[--ipv6-addresses <value>]
[--kernel-id <value>]
[--key-name <value>]
[--monitoring <value>]
[--placement <value>]
[--ramdisk-id <value>]
[--security-group-ids <value>]
[--security-groups <value>]
[--subnet-id <value>]
[--user-data <value>]
[--elastic-gpu-specification <value>]
[--elastic-inference-accelerators <value>]
[--tag-specifications <value>]
[--launch-template <value>]
[--instance-market-options <value>]
[--credit-specification <value>]
[--cpu-options <value>]
[--capacity-reservation-specification <value>]
[--hibernation-options <value>]
[--license-specifications <value>]
[--metadata-options <value>]
[--enclave-options <value>]
[--private-dns-name-options <value>]
[--maintenance-options <value>]
[--disable-api-stop | --no-disable-api-stop]
[--enable-primary-ipv6 | --no-enable-primary-ipv6]
[--network-performance-options <value>]
[--operator <value>]
[--dry-run | --no-dry-run]
[--disable-api-termination | --enable-api-termination]
[--instance-initiated-shutdown-behavior <value>]
[--private-ip-address <value>]
[--client-token <value>]
[--additional-info <value>]
[--network-interfaces <value>]
[--iam-instance-profile <value>]
[--ebs-optimized | --no-ebs-optimized]
[--count <value>]
[--secondary-private-ip-addresses <value>]
[--secondary-private-ip-address-count <value>]
[--associate-public-ip-address | --no-associate-public-ip-address]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
Options
--block-device-mappings (list)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide .
(structure)
Describes a block device mapping, which defines the EBS volumes and instance store volumes to attach to an instance at launch.
Ebs -> (structure)
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination -> (boolean)
Iops -> (integer)
The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
The following are the supported values for each volume type:
-
gp3: 3,000 - 16,000 IOPS -
io1: 100 - 64,000 IOPS -
io2: 100 - 256,000 IOPS
For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the Nitro System . On other instances, you can achieve performance up to 32,000 IOPS.
This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS.
SnapshotId -> (string)
VolumeSize -> (integer)
The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.
The following are the supported sizes for each volume type:
-
gp2andgp3: 1 - 16,384 GiB -
io1: 4 - 16,384 GiB -
io2: 4 - 65,536 GiB -
st1andsc1: 125 - 16,384 GiB -
standard: 1 - 1024 GiB
VolumeType -> (string)
KmsKeyId -> (string)
Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed KMS key to use for EBS encryption.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Throughput -> (integer)
The throughput that the volume supports, in MiB/s.
This parameter is valid only for gp3 volumes.
Valid Range: Minimum value of 125. Maximum value of 1000.
OutpostArn -> (string)
The ARN of the Outpost on which the snapshot is stored.
This parameter is not supported when using CreateImage .
Encrypted -> (boolean)
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS encryption in the Amazon EBS User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types .
This parameter is not returned by DescribeImageAttribute .
For CreateImage and RegisterImage , whether you can include this parameter, and the allowed values differ depending on the type of block device mapping you are creating.
- If you are creating a block device mapping for a new (empty) volume , you can include this parameter, and specify either
truefor an encrypted volume, orfalsefor an unencrypted volume. If you omit this parameter, it defaults tofalse(unencrypted). - If you are creating a block device mapping from an existing encrypted or unencrypted snapshot , you must omit this parameter. If you include this parameter, the request will fail, regardless of the value that you specify.
- If you are creating a block device mapping from an existing unencrypted volume , you can include this parameter, but you must specify
false. If you specifytrue, the request will fail. In this case, we recommend that you omit the parameter. - If you are creating a block device mapping from an existing encrypted volume , you can include this parameter, and specify either
trueorfalse. However, if you specifyfalse, the parameter is ignored and the block device mapping is always encrypted. In this case, we recommend that you omit the parameter.
VolumeInitializationRate -> (integer)
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This is also known as volume initialization . Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.
This parameter is supported only for volumes created from snapshots. Omit this parameter if:
- You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation.
Note
If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore.- You want to create a volume that is initialized at the default rate.
For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide .
This parameter is not supported when using CreateImage .
Valid range: 100 - 300 MiB/s
NoDevice -> (string)
DeviceName -> (string)
/dev/sdh or xvdh ).VirtualName -> (string)
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Shorthand Syntax:
Ebs={DeleteOnTermination=boolean,Iops=integer,SnapshotId=string,VolumeSize=integer,VolumeType=string,KmsKeyId=string,Throughput=integer,OutpostArn=string,Encrypted=boolean,VolumeInitializationRate=integer},NoDevice=string,DeviceName=string,VirtualName=string ...
JSON Syntax:
[
{
"Ebs": {
"DeleteOnTermination": true|false,
"Iops": integer,
"SnapshotId": "string",
"VolumeSize": integer,
"VolumeType": "standard"|"io1"|"io2"|"gp2"|"sc1"|"st1"|"gp3",
"KmsKeyId": "string",
"Throughput": integer,
"OutpostArn": "string",
"Encrypted": true|false,
"VolumeInitializationRate": integer
},
"NoDevice": "string",
"DeviceName": "string",
"VirtualName": "string"
}
...
]
--image-id (string)
--instance-type (string)
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide .
Possible values:
a1.mediuma1.largea1.xlargea1.2xlargea1.4xlargea1.metalc1.mediumc1.xlargec3.largec3.xlargec3.2xlargec3.4xlargec3.8xlargec4.largec4.xlargec4.2xlargec4.4xlargec4.8xlargec5.largec5.xlargec5.2xlargec5.4xlargec5.9xlargec5.12xlargec5.18xlargec5.24xlargec5.metalc5a.largec5a.xlargec5a.2xlargec5a.4xlargec5a.8xlargec5a.12xlargec5a.16xlargec5a.24xlargec5ad.largec5ad.xlargec5ad.2xlargec5ad.4xlargec5ad.8xlargec5ad.12xlargec5ad.16xlargec5ad.24xlargec5d.largec5d.xlargec5d.2xlargec5d.4xlargec5d.9xlargec5d.12xlargec5d.18xlargec5d.24xlargec5d.metalc5n.largec5n.xlargec5n.2xlargec5n.4xlargec5n.9xlargec5n.18xlargec5n.metalc6g.mediumc6g.largec6g.xlargec6g.2xlargec6g.4xlargec6g.8xlargec6g.12xlargec6g.16xlargec6g.metalc6gd.mediumc6gd.largec6gd.xlargec6gd.2xlargec6gd.4xlargec6gd.8xlargec6gd.12xlargec6gd.16xlargec6gd.metalc6gn.mediumc6gn.largec6gn.xlargec6gn.2xlargec6gn.4xlargec6gn.8xlargec6gn.12xlargec6gn.16xlargec6i.largec6i.xlargec6i.2xlargec6i.4xlargec6i.8xlargec6i.12xlargec6i.16xlargec6i.24xlargec6i.32xlargec6i.metalcc1.4xlargecc2.8xlargecg1.4xlargecr1.8xlarged2.xlarged2.2xlarged2.4xlarged2.8xlarged3.xlarged3.2xlarged3.4xlarged3.8xlarged3en.xlarged3en.2xlarged3en.4xlarged3en.6xlarged3en.8xlarged3en.12xlargedl1.24xlargef1.2xlargef1.4xlargef1.16xlargeg2.2xlargeg2.8xlargeg3.4xlargeg3.8xlargeg3.16xlargeg3s.xlargeg4ad.xlargeg4ad.2xlargeg4ad.4xlargeg4ad.8xlargeg4ad.16xlargeg4dn.xlargeg4dn.2xlargeg4dn.4xlargeg4dn.8xlargeg4dn.12xlargeg4dn.16xlargeg4dn.metalg5.xlargeg5.2xlargeg5.4xlargeg5.8xlargeg5.12xlargeg5.16xlargeg5.24xlargeg5.48xlargeg5g.xlargeg5g.2xlargeg5g.4xlargeg5g.8xlargeg5g.16xlargeg5g.metalhi1.4xlargehpc6a.48xlargehs1.8xlargeh1.2xlargeh1.4xlargeh1.8xlargeh1.16xlargei2.xlargei2.2xlargei2.4xlargei2.8xlargei3.largei3.xlargei3.2xlargei3.4xlargei3.8xlargei3.16xlargei3.metali3en.largei3en.xlargei3en.2xlargei3en.3xlargei3en.6xlargei3en.12xlargei3en.24xlargei3en.metalim4gn.largeim4gn.xlargeim4gn.2xlargeim4gn.4xlargeim4gn.8xlargeim4gn.16xlargeinf1.xlargeinf1.2xlargeinf1.6xlargeinf1.24xlargeis4gen.mediumis4gen.largeis4gen.xlargeis4gen.2xlargeis4gen.4xlargeis4gen.8xlargem1.smallm1.mediumm1.largem1.xlargem2.xlargem2.2xlargem2.4xlargem3.mediumm3.largem3.xlargem3.2xlargem4.largem4.xlargem4.2xlargem4.4xlargem4.10xlargem4.16xlargem5.largem5.xlargem5.2xlargem5.4xlargem5.8xlargem5.12xlargem5.16xlargem5.24xlargem5.metalm5a.largem5a.xlargem5a.2xlargem5a.4xlargem5a.8xlargem5a.12xlargem5a.16xlargem5a.24xlargem5ad.largem5ad.xlargem5ad.2xlargem5ad.4xlargem5ad.8xlargem5ad.12xlargem5ad.16xlargem5ad.24xlargem5d.largem5d.xlargem5d.2xlargem5d.4xlargem5d.8xlargem5d.12xlargem5d.16xlargem5d.24xlargem5d.metalm5dn.largem5dn.xlargem5dn.2xlargem5dn.4xlargem5dn.8xlargem5dn.12xlargem5dn.16xlargem5dn.24xlargem5dn.metalm5n.largem5n.xlargem5n.2xlargem5n.4xlargem5n.8xlargem5n.12xlargem5n.16xlargem5n.24xlargem5n.metalm5zn.largem5zn.xlargem5zn.2xlargem5zn.3xlargem5zn.6xlargem5zn.12xlargem5zn.metalm6a.largem6a.xlargem6a.2xlargem6a.4xlargem6a.8xlargem6a.12xlargem6a.16xlargem6a.24xlargem6a.32xlargem6a.48xlargem6g.metalm6g.mediumm6g.largem6g.xlargem6g.2xlargem6g.4xlargem6g.8xlargem6g.12xlargem6g.16xlargem6gd.metalm6gd.mediumm6gd.largem6gd.xlargem6gd.2xlargem6gd.4xlargem6gd.8xlargem6gd.12xlargem6gd.16xlargem6i.largem6i.xlargem6i.2xlargem6i.4xlargem6i.8xlargem6i.12xlargem6i.16xlargem6i.24xlargem6i.32xlargem6i.metalmac1.metalp2.xlargep2.8xlargep2.16xlargep3.2xlargep3.8xlargep3.16xlargep3dn.24xlargep4d.24xlarger3.larger3.xlarger3.2xlarger3.4xlarger3.8xlarger4.larger4.xlarger4.2xlarger4.4xlarger4.8xlarger4.16xlarger5.larger5.xlarger5.2xlarger5.4xlarger5.8xlarger5.12xlarger5.16xlarger5.24xlarger5.metalr5a.larger5a.xlarger5a.2xlarger5a.4xlarger5a.8xlarger5a.12xlarger5a.16xlarger5a.24xlarger5ad.larger5ad.xlarger5ad.2xlarger5ad.4xlarger5ad.8xlarger5ad.12xlarger5ad.16xlarger5ad.24xlarger5b.larger5b.xlarger5b.2xlarger5b.4xlarger5b.8xlarger5b.12xlarger5b.16xlarger5b.24xlarger5b.metalr5d.larger5d.xlarger5d.2xlarger5d.4xlarger5d.8xlarger5d.12xlarger5d.16xlarger5d.24xlarger5d.metalr5dn.larger5dn.xlarger5dn.2xlarger5dn.4xlarger5dn.8xlarger5dn.12xlarger5dn.16xlarger5dn.24xlarger5dn.metalr5n.larger5n.xlarger5n.2xlarger5n.4xlarger5n.8xlarger5n.12xlarger5n.16xlarger5n.24xlarger5n.metalr6g.mediumr6g.larger6g.xlarger6g.2xlarger6g.4xlarger6g.8xlarger6g.12xlarger6g.16xlarger6g.metalr6gd.mediumr6gd.larger6gd.xlarger6gd.2xlarger6gd.4xlarger6gd.8xlarger6gd.12xlarger6gd.16xlarger6gd.metalr6i.larger6i.xlarger6i.2xlarger6i.4xlarger6i.8xlarger6i.12xlarger6i.16xlarger6i.24xlarger6i.32xlarger6i.metalt1.microt2.nanot2.microt2.smallt2.mediumt2.larget2.xlarget2.2xlarget3.nanot3.microt3.smallt3.mediumt3.larget3.xlarget3.2xlarget3a.nanot3a.microt3a.smallt3a.mediumt3a.larget3a.xlarget3a.2xlarget4g.nanot4g.microt4g.smallt4g.mediumt4g.larget4g.xlarget4g.2xlargeu-6tb1.56xlargeu-6tb1.112xlargeu-9tb1.112xlargeu-12tb1.112xlargeu-6tb1.metalu-9tb1.metalu-12tb1.metalu-18tb1.metalu-24tb1.metalvt1.3xlargevt1.6xlargevt1.24xlargex1.16xlargex1.32xlargex1e.xlargex1e.2xlargex1e.4xlargex1e.8xlargex1e.16xlargex1e.32xlargex2iezn.2xlargex2iezn.4xlargex2iezn.6xlargex2iezn.8xlargex2iezn.12xlargex2iezn.metalx2gd.mediumx2gd.largex2gd.xlargex2gd.2xlargex2gd.4xlargex2gd.8xlargex2gd.12xlargex2gd.16xlargex2gd.metalz1d.largez1d.xlargez1d.2xlargez1d.3xlargez1d.6xlargez1d.12xlargez1d.metalx2idn.16xlargex2idn.24xlargex2idn.32xlargex2iedn.xlargex2iedn.2xlargex2iedn.4xlargex2iedn.8xlargex2iedn.16xlargex2iedn.24xlargex2iedn.32xlargec6a.largec6a.xlargec6a.2xlargec6a.4xlargec6a.8xlargec6a.12xlargec6a.16xlargec6a.24xlargec6a.32xlargec6a.48xlargec6a.metalm6a.metali4i.largei4i.xlargei4i.2xlargei4i.4xlargei4i.8xlargei4i.16xlargei4i.32xlargei4i.metalx2idn.metalx2iedn.metalc7g.mediumc7g.largec7g.xlargec7g.2xlargec7g.4xlargec7g.8xlargec7g.12xlargec7g.16xlargemac2.metalc6id.largec6id.xlargec6id.2xlargec6id.4xlargec6id.8xlargec6id.12xlargec6id.16xlargec6id.24xlargec6id.32xlargec6id.metalm6id.largem6id.xlargem6id.2xlargem6id.4xlargem6id.8xlargem6id.12xlargem6id.16xlargem6id.24xlargem6id.32xlargem6id.metalr6id.larger6id.xlarger6id.2xlarger6id.4xlarger6id.8xlarger6id.12xlarger6id.16xlarger6id.24xlarger6id.32xlarger6id.metalr6a.larger6a.xlarger6a.2xlarger6a.4xlarger6a.8xlarger6a.12xlarger6a.16xlarger6a.24xlarger6a.32xlarger6a.48xlarger6a.metalp4de.24xlargeu-3tb1.56xlargeu-18tb1.112xlargeu-24tb1.112xlargetrn1.2xlargetrn1.32xlargehpc6id.32xlargec6in.largec6in.xlargec6in.2xlargec6in.4xlargec6in.8xlargec6in.12xlargec6in.16xlargec6in.24xlargec6in.32xlargem6in.largem6in.xlargem6in.2xlargem6in.4xlargem6in.8xlargem6in.12xlargem6in.16xlargem6in.24xlargem6in.32xlargem6idn.largem6idn.xlargem6idn.2xlargem6idn.4xlargem6idn.8xlargem6idn.12xlargem6idn.16xlargem6idn.24xlargem6idn.32xlarger6in.larger6in.xlarger6in.2xlarger6in.4xlarger6in.8xlarger6in.12xlarger6in.16xlarger6in.24xlarger6in.32xlarger6idn.larger6idn.xlarger6idn.2xlarger6idn.4xlarger6idn.8xlarger6idn.12xlarger6idn.16xlarger6idn.24xlarger6idn.32xlargec7g.metalm7g.mediumm7g.largem7g.xlargem7g.2xlargem7g.4xlargem7g.8xlargem7g.12xlargem7g.16xlargem7g.metalr7g.mediumr7g.larger7g.xlarger7g.2xlarger7g.4xlarger7g.8xlarger7g.12xlarger7g.16xlarger7g.metalc6in.metalm6in.metalm6idn.metalr6in.metalr6idn.metalinf2.xlargeinf2.8xlargeinf2.24xlargeinf2.48xlargetrn1n.32xlargei4g.largei4g.xlargei4g.2xlargei4g.4xlargei4g.8xlargei4g.16xlargehpc7g.4xlargehpc7g.8xlargehpc7g.16xlargec7gn.mediumc7gn.largec7gn.xlargec7gn.2xlargec7gn.4xlargec7gn.8xlargec7gn.12xlargec7gn.16xlargep5.48xlargem7i.largem7i.xlargem7i.2xlargem7i.4xlargem7i.8xlargem7i.12xlargem7i.16xlargem7i.24xlargem7i.48xlargem7i-flex.largem7i-flex.xlargem7i-flex.2xlargem7i-flex.4xlargem7i-flex.8xlargem7a.mediumm7a.largem7a.xlargem7a.2xlargem7a.4xlargem7a.8xlargem7a.12xlargem7a.16xlargem7a.24xlargem7a.32xlargem7a.48xlargem7a.metal-48xlhpc7a.12xlargehpc7a.24xlargehpc7a.48xlargehpc7a.96xlargec7gd.mediumc7gd.largec7gd.xlargec7gd.2xlargec7gd.4xlargec7gd.8xlargec7gd.12xlargec7gd.16xlargem7gd.mediumm7gd.largem7gd.xlargem7gd.2xlargem7gd.4xlargem7gd.8xlargem7gd.12xlargem7gd.16xlarger7gd.mediumr7gd.larger7gd.xlarger7gd.2xlarger7gd.4xlarger7gd.8xlarger7gd.12xlarger7gd.16xlarger7a.mediumr7a.larger7a.xlarger7a.2xlarger7a.4xlarger7a.8xlarger7a.12xlarger7a.16xlarger7a.24xlarger7a.32xlarger7a.48xlargec7i.largec7i.xlargec7i.2xlargec7i.4xlargec7i.8xlargec7i.12xlargec7i.16xlargec7i.24xlargec7i.48xlargemac2-m2pro.metalr7iz.larger7iz.xlarger7iz.2xlarger7iz.4xlarger7iz.8xlarger7iz.12xlarger7iz.16xlarger7iz.32xlargec7a.mediumc7a.largec7a.xlargec7a.2xlargec7a.4xlargec7a.8xlargec7a.12xlargec7a.16xlargec7a.24xlargec7a.32xlargec7a.48xlargec7a.metal-48xlr7a.metal-48xlr7i.larger7i.xlarger7i.2xlarger7i.4xlarger7i.8xlarger7i.12xlarger7i.16xlarger7i.24xlarger7i.48xlargedl2q.24xlargemac2-m2.metali4i.12xlargei4i.24xlargec7i.metal-24xlc7i.metal-48xlm7i.metal-24xlm7i.metal-48xlr7i.metal-24xlr7i.metal-48xlr7iz.metal-16xlr7iz.metal-32xlc7gd.metalm7gd.metalr7gd.metalg6.xlargeg6.2xlargeg6.4xlargeg6.8xlargeg6.12xlargeg6.16xlargeg6.24xlargeg6.48xlargegr6.4xlargegr6.8xlargec7i-flex.largec7i-flex.xlargec7i-flex.2xlargec7i-flex.4xlargec7i-flex.8xlargeu7i-12tb.224xlargeu7in-16tb.224xlargeu7in-24tb.224xlargeu7in-32tb.224xlargeu7ib-12tb.224xlargec7gn.metalr8g.mediumr8g.larger8g.xlarger8g.2xlarger8g.4xlarger8g.8xlarger8g.12xlarger8g.16xlarger8g.24xlarger8g.48xlarger8g.metal-24xlr8g.metal-48xlmac2-m1ultra.metalg6e.xlargeg6e.2xlargeg6e.4xlargeg6e.8xlargeg6e.12xlargeg6e.16xlargeg6e.24xlargeg6e.48xlargec8g.mediumc8g.largec8g.xlargec8g.2xlargec8g.4xlargec8g.8xlargec8g.12xlargec8g.16xlargec8g.24xlargec8g.48xlargec8g.metal-24xlc8g.metal-48xlm8g.mediumm8g.largem8g.xlargem8g.2xlargem8g.4xlargem8g.8xlargem8g.12xlargem8g.16xlargem8g.24xlargem8g.48xlargem8g.metal-24xlm8g.metal-48xlx8g.mediumx8g.largex8g.xlargex8g.2xlargex8g.4xlargex8g.8xlargex8g.12xlargex8g.16xlargex8g.24xlargex8g.48xlargex8g.metal-24xlx8g.metal-48xli7ie.largei7ie.xlargei7ie.2xlargei7ie.3xlargei7ie.6xlargei7ie.12xlargei7ie.18xlargei7ie.24xlargei7ie.48xlargei8g.largei8g.xlargei8g.2xlargei8g.4xlargei8g.8xlargei8g.12xlargei8g.16xlargei8g.24xlargei8g.metal-24xlu7i-6tb.112xlargeu7i-8tb.112xlargeu7inh-32tb.480xlargep5e.48xlargep5en.48xlargef2.12xlargef2.48xlargetrn2.48xlargec7i-flex.12xlargec7i-flex.16xlargem7i-flex.12xlargem7i-flex.16xlargei7ie.metal-24xli7ie.metal-48xli8g.48xlargec8gd.mediumc8gd.largec8gd.xlargec8gd.2xlargec8gd.4xlargec8gd.8xlargec8gd.12xlargec8gd.16xlargec8gd.24xlargec8gd.48xlargec8gd.metal-24xlc8gd.metal-48xli7i.largei7i.xlargei7i.2xlargei7i.4xlargei7i.8xlargei7i.12xlargei7i.16xlargei7i.24xlargei7i.48xlargei7i.metal-24xli7i.metal-48xlp6-b200.48xlargem8gd.mediumm8gd.largem8gd.xlargem8gd.2xlargem8gd.4xlargem8gd.8xlargem8gd.12xlargem8gd.16xlargem8gd.24xlargem8gd.48xlargem8gd.metal-24xlm8gd.metal-48xlr8gd.mediumr8gd.larger8gd.xlarger8gd.2xlarger8gd.4xlarger8gd.8xlarger8gd.12xlarger8gd.16xlarger8gd.24xlarger8gd.48xlarger8gd.metal-24xlr8gd.metal-48xl
--ipv6-address-count (integer)
The number of IPv6 addresses to associate with the primary network interface. 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.
--ipv6-addresses (list)
The IPv6 addresses from the range of the subnet to associate with the primary network interface. 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.
(structure)
Describes an IPv6 address.
Ipv6Address -> (string)
IsPrimaryIpv6 -> (boolean)
Shorthand Syntax:
Ipv6Address=string,IsPrimaryIpv6=boolean ...
JSON Syntax:
[
{
"Ipv6Address": "string",
"IsPrimaryIpv6": true|false
}
...
]
--kernel-id (string)
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .--key-name (string)
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
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.--monitoring (structure)
Specifies whether detailed monitoring is enabled for the instance.
Enabled -> (boolean)
Shorthand Syntax:
Enabled=boolean
JSON Syntax:
{
"Enabled": true|false
}
--placement (structure)
The placement for the instance.
Affinity -> (string)
The affinity setting for the instance on the Dedicated Host.
This parameter is not supported for CreateFleet or ImportInstance .
GroupName -> (string)
GroupName , you can’t specify GroupId .PartitionNumber -> (integer)
The number of the partition that the instance is in. Valid only if the placement group strategy is set to partition .
This parameter is not supported for CreateFleet .
HostId -> (string)
The ID of the Dedicated Host on which the instance resides.
This parameter is not supported for CreateFleet or ImportInstance .
Tenancy -> (string)
The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware.
This parameter is not supported for CreateFleet . The host tenancy is not supported for ImportInstance or for T3 instances that are configured for the unlimited CPU credit option.
SpreadDomain -> (string)
HostResourceGroupArn -> (string)
The ARN of the host resource group in which to launch the instances.
If you specify this parameter, either omit the Tenancy parameter or set it to host .
This parameter is not supported for CreateFleet .
GroupId -> (string)
GroupId , you can’t specify GroupName .AvailabilityZone -> (string)
The Availability Zone of the instance.
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 for CreateFleet .
Shorthand Syntax:
Affinity=string,GroupName=string,PartitionNumber=integer,HostId=string,Tenancy=string,SpreadDomain=string,HostResourceGroupArn=string,GroupId=string,AvailabilityZone=string
JSON Syntax:
{
"Affinity": "string",
"GroupName": "string",
"PartitionNumber": integer,
"HostId": "string",
"Tenancy": "default"|"dedicated"|"host",
"SpreadDomain": "string",
"HostResourceGroupArn": "string",
"GroupId": "string",
"AvailabilityZone": "string"
}
--ramdisk-id (string)
The ID of the RAM disk to select. 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 Amazon Web Services Resource Center and search for the kernel ID.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .--security-group-ids (list)
The IDs of the security groups. You can create a security group using CreateSecurityGroup .
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
(string)
Syntax:
"string" "string" ...
--security-groups (list)
[Default VPC] The names of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
Default: Amazon EC2 uses the default security group.
(string)
Syntax:
"string" "string" ...
--subnet-id (string)
The ID of the subnet to launch the instance into.
If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.
--user-data (string)
--elastic-gpu-specification (list)
An elastic GPU to associate with the instance.
Note
Amazon Elastic Graphics reached end of life on January 8, 2024.(structure)
Note
Amazon Elastic Graphics reached end of life on January 8, 2024.A specification for an Elastic Graphics accelerator.
Type -> (string)
Shorthand Syntax:
Type=string ...
JSON Syntax:
[
{
"Type": "string"
}
...
]
--elastic-inference-accelerators (list)
An elastic inference accelerator to associate with the instance.
Note
Amazon Elastic Inference is no longer available.(structure)
Note
Amazon Elastic Inference is no longer available.Describes an elastic inference accelerator.
Type -> (string)
eia1.medium , eia1.large , eia1.xlarge , eia2.medium , eia2.large , and eia2.xlarge .Count -> (integer)
The number of elastic inference accelerators to attach to the instance.
Default: 1
Shorthand Syntax:
Type=string,Count=integer ...
JSON Syntax:
[
{
"Type": "string",
"Count": integer
}
...
]
--tag-specifications (list)
The tags to apply to the resources that are created during instance launch.
You can specify tags for the following resources only:
- Instances
- Volumes
- Spot Instance requests
- Network interfaces
To tag a resource after it has been created, see CreateTags .
(structure)
The tags to apply to a resource when the resource is being created. When you specify a tag, you must specify the resource type to tag, otherwise the request will fail.
Note
TheValid Values lists all the resource types that can be tagged. However, the action you’re using might not support tagging all of these resource types. If you try to tag a resource type that is unsupported for the action you’re using, you’ll get an error.ResourceType -> (string)
Tags -> (list)
The tags to apply to the resource.
(structure)
Describes a tag.
Key -> (string)
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value -> (string)
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.
Shorthand Syntax:
ResourceType=string,Tags=[{Key=string,Value=string},{Key=string,Value=string}] ...
JSON Syntax:
[
{
"ResourceType": "capacity-reservation"|"client-vpn-endpoint"|"customer-gateway"|"carrier-gateway"|"coip-pool"|"declarative-policies-report"|"dedicated-host"|"dhcp-options"|"egress-only-internet-gateway"|"elastic-ip"|"elastic-gpu"|"export-image-task"|"export-instance-task"|"fleet"|"fpga-image"|"host-reservation"|"image"|"import-image-task"|"import-snapshot-task"|"instance"|"instance-event-window"|"internet-gateway"|"ipam"|"ipam-pool"|"ipam-scope"|"ipv4pool-ec2"|"ipv6pool-ec2"|"key-pair"|"launch-template"|"local-gateway"|"local-gateway-route-table"|"local-gateway-virtual-interface"|"local-gateway-virtual-interface-group"|"local-gateway-route-table-vpc-association"|"local-gateway-route-table-virtual-interface-group-association"|"natgateway"|"network-acl"|"network-interface"|"network-insights-analysis"|"network-insights-path"|"network-insights-access-scope"|"network-insights-access-scope-analysis"|"outpost-lag"|"placement-group"|"prefix-list"|"replace-root-volume-task"|"reserved-instances"|"route-table"|"security-group"|"security-group-rule"|"service-link-virtual-interface"|"snapshot"|"spot-fleet-request"|"spot-instances-request"|"subnet"|"subnet-cidr-reservation"|"traffic-mirror-filter"|"traffic-mirror-session"|"traffic-mirror-target"|"transit-gateway"|"transit-gateway-attachment"|"transit-gateway-connect-peer"|"transit-gateway-multicast-domain"|"transit-gateway-policy-table"|"transit-gateway-route-table"|"transit-gateway-route-table-announcement"|"volume"|"vpc"|"vpc-endpoint"|"vpc-endpoint-connection"|"vpc-endpoint-service"|"vpc-endpoint-service-permission"|"vpc-peering-connection"|"vpn-connection"|"vpn-gateway"|"vpc-flow-log"|"capacity-reservation-fleet"|"traffic-mirror-filter-rule"|"vpc-endpoint-connection-device-type"|"verified-access-instance"|"verified-access-group"|"verified-access-endpoint"|"verified-access-policy"|"verified-access-trust-provider"|"vpn-connection-device-type"|"vpc-block-public-access-exclusion"|"route-server"|"route-server-endpoint"|"route-server-peer"|"ipam-resource-discovery"|"ipam-resource-discovery-association"|"instance-connect-endpoint"|"verified-access-endpoint-target"|"ipam-external-resource-verification-token"|"mac-modification-task",
"Tags": [
{
"Key": "string",
"Value": "string"
}
...
]
}
...
]
--launch-template (structure)
The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.
LaunchTemplateId -> (string)
The ID of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
LaunchTemplateName -> (string)
The name of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
Version -> (string)
The launch template version number, $Latest , or $Default .
A value of $Latest uses the latest version of the launch template.
A value of $Default uses the default version of the launch template.
Default: The default version of the launch template.
Shorthand Syntax:
LaunchTemplateId=string,LaunchTemplateName=string,Version=string
JSON Syntax:
{
"LaunchTemplateId": "string",
"LaunchTemplateName": "string",
"Version": "string"
}
--instance-market-options (structure)
The market (purchasing) option for the instances.
For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
MarketType -> (string)
SpotOptions -> (structure)
The options for Spot Instances.
MaxPrice -> (string)
The maximum hourly price that you’re willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.
Warning
If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.
If you specify a maximum price, it must be more than USD $0.001. Specifying a value below USD $0.001 will result in an InvalidParameterValue error message.
SpotInstanceType -> (string)
hibernate or stop .BlockDurationMinutes -> (integer)
ValidUntil -> (timestamp)
The end date of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). Supported only for persistent requests.
- For a persistent request, the request remains active until the
ValidUntildate and time is reached. Otherwise, the request remains active until you cancel it. - For a one-time request,
ValidUntilis not supported. The request remains active until all instances launch or you cancel the request.
InstanceInterruptionBehavior -> (string)
The behavior when a Spot Instance is interrupted.
If Configured (for ` HibernationOptions https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html`__ ) is set to true , the InstanceInterruptionBehavior parameter is automatically set to hibernate . If you set it to stop or terminate , you’ll get an error.
If Configured (for ` HibernationOptions https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html`__ ) is set to false or null , the InstanceInterruptionBehavior parameter is automatically set to terminate . You can also set it to stop or hibernate .
For more information, see Interruption behavior in the Amazon EC2 User Guide .
Shorthand Syntax:
MarketType=string,SpotOptions={MaxPrice=string,SpotInstanceType=string,BlockDurationMinutes=integer,ValidUntil=timestamp,InstanceInterruptionBehavior=string}
JSON Syntax:
{
"MarketType": "spot"|"capacity-block",
"SpotOptions": {
"MaxPrice": "string",
"SpotInstanceType": "one-time"|"persistent",
"BlockDurationMinutes": integer,
"ValidUntil": timestamp,
"InstanceInterruptionBehavior": "hibernate"|"stop"|"terminate"
}
}
--credit-specification (structure)
The credit option for CPU usage of the burstable performance instance. 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.
CpuCredits -> (string)
The credit option for CPU usage of a T instance.
Valid values: standard | unlimited
Shorthand Syntax:
CpuCredits=string
JSON Syntax:
{
"CpuCredits": "string"
}
--cpu-options (structure)
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide .
CoreCount -> (integer)
ThreadsPerCore -> (integer)
1 . Otherwise, specify the default value of 2 .AmdSevSnp -> (string)
Shorthand Syntax:
CoreCount=integer,ThreadsPerCore=integer,AmdSevSnp=string
JSON Syntax:
{
"CoreCount": integer,
"ThreadsPerCore": integer,
"AmdSevSnp": "enabled"|"disabled"
}
--capacity-reservation-specification (structure)
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance’s Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy).
CapacityReservationPreference -> (string)
Indicates the instance’s Capacity Reservation preferences. Possible preferences include:
-
capacity-reservations-only- The instance will only run in a Capacity Reservation or Capacity Reservation group. If capacity isn’t available, the instance will fail to launch. -
open- The instance can run in anyopenCapacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy). If capacity isn’t available, the instance runs as an On-Demand Instance. -
none- The instance doesn’t run in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
CapacityReservationTarget -> (structure)
Information about the target Capacity Reservation or Capacity Reservation group.
CapacityReservationId -> (string)
CapacityReservationResourceGroupArn -> (string)
Shorthand Syntax:
CapacityReservationPreference=string,CapacityReservationTarget={CapacityReservationId=string,CapacityReservationResourceGroupArn=string}
JSON Syntax:
{
"CapacityReservationPreference": "capacity-reservations-only"|"open"|"none",
"CapacityReservationTarget": {
"CapacityReservationId": "string",
"CapacityReservationResourceGroupArn": "string"
}
}
--hibernation-options (structure)
Indicates whether an instance is enabled for hibernation. 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 Amazon Web Services Nitro Enclaves on the same instance.
Configured -> (boolean)
Set to true to enable your instance for hibernation.
For Spot Instances, if you set Configured to true , either omit the InstanceInterruptionBehavior parameter (for ` SpotMarketOptions https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotMarketOptions.html`__ ), or set it to hibernate . When Configured is true:
- If you omit
InstanceInterruptionBehavior, it defaults tohibernate. - If you set
InstanceInterruptionBehaviorto a value other thanhibernate, you’ll get an error.
Default: false
Shorthand Syntax:
Configured=boolean
JSON Syntax:
{
"Configured": true|false
}
--license-specifications (list)
The license configurations.
(structure)
Describes a license configuration.
LicenseConfigurationArn -> (string)
Shorthand Syntax:
LicenseConfigurationArn=string ...
JSON Syntax:
[
{
"LicenseConfigurationArn": "string"
}
...
]
--metadata-options (structure)
The metadata options for the instance. For more information, see Instance metadata and user data .
HttpTokens -> (string)
Indicates whether IMDSv2 is required.
-
optional- IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1. -
required- IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.
Default:
- If the value of
ImdsSupportfor the Amazon Machine Image (AMI) for your instance isv2.0and the account level default is set tono-preference, the default isrequired. - If the value of
ImdsSupportfor the Amazon Machine Image (AMI) for your instance isv2.0, but the account level default is set toV1 or V2, the default isoptional.
The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide .
HttpPutResponseHopLimit -> (integer)
The maximum number of hops that the metadata token can travel.
Possible values: Integers from 1 to 64
HttpEndpoint -> (string)
Enables or disables the HTTP metadata endpoint on your instances.
If you specify a value of disabled , you cannot access your instance metadata.
Default: enabled
HttpProtocolIpv6 -> (string)
Enables or disables the IPv6 endpoint for the instance metadata service.
Default: disabled
InstanceMetadataTags -> (string)
Set to enabled to allow access to instance tags from the instance metadata. Set to disabled to turn off access to instance tags from the instance metadata. For more information, see Work with instance tags using the instance metadata .
Default: disabled
Shorthand Syntax:
HttpTokens=string,HttpPutResponseHopLimit=integer,HttpEndpoint=string,HttpProtocolIpv6=string,InstanceMetadataTags=string
JSON Syntax:
{
"HttpTokens": "optional"|"required",
"HttpPutResponseHopLimit": integer,
"HttpEndpoint": "disabled"|"enabled",
"HttpProtocolIpv6": "disabled"|"enabled",
"InstanceMetadataTags": "disabled"|"enabled"
}
--enclave-options (structure)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide .
You can’t enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
Enabled -> (boolean)
true .Shorthand Syntax:
Enabled=boolean
JSON Syntax:
{
"Enabled": true|false
}
--private-dns-name-options (structure)
The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.
HostnameType -> (string)
EnableResourceNameDnsARecord -> (boolean)
EnableResourceNameDnsAAAARecord -> (boolean)
Shorthand Syntax:
HostnameType=string,EnableResourceNameDnsARecord=boolean,EnableResourceNameDnsAAAARecord=boolean
JSON Syntax:
{
"HostnameType": "ip-name"|"resource-name",
"EnableResourceNameDnsARecord": true|false,
"EnableResourceNameDnsAAAARecord": true|false
}
--maintenance-options (structure)
The maintenance and recovery options for the instance.
AutoRecovery -> (string)
Shorthand Syntax:
AutoRecovery=string
JSON Syntax:
{
"AutoRecovery": "disabled"|"default"
}
--disable-api-stop | --no-disable-api-stop (boolean)
--enable-primary-ipv6 | --no-enable-primary-ipv6 (boolean)
--network-performance-options (structure)
Contains settings for the network performance options for the instance.
BandwidthWeighting -> (string)
Specify the bandwidth weighting option to boost the associated type of baseline bandwidth, as follows:
This option uses the standard bandwidth configuration for your instance type.
This option boosts your networking baseline bandwidth and reduces your EBS baseline bandwidth.
This option boosts your EBS baseline bandwidth and reduces your networking baseline bandwidth.
Shorthand Syntax:
BandwidthWeighting=string
JSON Syntax:
{
"BandwidthWeighting": "default"|"vpc-1"|"ebs-1"
}
--operator (structure)
Reserved for internal use.
Principal -> (string)
Shorthand Syntax:
Principal=string
JSON Syntax:
{
"Principal": "string"
}
--dry-run | --no-dry-run (boolean)
DryRunOperation . Otherwise, it is UnauthorizedOperation .--disable-api-termination | --enable-api-termination (boolean)
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.--instance-initiated-shutdown-behavior (string)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
Possible values:
stopterminate
--private-ip-address (string)
The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
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.
--client-token (string)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.
For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
--additional-info (string)
--network-interfaces (list)
The network interfaces to associate with the instance.
(structure)
Describes a network interface.
AssociatePublicIpAddress -> (boolean)
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page .
DeleteOnTermination -> (boolean)
true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.Description -> (string)
DeviceIndex -> (integer)
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups -> (list)
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
(string)
Ipv6AddressCount -> (integer)
Ipv6Addresses -> (list)
The IPv6 addresses to assign to the network interface. 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.
(structure)
Describes an IPv6 address.
Ipv6Address -> (string)
IsPrimaryIpv6 -> (boolean)
NetworkInterfaceId -> (string)
The ID of the network interface.
If you are creating a Spot Fleet, omit this parameter because you can’t specify a network interface ID in a launch specification.
PrivateIpAddress -> (string)
PrivateIpAddresses -> (list)
The private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you’re launching more than one instance in a RunInstances request.
(structure)
Describes a secondary private IPv4 address for a network interface.
Primary -> (boolean)
PrivateIpAddress -> (string)
SecondaryPrivateIpAddressCount -> (integer)
PrivateIpAddress parameter.SubnetId -> (string)
AssociateCarrierIpAddress -> (boolean)
Indicates whether to assign a carrier IP address to the network interface.
You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the Amazon Web Services Wavelength Developer Guide .
InterfaceType -> (string)
The type of network interface.
If you specify efa-only , do not assign any IP addresses to the network interface. EFA-only network interfaces do not support IP addresses.
Valid values: interface | efa | efa-only
NetworkCardIndex -> (integer)
The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.
If you are using RequestSpotInstances to create Spot Instances, omit this parameter because you can’t specify the network card index when using this API. To specify the network card index, use RunInstances .
Ipv4Prefixes -> (list)
The IPv4 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv4PrefixCount option.
(structure)
Describes the IPv4 prefix option for a network interface.
Ipv4Prefix -> (string)
Ipv4PrefixCount -> (integer)
Ipv4Prefix option.Ipv6Prefixes -> (list)
The IPv6 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv6PrefixCount option.
(structure)
Describes the IPv6 prefix option for a network interface.
Ipv6Prefix -> (string)
Ipv6PrefixCount -> (integer)
Ipv6Prefix option.PrimaryIpv6 -> (boolean)
EnaSrdSpecification -> (structure)
Specifies the ENA Express settings for the network interface that’s attached to the instance.
EnaSrdEnabled -> (boolean)
EnaSrdUdpSpecification -> (structure)
Contains ENA Express settings for UDP network traffic for the network interface attached to the instance.
EnaSrdUdpEnabled -> (boolean)
true .ConnectionTrackingSpecification -> (structure)
A security group connection tracking specification that enables you to set the timeout for connection tracking on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon EC2 User Guide .
TcpEstablishedTimeout -> (integer)
UdpStreamTimeout -> (integer)
UdpTimeout -> (integer)
EnaQueueCount -> (integer)
Shorthand Syntax:
AssociatePublicIpAddress=boolean,DeleteOnTermination=boolean,Description=string,DeviceIndex=integer,Groups=string,string,Ipv6AddressCount=integer,Ipv6Addresses=[{Ipv6Address=string,IsPrimaryIpv6=boolean},{Ipv6Address=string,IsPrimaryIpv6=boolean}],NetworkInterfaceId=string,PrivateIpAddress=string,PrivateIpAddresses=[{Primary=boolean,PrivateIpAddress=string},{Primary=boolean,PrivateIpAddress=string}],SecondaryPrivateIpAddressCount=integer,SubnetId=string,AssociateCarrierIpAddress=boolean,InterfaceType=string,NetworkCardIndex=integer,Ipv4Prefixes=[{Ipv4Prefix=string},{Ipv4Prefix=string}],Ipv4PrefixCount=integer,Ipv6Prefixes=[{Ipv6Prefix=string},{Ipv6Prefix=string}],Ipv6PrefixCount=integer,PrimaryIpv6=boolean,EnaSrdSpecification={EnaSrdEnabled=boolean,EnaSrdUdpSpecification={EnaSrdUdpEnabled=boolean}},ConnectionTrackingSpecification={TcpEstablishedTimeout=integer,UdpStreamTimeout=integer,UdpTimeout=integer},EnaQueueCount=integer ...
JSON Syntax:
[
{
"AssociatePublicIpAddress": true|false,
"DeleteOnTermination": true|false,
"Description": "string",
"DeviceIndex": integer,
"Groups": ["string", ...],
"Ipv6AddressCount": integer,
"Ipv6Addresses": [
{
"Ipv6Address": "string",
"IsPrimaryIpv6": true|false
}
...
],
"NetworkInterfaceId": "string",
"PrivateIpAddress": "string",
"PrivateIpAddresses": [
{
"Primary": true|false,
"PrivateIpAddress": "string"
}
...
],
"SecondaryPrivateIpAddressCount": integer,
"SubnetId": "string",
"AssociateCarrierIpAddress": true|false,
"InterfaceType": "string",
"NetworkCardIndex": integer,
"Ipv4Prefixes": [
{
"Ipv4Prefix": "string"
}
...
],
"Ipv4PrefixCount": integer,
"Ipv6Prefixes": [
{
"Ipv6Prefix": "string"
}
...
],
"Ipv6PrefixCount": integer,
"PrimaryIpv6": true|false,
"EnaSrdSpecification": {
"EnaSrdEnabled": true|false,
"EnaSrdUdpSpecification": {
"EnaSrdUdpEnabled": true|false
}
},
"ConnectionTrackingSpecification": {
"TcpEstablishedTimeout": integer,
"UdpStreamTimeout": integer,
"UdpTimeout": integer
},
"EnaQueueCount": integer
}
...
]
--iam-instance-profile (structure)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
Arn -> (string)
Name -> (string)
Shorthand Syntax:
Arn=string,Name=string
JSON Syntax:
{
"Arn": "string",
"Name": "string"
}
--ebs-optimized | --no-ebs-optimized (boolean)
Indicates whether the instance is optimized for Amazon EBS I/O. 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
--count (string)
min:max then the first number is interpreted as the minimum number of instances to launch and the second is interpreted as the maximum number of instances to launch.--secondary-private-ip-addresses (string) [EC2-VPC] A secondary private IP address for the network interface or instance. You can specify this multiple times to assign multiple secondary IP addresses. If you want additional private IP addresses but do not need a specific address, use the –secondary-private-ip-address-count option.
--secondary-private-ip-address-count (string) [EC2-VPC] The number of secondary IP addresses to assign to the network interface or instance.
--associate-public-ip-address | --no-associate-public-ip-address (boolean) [EC2-VPC] If specified a public IP address will be assigned to the new instance in a VPC.
--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
Global Options
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
- json
- text
- table
- yaml
- yaml-stream
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
- on
- off
- auto
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
- base64
- raw-in-base64-out
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
Examples
Note
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Example 1: To launch an instance into a default subnet
The following run-instances example launches a single instance of type t2.micro into the default subnet for the current Region and associates it with the default subnet for the default VPC for the Region. The key pair is optional if you do not plan to connect to your instance using SSH (Linux) or RDP (Windows).
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--key-name MyKeyPair
Output:
{
"Instances": [
{
"AmiLaunchIndex": 0,
"ImageId": "ami-0abcdef1234567890",
"InstanceId": "i-1231231230abcdef0",
"InstanceType": "t2.micro",
"KeyName": "MyKeyPair",
"LaunchTime": "2018-05-10T08:05:20.000Z",
"Monitoring": {
"State": "disabled"
},
"Placement": {
"AvailabilityZone": "us-east-2a",
"GroupName": "",
"Tenancy": "default"
},
"PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal",
"PrivateIpAddress": "10.0.0.157",
"ProductCodes": [],
"PublicDnsName": "",
"State": {
"Code": 0,
"Name": "pending"
},
"StateTransitionReason": "",
"SubnetId": "subnet-04a636d18e83cfacb",
"VpcId": "vpc-1234567890abcdef0",
"Architecture": "x86_64",
"BlockDeviceMappings": [],
"ClientToken": "",
"EbsOptimized": false,
"Hypervisor": "xen",
"NetworkInterfaces": [
{
"Attachment": {
"AttachTime": "2018-05-10T08:05:20.000Z",
"AttachmentId": "eni-attach-0e325c07e928a0405",
"DeleteOnTermination": true,
"DeviceIndex": 0,
"Status": "attaching"
},
"Description": "",
"Groups": [
{
"GroupName": "MySecurityGroup",
"GroupId": "sg-0598c7d356eba48d7"
}
],
"Ipv6Addresses": [],
"MacAddress": "0a:ab:58:e0:67:e2",
"NetworkInterfaceId": "eni-0c0a29997760baee7",
"OwnerId": "123456789012",
"PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal",
"PrivateIpAddress": "10.0.0.157",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal",
"PrivateIpAddress": "10.0.0.157"
}
],
"SourceDestCheck": true,
"Status": "in-use",
"SubnetId": "subnet-04a636d18e83cfacb",
"VpcId": "vpc-1234567890abcdef0",
"InterfaceType": "interface"
}
],
"RootDeviceName": "/dev/xvda",
"RootDeviceType": "ebs",
"SecurityGroups": [
{
"GroupName": "MySecurityGroup",
"GroupId": "sg-0598c7d356eba48d7"
}
],
"SourceDestCheck": true,
"StateReason": {
"Code": "pending",
"Message": "pending"
},
"Tags": [],
"VirtualizationType": "hvm",
"CpuOptions": {
"CoreCount": 1,
"ThreadsPerCore": 1
},
"CapacityReservationSpecification": {
"CapacityReservationPreference": "open"
},
"MetadataOptions": {
"State": "pending",
"HttpTokens": "optional",
"HttpPutResponseHopLimit": 1,
"HttpEndpoint": "enabled"
}
}
],
"OwnerId": "123456789012",
"ReservationId": "r-02a3f596d91211712"
}
Example 2: To launch an instance into a non-default subnet and add a public IP address
The following run-instances example requests a public IP address for an instance that you’re launching into a nondefault subnet. The instance is associated with the specified security group.
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--subnet-id subnet-08fc749671b2d077c \
--security-group-ids sg-0b0384b66d7d692f9 \
--associate-public-ip-address \
--key-name MyKeyPair
For an example of the output for run-instances, see Example 1.
Example 3: To launch an instance with additional volumes
The following run-instances example uses a block device mapping, specified in mapping.json, to attach additional volumes at launch. A block device mapping can specify EBS volumes, instance store volumes, or both EBS volumes and instance store volumes.
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--subnet-id subnet-08fc749671b2d077c \
--security-group-ids sg-0b0384b66d7d692f9 \
--key-name MyKeyPair \
--block-device-mappings file://mapping.json
Contents of mapping.json. This example adds /dev/sdh an empty EBS volume with a size of 100 GiB.
[
{
"DeviceName": "/dev/sdh",
"Ebs": {
"VolumeSize": 100
}
}
]
Contents of mapping.json. This example adds ephemeral1 as an instance store volume.
[
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
}
]
For an example of the output for run-instances, see Example 1.
For more information about block device mappings, see Block device mapping in the Amazon EC2 User Guide.
Example 4: To launch an instance and add tags on creation
The following run-instances example adds a tag with a key of webserver and value of production to the instance. The command also applies a tag with a key of cost-center and a value of cc123 to any EBS volume that’s created (in this case, the root volume).
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--count 1 \
--subnet-id subnet-08fc749671b2d077c \
--key-name MyKeyPair \
--security-group-ids sg-0b0384b66d7d692f9 \
--tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]'
For an example of the output for run-instances, see Example 1.
Example 5: To launch an instance with user data
The following run-instances example passes user data in a file called my_script.txt that contains a configuration script for your instance. The script runs at launch.
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--count 1 \
--subnet-id subnet-08fc749671b2d077c \
--key-name MyKeyPair \
--security-group-ids sg-0b0384b66d7d692f9 \
--user-data file://my_script.txt
For an example of the output for run-instances, see Example 1.
For more information about instance user data, see Working with instance user data in the Amazon EC2 User Guide.
Example 6: To launch a burstable performance instance
The following run-instances example launches a t2.micro instance with the unlimited credit option. When you launch a T2 instance, if you do not specify --credit-specification, the default is the standard credit option. When you launch a T3 instance, the default is the unlimited credit option.
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type t2.micro \
--count 1 \
--subnet-id subnet-08fc749671b2d077c \
--key-name MyKeyPair \
--security-group-ids sg-0b0384b66d7d692f9 \
--credit-specification CpuCredits=unlimited
For an example of the output for run-instances, see Example 1.
For more information about burstable performance instances, see Burstable performance instances in the Amazon EC2 User Guide.
Output
ReservationId -> (string)
OwnerId -> (string)
RequesterId -> (string)
Groups -> (list)
Not supported.
(structure)
Describes a security group.
GroupId -> (string)
GroupName -> (string)
Instances -> (list)
The instances.
(structure)
Describes an instance.
Architecture -> (string)
BlockDeviceMappings -> (list)
Any block device mapping entries for the instance.
(structure)
Describes a block device mapping.
DeviceName -> (string)
/dev/sdh or xvdh ).Ebs -> (structure)
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime -> (timestamp)
DeleteOnTermination -> (boolean)
Status -> (string)
VolumeId -> (string)
AssociatedResource -> (string)
VolumeOwnerId -> (string)
The ID of the Amazon Web Services account that owns the volume.
This parameter is returned only for volumes that are attached to Fargate tasks.
Operator -> (structure)
The service provider that manages the EBS volume.
Managed -> (boolean)
true , the resource is managed by a service provider.Principal -> (string)
managed is true , then the principal is returned. The principal is the service provider that manages the resource.ClientToken -> (string)
EbsOptimized -> (boolean)
EnaSupport -> (boolean)
Hypervisor -> (string)
xen is used for both Xen and Nitro hypervisors.IamInstanceProfile -> (structure)
The IAM instance profile associated with the instance, if applicable.
Arn -> (string)
Id -> (string)
InstanceLifecycle -> (string)
ElasticGpuAssociations -> (list)
Deprecated.
Note
Amazon Elastic Graphics reached end of life on January 8, 2024.(structure)
Note
Amazon Elastic Graphics reached end of life on January 8, 2024.Describes the association between an instance and an Elastic Graphics accelerator.
ElasticGpuId -> (string)
ElasticGpuAssociationId -> (string)
ElasticGpuAssociationState -> (string)
ElasticGpuAssociationTime -> (string)
ElasticInferenceAcceleratorAssociations -> (list)
Deprecated
Note
Amazon Elastic Inference is no longer available.(structure)
Note
Amazon Elastic Inference is no longer available.Describes the association between an instance and an elastic inference accelerator.
ElasticInferenceAcceleratorArn -> (string)
ElasticInferenceAcceleratorAssociationId -> (string)
ElasticInferenceAcceleratorAssociationState -> (string)
ElasticInferenceAcceleratorAssociationTime -> (timestamp)
NetworkInterfaces -> (list)
The network interfaces for the instance.
(structure)
Describes a network interface.
Association -> (structure)
The association information for an Elastic IPv4 associated with the network interface.
CarrierIp -> (string)
CustomerOwnedIp -> (string)
IpOwnerId -> (string)
PublicDnsName -> (string)
PublicIp -> (string)
Attachment -> (structure)
The network interface attachment.
AttachTime -> (timestamp)
AttachmentId -> (string)
DeleteOnTermination -> (boolean)
DeviceIndex -> (integer)
Status -> (string)
NetworkCardIndex -> (integer)
EnaSrdSpecification -> (structure)
Contains the ENA Express settings for the network interface that’s attached to the instance.
EnaSrdEnabled -> (boolean)
EnaSrdUdpSpecification -> (structure)
Configures ENA Express for UDP network traffic.
EnaSrdUdpEnabled -> (boolean)
EnaQueueCount -> (integer)
Description -> (string)
Groups -> (list)
The security groups.
(structure)
Describes a security group.
GroupId -> (string)
GroupName -> (string)
Ipv6Addresses -> (list)
The IPv6 addresses associated with the network interface.
(structure)
Describes an IPv6 address.
Ipv6Address -> (string)
IsPrimaryIpv6 -> (boolean)
MacAddress -> (string)
NetworkInterfaceId -> (string)
OwnerId -> (string)
PrivateDnsName -> (string)
PrivateIpAddress -> (string)
PrivateIpAddresses -> (list)
The private IPv4 addresses associated with the network interface.
(structure)
Describes a private IPv4 address.
Association -> (structure)
The association information for an Elastic IP address for the network interface.
CarrierIp -> (string)
CustomerOwnedIp -> (string)
IpOwnerId -> (string)
PublicDnsName -> (string)
PublicIp -> (string)
Primary -> (boolean)
PrivateDnsName -> (string)
PrivateIpAddress -> (string)
SourceDestCheck -> (boolean)
Status -> (string)
SubnetId -> (string)
VpcId -> (string)
InterfaceType -> (string)
The type of network interface.
Valid values: interface | efa | efa-only | trunk
Ipv4Prefixes -> (list)
The IPv4 delegated prefixes that are assigned to the network interface.
(structure)
Information about an IPv4 prefix.
Ipv4Prefix -> (string)
Ipv6Prefixes -> (list)
The IPv6 delegated prefixes that are assigned to the network interface.
(structure)
Information about an IPv6 prefix.
Ipv6Prefix -> (string)
ConnectionTrackingConfiguration -> (structure)
A security group connection tracking configuration that enables you to set the timeout for connection tracking on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon EC2 User Guide .
TcpEstablishedTimeout -> (integer)
UdpStreamTimeout -> (integer)
UdpTimeout -> (integer)
Operator -> (structure)
The service provider that manages the network interface.
Managed -> (boolean)
true , the resource is managed by a service provider.Principal -> (string)
managed is true , then the principal is returned. The principal is the service provider that manages the resource.OutpostArn -> (string)
RootDeviceName -> (string)
/dev/sda1 ).RootDeviceType -> (string)
SecurityGroups -> (list)
The security groups for the instance.
(structure)
Describes a security group.
GroupId -> (string)
GroupName -> (string)
SourceDestCheck -> (boolean)
SpotInstanceRequestId -> (string)
SriovNetSupport -> (string)
StateReason -> (structure)
The reason for the most recent state transition.
Code -> (string)
Message -> (string)
The message for the state change.
-
Server.InsufficientInstanceCapacity: There was insufficient capacity available to satisfy the launch request. -
Server.InternalError: An internal error caused the instance to terminate during launch. -
Server.ScheduledStop: The instance was stopped due to a scheduled retirement. -
Server.SpotInstanceShutdown: The instance was stopped because the number of Spot requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an increase in the Spot price. -
Server.SpotInstanceTermination: The instance was terminated because the number of Spot requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an increase in the Spot price. -
Client.InstanceInitiatedShutdown: The instance was shut down from the operating system of the instance. -
Client.InstanceTerminated: The instance was terminated or rebooted during AMI creation. -
Client.InternalError: A client error caused the instance to terminate during launch. -
Client.InvalidSnapshot.NotFound: The specified snapshot was not found. -
Client.UserInitiatedHibernate: Hibernation was initiated on the instance. -
Client.UserInitiatedShutdown: The instance was shut down using the Amazon EC2 API. -
Client.VolumeLimitExceeded: The limit on the number of EBS volumes or total storage was exceeded. Decrease usage or request an increase in your account limits.
Tags -> (list)
Any tags assigned to the instance.
(structure)
Describes a tag.
Key -> (string)
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value -> (string)
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.
VirtualizationType -> (string)
CpuOptions -> (structure)
The CPU options for the instance.
CoreCount -> (integer)
ThreadsPerCore -> (integer)
AmdSevSnp -> (string)
CapacityReservationId -> (string)
CapacityReservationSpecification -> (structure)
Information about the Capacity Reservation targeting option.
CapacityReservationPreference -> (string)
Describes the instance’s Capacity Reservation preferences. Possible preferences include:
-
open- The instance can run in anyopenCapacity Reservation that has matching attributes (instance type, platform, Availability Zone). -
none- The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
CapacityReservationTarget -> (structure)
Information about the targeted Capacity Reservation or Capacity Reservation group.
CapacityReservationId -> (string)
CapacityReservationResourceGroupArn -> (string)
HibernationOptions -> (structure)
Indicates whether the instance is enabled for hibernation.
Configured -> (boolean)
true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation.Licenses -> (list)
The license configurations for the instance.
(structure)
Describes a license configuration.
LicenseConfigurationArn -> (string)
MetadataOptions -> (structure)
The metadata options for the instance.
State -> (string)
The state of the metadata option changes.
pending - The metadata options are being updated and the instance is not ready to process metadata traffic with the new selection.
applied - The metadata options have been successfully applied on the instance.
HttpTokens -> (string)
Indicates whether IMDSv2 is required.
-
optional- IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1. -
required- IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.
HttpPutResponseHopLimit -> (integer)
The maximum number of hops that the metadata token can travel.
Possible values: Integers from 1 to 64
HttpEndpoint -> (string)
Indicates whether the HTTP metadata endpoint on your instances is enabled or disabled.
If the value is disabled , you cannot access your instance metadata.
HttpProtocolIpv6 -> (string)
Indicates whether the IPv6 endpoint for the instance metadata service is enabled or disabled.
Default: disabled
InstanceMetadataTags -> (string)
EnclaveOptions -> (structure)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
Enabled -> (boolean)
true , the instance is enabled for Amazon Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services Nitro Enclaves.BootMode -> (string)
The boot mode that was specified by the AMI. If the value is uefi-preferred , the AMI supports both UEFI and Legacy BIOS. The currentInstanceBootMode parameter is the boot mode that is used to boot the instance at launch or start.
Note
The operating system contained in the AMI must be configured to support the specified boot mode.For more information, see Boot modes in the Amazon EC2 User Guide .
PlatformDetails -> (string)
UsageOperation -> (string)
UsageOperationUpdateTime -> (timestamp)
PrivateDnsNameOptions -> (structure)
The options for the instance hostname.
HostnameType -> (string)
EnableResourceNameDnsARecord -> (boolean)
EnableResourceNameDnsAAAARecord -> (boolean)
Ipv6Address -> (string)
TpmSupport -> (string)
v2.0 . For more information, see NitroTPM in the Amazon EC2 User Guide .MaintenanceOptions -> (structure)
Provides information on the recovery and maintenance options of your instance.
AutoRecovery -> (string)
RebootMigration -> (string)
Specifies whether to attempt reboot migration during a user-initiated reboot of an instance that has a scheduled system-reboot event:
-
default- Amazon EC2 attempts to migrate the instance to new hardware (reboot migration). If successful, thesystem-rebootevent is cleared. If unsuccessful, an in-place reboot occurs and the event remains scheduled. -
disabled- Amazon EC2 keeps the instance on the same hardware (in-place reboot). Thesystem-rebootevent remains scheduled.
This setting only applies to supported instances that have a scheduled reboot event. For more information, see Enable or disable reboot migration in the Amazon EC2 User Guide .
CurrentInstanceBootMode -> (string)
NetworkPerformanceOptions -> (structure)
Contains settings for the network performance options for your instance.
BandwidthWeighting -> (string)
Operator -> (structure)
The service provider that manages the instance.
Managed -> (boolean)
true , the resource is managed by a service provider.Principal -> (string)
managed is true , then the principal is returned. The principal is the service provider that manages the resource.InstanceId -> (string)
ImageId -> (string)
State -> (structure)
The current state of the instance.
Code -> (integer)
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
-
0:pending -
16:running -
32:shutting-down -
48:terminated -
64:stopping -
80:stopped
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name -> (string)
PrivateDnsName -> (string)
[IPv4 only] The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.
The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you’ve enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.
PublicDnsName -> (string)
running state. This name is only available if you’ve enabled DNS hostnames for your VPC.StateTransitionReason -> (string)
KeyName -> (string)
AmiLaunchIndex -> (integer)
ProductCodes -> (list)
The product codes attached to this instance, if applicable.
(structure)
Describes a product code.
ProductCodeId -> (string)
ProductCodeType -> (string)
InstanceType -> (string)
LaunchTime -> (timestamp)
Placement -> (structure)
The location where the instance launched, if applicable.
Affinity -> (string)
The affinity setting for the instance on the Dedicated Host.
This parameter is not supported for CreateFleet or ImportInstance .
GroupName -> (string)
GroupName , you can’t specify GroupId .PartitionNumber -> (integer)
The number of the partition that the instance is in. Valid only if the placement group strategy is set to partition .
This parameter is not supported for CreateFleet .
HostId -> (string)
The ID of the Dedicated Host on which the instance resides.
This parameter is not supported for CreateFleet or ImportInstance .
Tenancy -> (string)
The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware.
This parameter is not supported for CreateFleet . The host tenancy is not supported for ImportInstance or for T3 instances that are configured for the unlimited CPU credit option.
SpreadDomain -> (string)
HostResourceGroupArn -> (string)
The ARN of the host resource group in which to launch the instances.
If you specify this parameter, either omit the Tenancy parameter or set it to host .
This parameter is not supported for CreateFleet .
GroupId -> (string)
GroupId , you can’t specify GroupName .AvailabilityZone -> (string)
The Availability Zone of the instance.
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 for CreateFleet .
KernelId -> (string)
RamdiskId -> (string)
Platform -> (string)
windows for Windows instances; otherwise, it is empty.Monitoring -> (structure)
The monitoring for the instance.
State -> (string)
SubnetId -> (string)
VpcId -> (string)
PrivateIpAddress -> (string)
PublicIpAddress -> (string)
The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
© Copyright 2025, Amazon Web Services. Created using Sphinx.