Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idaws.ec2.instances

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
ami_launch_indexintegerThe AMI launch index, which can be used to find this instance in the launch group.
architecturestringThe architecture of the image.
block_device_mappingsstringAny block device mapping entries for the instance.
boot_modestringThe 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. 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.
capacity_block_idstringThe ID of the Capacity Block. For P5 instances, a Capacity Block ID refers to a group of instances. For Trn2u instances, a capacity block ID refers to an EC2 UltraServer.
capacity_reservation_idstringThe ID of the Capacity Reservation.
capacity_reservation_specificationstringInformation about the Capacity Reservation targeting option.
client_tokenstringThe idempotency token you provided when you launched the instance, if applicable.
cpu_optionsstringThe CPU options for the instance.
current_instance_boot_modestringThe boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.
ebs_optimizedbooleanIndicates 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 I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
elastic_gpu_associationsstringDeprecated. Amazon Elastic Graphics reached end of life on January 8, 2024.
elastic_inference_accelerator_associationsstringDeprecated Amazon Elastic Inference is no longer available.
ena_supportbooleanSpecifies whether enhanced networking with ENA is enabled.
enclave_optionsstringIndicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
hibernation_optionsstringIndicates whether the instance is enabled for hibernation.
hypervisorstringThe hypervisor type of the instance. The value xen is used for both Xen and Nitro hypervisors.
iam_instance_profilestringThe IAM instance profile associated with the instance, if applicable.
image_idstringThe ID of the AMI used to launch the instance.
instance_idstringThe ID of the instance.
instance_lifecyclestringIndicates whether this is a Spot Instance or a Scheduled Instance.
instance_typestringThe instance type.
ipv_6_addressstringThe IPv6 address assigned to the instance.
kernel_idstringThe kernel associated with this instance, if applicable.
key_namestringThe name of the key pair, if this instance was launched with an associated key pair.
launch_timestringThe time that the instance was last launched. To determine the time that instance was first launched, see the attachment time for the primary network interface.
licensesstringThe license configurations for the instance.
maintenance_optionsstringProvides information on the recovery and maintenance options of your instance.
metadata_optionsstringThe metadata options for the instance.
monitoringstringThe monitoring for the instance.
network_interfacesstringThe network interfaces for the instance.
network_performance_optionsstringContains settings for the network performance options for your instance.
operatorstringThe service provider that manages the instance.
outpost_arnstringThe Amazon Resource Name (ARN) of the Outpost.
placementstringThe location where the instance launched, if applicable.
platformstringThe platform. This value is windows for Windows instances; otherwise, it is empty.
platform_detailsstringThe platform details value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
private_dns_namestring[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.
private_dns_name_optionsstringThe options for the instance hostname.
private_ip_addressstringThe private IPv4 address assigned to the instance.
product_codesstringThe product codes attached to this instance, if applicable.
public_dns_namestringThe public DNS name assigned to the instance. This name is not available until the instance enters the running state. This name is only available if you've enabled DNS hostnames for your VPC. The format of this name depends on the public hostname type.
public_ip_addressstringThe 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.
ramdisk_idstringThe RAM disk associated with this instance, if applicable.
root_device_namestringThe device name of the root device volume (for example, /dev/sda1).
root_device_typestringThe root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
secondary_interfacesstringThe secondary interfaces for the instance.
security_groupsstringThe security groups for the instance.
source_dest_checkbooleanIndicates whether source/destination checking is enabled.
spot_instance_request_idstringIf the request is a Spot Instance request, the ID of the request.
sriov_net_supportstringSpecifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
statestringThe current state of the instance.
state_reasonstringThe reason for the most recent state transition.
state_transition_reasonstringThe reason for the most recent state transition. This might be an empty string.
subnet_idstringThe ID of the subnet in which the instance is running.
tagsstringAny tags assigned to the instance.
tpm_supportstringIf the instance is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.
usage_operationstringThe usage operation value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
usage_operation_update_timestringThe time that the usage operation was last updated.
virtualization_typestringThe virtualization type of the instance.
vpc_idstringThe ID of the VPC in which the instance is running.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_instancesselectregionInstanceId, IncludeManagedResources, DryRun, Filter, NextToken, MaxResultsDescribes the specified instances or all instances. If you specify instance IDs, the output includes information for only the specified instances. If you specify filters, the output includes information for only those instances that meet the filter criteria. If you do not specify instance IDs or filters, the output includes information for all instances, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully. The response includes SQL license exemption status information for instances registered with the SQL LE service, providing visibility into license exemption configuration and status. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the output. Recently terminated instances might appear in the returned results. This interval is usually less than one hour. If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally. The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see Eventual consistency in the Amazon EC2 API in the Amazon EC2 Developer Guide. We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts. The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.
create_delegate_mac_volume_ownership_taskinsertInstanceId, MacCredentials, regionClientToken, DryRun, TagSpecificationDelegates ownership of the Amazon EBS root volume for an Apple silicon Mac instance to an administrative user.
create_mac_system_integrity_protection_modification_taskinsertInstanceId, MacSystemIntegrityProtectionStatus, regionClientToken, DryRun, MacCredentials, MacSystemIntegrityProtectionConfiguration, TagSpecificationCreates a System Integrity Protection (SIP) modification task to configure the SIP settings for an x86 Mac instance or Apple silicon Mac instance. For more information, see Configure SIP for Amazon EC2 instances in the Amazon EC2 User Guide. When you configure the SIP settings for your instance, you can either enable or disable all SIP settings, or you can specify a custom SIP configuration that selectively enables or disables specific SIP settings. If you implement a custom configuration, connect to the instance and verify the settings to ensure that your requirements are properly implemented and functioning as intended. SIP configurations might change with macOS updates. We recommend that you review custom SIP settings after any macOS version upgrade to ensure continued compatibility and proper functionality of your security configurations. To enable or disable all SIP settings, use the MacSystemIntegrityProtectionStatus parameter only. For example, to enable all SIP settings, specify the following: MacSystemIntegrityProtectionStatus=enabled To specify a custom configuration that selectively enables or disables specific SIP settings, use the MacSystemIntegrityProtectionStatus parameter to enable or disable all SIP settings, and then use the MacSystemIntegrityProtectionConfiguration parameter to specify exceptions. In this case, the exceptions you specify for MacSystemIntegrityProtectionConfiguration override the value you specify for MacSystemIntegrityProtectionStatus. For example, to enable all SIP settings, except NvramProtections, specify the following: MacSystemIntegrityProtectionStatus=enabled MacSystemIntegrityProtectionConfigurationRequest "NvramProtections=disabled"
run_instancesinsertMaxCount, MinCount, regionBlockDeviceMapping, ImageId, InstanceType, Ipv6AddressCount, Ipv6Address, KernelId, KeyName, Monitoring, Placement, RamdiskId, SecurityGroupId, SecurityGroup, SubnetId, UserData, ElasticGpuSpecification, ElasticInferenceAccelerator, TagSpecification, LaunchTemplate, InstanceMarketOptions, CreditSpecification, CpuOptions, CapacityReservationSpecification, HibernationOptions, LicenseSpecification, MetadataOptions, EnclaveOptions, PrivateDnsNameOptions, MaintenanceOptions, DisableApiStop, EnablePrimaryIpv6, NetworkPerformanceOptions, Operator, SecondaryInterface, DryRun, DisableApiTermination, InstanceInitiatedShutdownBehavior, PrivateIpAddress, ClientToken, AdditionalInfo, NetworkInterface, IamInstanceProfile, EbsOptimizedLaunches 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.
modify_instance_event_start_timeupdateInstanceId, InstanceEventId, NotBefore, regionDryRunModifies the start time for a scheduled Amazon EC2 instance event.
modify_instance_capacity_reservation_attributesupdateInstanceId, CapacityReservationSpecification, regionDryRunModifies the Capacity Reservation settings for a stopped instance. Use this action to configure an instance to target a specific Capacity Reservation, run in any open Capacity Reservation with matching attributes, run in On-Demand Instance capacity, or only run in a Capacity Reservation.
modify_instance_network_performance_optionsupdateInstanceId, BandwidthWeighting, regionDryRunChange the configuration of the network performance options for an existing instance.
modify_instance_cpu_optionsupdateInstanceId, regionCoreCount, ThreadsPerCore, NestedVirtualization, DryRunBy default, all vCPUs for the instance type are active when you launch an instance. When you configure the number of active vCPUs for the instance, it can help you save on licensing costs and optimize performance. The base cost of the instance remains unchanged. The number of active vCPUs equals the number of threads per CPU core multiplied by the number of cores. The instance must be in a Stopped state before you make changes. Some instance type options do not support this capability. For more information, see Supported CPU options in the Amazon EC2 User Guide.
terminate_instancesdeleteInstanceId, regionForce, SkipOsShutdown, DryRunTerminates (deletes) the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds. Terminating an instance is permanent and irreversible. After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see How instance termination works. Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage. If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated. If you terminate multiple instances across multiple Availability Zones, and one or more of the specified instances are enabled for termination protection, the request fails with the following results: The specified instances that are in the same Availability Zone as the protected instance are not terminated. The specified instances that are in different Availability Zones, where no other specified instances are protected, are successfully terminated. For example, say you have the following instances: Instance A: us-east-1a; Not protected Instance B: us-east-1a; Not protected Instance C: us-east-1b; Protected Instance D: us-east-1b; not protected If you attempt to terminate all of these instances in the same request, the request reports failure with the following results: Instance A and Instance B are successfully terminated because none of the specified instances in us-east-1a are enabled for termination protection. Instance C and Instance D fail to terminate because at least one of the specified instances in us-east-1b (Instance C) is enabled for termination protection. Terminated instances remain visible after termination (for approximately one hour). By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running. By default, the TerminateInstances operation includes a graceful operating system (OS) shutdown. To bypass the graceful shutdown, use the skipOsShutdown parameter; however, this might risk data integrity. You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Amazon EC2 instance state changes in the Amazon EC2 User Guide. When you terminate an instance, we attempt to terminate it forcibly after a short while. If your instance appears stuck in the shutting-down state after a period of time, there might be an issue with the underlying host computer. For more information about terminating and troubleshooting terminating your instances, see Terminate Amazon EC2 instances and Troubleshooting terminating your instance in the Amazon EC2 User Guide.
bundle_instanceexecInstanceId, regionStorage, DryRunBundles an Amazon instance store-backed Windows instance. During bundling, only the root device volume (C:) is bundled. Data on other instance store volumes is not preserved. BundleInstance is no longer supported. To create an AMI, use CreateImage instead. For more information about creating an Amazon EBS-backed AMI, see Create an Amazon EBS-backed AMI in the Amazon EC2 User Guide.
confirm_product_instanceexecInstanceId, ProductCode, regionDryRunDetermines whether a product code is associated with an instance. This action can only be used by the owner of the product code. It is useful when a product code owner must verify whether another user's instance is eligible for support.
disable_instance_sql_ha_standby_detectionsexecInstanceId, regionDryRunDisable Amazon EC2 instances running in an SQL Server High Availability cluster from SQL Server High Availability instance standby detection monitoring. Once disabled, Amazon Web Services no longer monitors the metadata for the instances to determine whether they are active or standby nodes in the SQL Server High Availability cluster.
enable_instance_sql_ha_standby_detectionsexecInstanceId, regionSqlServerCredentials, DryRunEnable Amazon EC2 instances running in an SQL Server High Availability cluster for SQL Server High Availability instance standby detection monitoring. Once enabled, Amazon Web Services monitors the metadata for the instances to determine whether they are active or standby nodes in the SQL Server High Availability cluster. If the instances are determined to be standby failover nodes, Amazon Web Services automatically applies SQL Server licensing fee waiver for those instances. To register an instance, it must be running a Windows SQL Server license-included AMI and have the Amazon Web Services Systems Manager agent installed and running. Only Windows Server 2019 and later and SQL Server (Standard and Enterprise editions) 2017 and later are supported. For more information, see Prerequisites for using SQL Server High Availability instance standby detection.
modify_instance_maintenance_optionsexecInstanceId, regionAutoRecovery, RebootMigration, DryRunModifies the recovery behavior of your instance to disable simplified automatic recovery or set the recovery behavior to default. The default configuration will not enable simplified automatic recovery for an unsupported instance type. For more information, see Simplified automatic recovery. Modifies the reboot migration behavior during a user-initiated reboot of an instance that has a pending system-reboot event. For more information, see Enable or disable reboot migration.
modify_instance_metadata_optionsexecInstanceId, regionHttpTokens, HttpPutResponseHopLimit, HttpEndpoint, DryRun, HttpProtocolIpv6, InstanceMetadataTagsModify the instance metadata parameters on a running or stopped instance. When you modify the parameters on a stopped instance, they are applied when the instance is started. When you modify the parameters on a running instance, the API responds with a state of “pending”. After the parameter modifications are successfully applied to the instance, the state of the modifications changes from “pending” to “applied” in subsequent describe-instances API calls. For more information, see Instance metadata and user data in the Amazon EC2 User Guide.
modify_instance_placementexecInstanceId, regionGroupName, PartitionNumber, HostResourceGroupArn, GroupId, Tenancy, Affinity, HostIdModifies the placement attributes for a specified instance. You can do the following: Modify the affinity between an instance and a Dedicated Host. When affinity is set to host and the instance is not associated with a specific Dedicated Host, the next time the instance is started, it is automatically associated with the host on which it lands. If the instance is restarted or rebooted, this relationship persists. Change the Dedicated Host with which an instance is associated. Change the instance tenancy of an instance. Move an instance to or from a placement group. At least one attribute for affinity, host ID, tenancy, or placement group name must be specified in the request. Affinity and tenancy can be modified in the same request. To modify the host ID, tenancy, placement group, or partition for an instance, the instance must be in the stopped state.
modify_private_dns_name_optionsexecInstanceId, regionDryRun, PrivateDnsHostnameType, EnableResourceNameDnsARecord, EnableResourceNameDnsAAAARecordModifies the options for instance hostnames for the specified instance.
monitor_instancesexecInstanceId, regionDryRunEnables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitor your instances using CloudWatch in the Amazon EC2 User Guide. To disable detailed monitoring, see UnmonitorInstances.
move_capacity_reservation_instancesexecSourceCapacityReservationId, DestinationCapacityReservationId, InstanceCount, regionDryRun, ClientTokenMove available capacity from a source Capacity Reservation to a destination Capacity Reservation. The source Capacity Reservation and the destination Capacity Reservation must be active, owned by your Amazon Web Services account, and share the following: Instance type Platform Availability Zone Tenancy Placement group Capacity Reservation end time - At specific time or Manually.
reboot_instancesexecInstanceId, regionDryRunRequests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored. If an instance does not cleanly shut down within a few minutes, Amazon EC2 performs a hard reboot. For more information about troubleshooting, see Troubleshoot an unreachable instance in the Amazon EC2 User Guide.
request_spot_instancesexecregionLaunchSpecification, TagSpecification, InstanceInterruptionBehavior, DryRun, SpotPrice, ClientToken, InstanceCount, Type, ValidFrom, ValidUntil, LaunchGroup, AvailabilityZoneGroup, BlockDurationMinutesCreates a Spot Instance request. For more information, see Work with Spot Instance in the Amazon EC2 User Guide. We strongly discourage using the RequestSpotInstances API because it is a legacy API with no planned investment. For options for requesting Spot Instances, see Which is the best Spot request method to use? in the Amazon EC2 User Guide.
reset_instance_attributeexecInstanceId, Attribute, regionDryRunResets an attribute of an instance to its default value. To reset the kernel or ramdisk, the instance must be in a stopped state. To reset the sourceDestCheck, the instance can be either running or stopped. The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true, which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT instances in the Amazon VPC User Guide.
send_diagnostic_interruptexecInstanceId, regionDryRunSends a diagnostic interrupt to the specified Amazon EC2 instance to trigger a kernel panic (on Linux instances), or a blue screen/stop error (on Windows instances). For instances based on Intel and AMD processors, the interrupt is received as a non-maskable interrupt (NMI). In general, the operating system crashes and reboots when a kernel panic or stop error is triggered. The operating system can also be configured to perform diagnostic tasks, such as generating a memory dump file, loading a secondary kernel, or obtaining a call trace. Before sending a diagnostic interrupt to your instance, ensure that its operating system is configured to perform the required diagnostic tasks. For more information about configuring your operating system to generate a crash dump when a kernel panic or stop error occurs, see Send a diagnostic interrupt (for advanced users) in the Amazon EC2 User Guide.
start_instancesexecInstanceId, regionAdditionalInfo, DryRunStarts an Amazon EBS-backed instance that you've previously stopped. Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage. Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM. Performing this operation on an instance that uses an instance store as its root device returns an error. If you attempt to start a T3 instance with host tenancy and the unlimited CPU credit option, the request fails. The unlimited CPU credit option is not supported on Dedicated Hosts. Before you start the instance, either change its CPU credit option to standard, or change its tenancy to default or dedicated. For more information, see Stop and start Amazon EC2 instances in the Amazon EC2 User Guide.
stop_instancesexecInstanceId, regionHibernate, SkipOsShutdown, DryRun, ForceStops an Amazon EBS-backed instance. You can restart your instance at any time using the StartInstances API. For more information, see Stop and start Amazon EC2 instances in the Amazon EC2 User Guide. When you stop or hibernate an instance, we shut it down. By default, this includes a graceful operating system (OS) shutdown. To bypass the graceful shutdown, use the skipOsShutdown parameter; however, this might risk data integrity. You can use the StopInstances operation together with the Hibernate parameter to hibernate an instance if the instance is enabled for hibernation and meets the hibernation prerequisites. Stopping an instance doesn't preserve data stored in RAM, while hibernation does. If hibernation fails, a normal shutdown occurs. For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide. If your instance appears stuck in the stopping state, there might be an issue with the underlying host computer. You can use the StopInstances operation together with the Force parameter to force stop your instance. For more information, see Troubleshoot Amazon EC2 instance stop issues in the Amazon EC2 User Guide. Stopping and hibernating an instance differs from rebooting or terminating it. For example, a stopped or hibernated instance retains its root volume and any data volumes, unlike terminated instances where these volumes are automatically deleted. For more information about the differences between stopping, hibernating, rebooting, and terminating instances, see Amazon EC2 instance state changes in the Amazon EC2 User Guide. We don't charge for instance usage or data transfer fees when an instance is stopped. However, the root volume and any data volumes remain and continue to persist your data, and you're charged for volume usage. Every time you start your instance, Amazon EC2 charges a one-minute minimum for instance usage, followed by per-second billing. You can't stop or hibernate instance store-backed instances.
unmonitor_instancesexecInstanceId, regionDryRunDisables detailed monitoring for a running instance. For more information, see Monitoring your instances and volumes in the Amazon EC2 User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
AttributestringThe attribute to reset. You can only reset the following attributes: kernel | ramdisk | sourceDestCheck.
BandwidthWeightingstringSpecify the bandwidth weighting option to boost the associated type of baseline bandwidth, as follows: default This option uses the standard bandwidth configuration for your instance type. vpc-1 This option boosts your networking baseline bandwidth and reduces your EBS baseline bandwidth. ebs-1 This option boosts your EBS baseline bandwidth and reduces your networking baseline bandwidth.
CapacityReservationSpecificationobjectInformation about the Capacity Reservation targeting option.
DestinationCapacityReservationIdstringThe ID of the Capacity Reservation that you want to move capacity into.
InstanceCountintegerThe number of instances that you want to move from the source Capacity Reservation.
InstanceEventIdstringThe ID of the event whose date and time you are modifying.
InstanceIdarrayThe IDs of the instances.
MacCredentialsstringSpecifies the following credentials: Internal disk administrative user Username - Only the default administrative user (aws-managed-user) is supported and it is used by default. You can't specify a different administrative user. Password - If you did not change the default password for aws-managed-user, specify the default password, which is blank. Otherwise, specify your password. Amazon EBS root volume administrative user Username - If you did not change the default administrative user, specify ec2-user. Otherwise, specify the username for your administrative user. Password - Specify the password for the administrative user. The credentials must be specified in the following JSON format: { "internalDiskPassword":"internal-disk-admin_password", "rootVolumeUsername":"root-volume-admin_username", "rootVolumepassword":"root-volume-admin_password" }
MacSystemIntegrityProtectionStatusstringSpecifies the overall SIP status for the instance. To enable all SIP settings, specify enabled. To disable all SIP settings, specify disabled.
MaxCountintegerThe maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count. Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see Amazon EC2 instance type quotas.
MinCountintegerThe minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances. Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see Amazon EC2 instance type quotas.
NotBeforestring (date-time)The new date and time when the event will take place.
ProductCodestringThe product code. This must be a product code that you own.
SourceCapacityReservationIdstringThe ID of the Capacity Reservation from which you want to move capacity.
regionstringAWS region (default: us-east-1)
AdditionalInfostringReserved.
AffinitystringThe affinity setting for the instance. For more information, see Host affinity in the Amazon EC2 User Guide.
AutoRecoverystringDisables the automatic recovery behavior of your instance or sets it to default.
AvailabilityZoneGroupstringThe user-specified name for a logical grouping of requests. When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active. If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group. Default: Instances are launched in any available Availability Zone.
BlockDeviceMappingarrayThe 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.
BlockDurationMinutesintegerDeprecated.
CapacityReservationSpecificationobjectInformation 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).
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency in Amazon EC2 API requests in the Amazon EC2 User Guide.
CoreCountintegerThe number of CPU cores to activate for the specified instance.
CpuOptionsobjectThe CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
CreditSpecificationobjectThe 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.
DisableApiStopbooleanIndicates whether an instance is enabled for stop protection. For more information, see Enable stop protection for your EC2 instances.
DisableApiTerminationbooleanIndicates whether termination protection is enabled for the instance. 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.
DryRunbooleanChecks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
EbsOptimizedbooleanIndicates 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
ElasticGpuSpecificationarrayAn elastic GPU to associate with the instance. Amazon Elastic Graphics reached end of life on January 8, 2024.
ElasticInferenceAcceleratorarrayAn elastic inference accelerator to associate with the instance. Amazon Elastic Inference is no longer available.
EnablePrimaryIpv6booleanIf you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.
EnableResourceNameDnsAAAARecordbooleanIndicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
EnableResourceNameDnsARecordbooleanIndicates whether to respond to DNS queries for instance hostnames with DNS A records.
EnclaveOptionsobjectIndicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see Amazon Web Services Nitro Enclaves User Guide. You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
FilterarrayThe filters. affinity - The affinity setting for an instance running on a Dedicated Host (default | host). architecture - The instance architecture (i386 | x86_64 | arm64). availability-zone - The Availability Zone of the instance. availability-zone-id - The ID of the Availability Zone of the instance. block-device-mapping.attach-time - The attach time for an EBS volume mapped to the instance, for example, 2022-09-15T17:15:20.000Z. block-device-mapping.delete-on-termination - A Boolean that indicates whether the EBS volume is deleted on instance termination. block-device-mapping.device-name - The device name specified in the block device mapping (for example, /dev/sdh or xvdh). block-device-mapping.status - The status for the EBS volume (attaching | attached | detaching | detached). block-device-mapping.volume-id - The volume ID of the EBS volume. boot-mode - The boot mode that was specified by the AMI (legacy-bios | uefi | uefi-preferred). capacity-reservation-id - The ID of the Capacity Reservation into which the instance was launched. capacity-reservation-specification.capacity-reservation-preference - The instance's Capacity Reservation preference (open | none). capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id - The ID of the targeted Capacity Reservation. capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn - The ARN of the targeted Capacity Reservation group. client-token - The idempotency token you provided when you launched the instance. current-instance-boot-mode - The boot mode that is used to launch the instance at launch or start (legacy-bios | uefi). dns-name - The public DNS name of the instance. ebs-optimized - A Boolean that indicates whether the instance is optimized for Amazon EBS I/O. ena-support - A Boolean that indicates whether the instance is enabled for enhanced networking with ENA. enclave-options.enabled - A Boolean that indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. hibernation-options.configured - A Boolean that indicates whether the instance is enabled for hibernation. A value of true means that the instance is enabled for hibernation. host-id - The ID of the Dedicated Host on which the instance is running, if applicable. hypervisor - The hypervisor type of the instance (ovm | xen). The value xen is used for both Xen and Nitro hypervisors. iam-instance-profile.arn - The instance profile associated with the instance. Specified as an ARN. iam-instance-profile.id - The instance profile associated with the instance. Specified as an ID. image-id - The ID of the image used to launch the instance. instance-id - The ID of the instance. instance-lifecycle - Indicates whether this is a Spot Instance, a Scheduled Instance, or a Capacity Block (spot | scheduled | capacity-block). instance-state-code - The state of the instance, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state represented. The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped). instance-state-name - The state of the instance (pending | running | shutting-down | terminated | stopping | stopped). instance-type - The type of instance (for example, t2.micro). instance.group-id - The ID of the security group for the instance. instance.group-name - The name of the security group for the instance. ip-address - The public IPv4 address of the instance. ipv6-address - The IPv6 address of the instance. kernel-id - The kernel ID. key-name - The name of the key pair used when the instance was launched. launch-index - When launching multiple instances, this is the index for the instance in the launch group (for example, 0, 1, 2, and so on). launch-time - The time when the instance was launched, in the ISO 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, 2021-09-29T11:04:43.305Z. You can use a wildcard (), for example, 2021-09-29T, which matches an entire day. maintenance-options.auto-recovery - The current automatic recovery behavior of the instance (disabled | default). metadata-options.http-endpoint - The status of access to the HTTP metadata endpoint on your instance (enabled | disabled) metadata-options.http-protocol-ipv4 - Indicates whether the IPv4 endpoint is enabled (disabled | enabled). metadata-options.http-protocol-ipv6 - Indicates whether the IPv6 endpoint is enabled (disabled | enabled). metadata-options.http-put-response-hop-limit - The HTTP metadata request put response hop limit (integer, possible values 1 to 64) metadata-options.http-tokens - The metadata request authorization state (optional | required) metadata-options.instance-metadata-tags - The status of access to instance tags from the instance metadata (enabled | disabled) metadata-options.state - The state of the metadata option changes (pending | applied). monitoring-state - Indicates whether detailed monitoring is enabled (disabled | enabled). network-interface.addresses.association.allocation-id - The allocation ID. network-interface.addresses.association.association-id - The association ID. network-interface.addresses.association.carrier-ip - The carrier IP address. network-interface.addresses.association.customer-owned-ip - The customer-owned IP address. network-interface.addresses.association.ip-owner-id - The owner ID of the private IPv4 address associated with the network interface. network-interface.addresses.association.public-dns-name - The public DNS name. network-interface.addresses.association.public-ip - The ID of the association of an Elastic IP address (IPv4) with a network interface. network-interface.addresses.primary - Specifies whether the IPv4 address of the network interface is the primary private IPv4 address. network-interface.addresses.private-dns-name - The private DNS name. network-interface.addresses.private-ip-address - The private IPv4 address associated with the network interface. network-interface.association.allocation-id - The allocation ID returned when you allocated the Elastic IP address (IPv4) for your network interface. network-interface.association.association-id - The association ID returned when the network interface was associated with an IPv4 address. network-interface.association.carrier-ip - The customer-owned IP address. network-interface.association.customer-owned-ip - The customer-owned IP address. network-interface.association.ip-owner-id - The owner of the Elastic IP address (IPv4) associated with the network interface. network-interface.association.public-dns-name - The public DNS name. network-interface.association.public-ip - The address of the Elastic IP address (IPv4) bound to the network interface. network-interface.attachment.attach-time - The time that the network interface was attached to an instance. network-interface.attachment.attachment-id - The ID of the interface attachment. network-interface.attachment.delete-on-termination - Specifies whether the attachment is deleted when an instance is terminated. network-interface.attachment.device-index - The device index to which the network interface is attached. network-interface.attachment.instance-id - The ID of the instance to which the network interface is attached. network-interface.attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached. network-interface.attachment.network-card-index - The index of the network card. network-interface.attachment.status - The status of the attachment (attaching | attached | detaching | detached). network-interface.availability-zone - The Availability Zone for the network interface. network-interface.deny-all-igw-traffic - A Boolean that indicates whether a network interface with an IPv6 address is unreachable from the public internet. network-interface.description - The description of the network interface. network-interface.group-id - The ID of a security group associated with the network interface. network-interface.group-name - The name of a security group associated with the network interface. network-interface.ipv4-prefixes.ipv4-prefix - The IPv4 prefixes that are assigned to the network interface. network-interface.ipv6-address - The IPv6 address associated with the network interface. network-interface.ipv6-addresses.ipv6-address - The IPv6 address associated with the network interface. network-interface.ipv6-addresses.is-primary-ipv6 - A Boolean that indicates whether this is the primary IPv6 address. network-interface.ipv6-native - A Boolean that indicates whether this is an IPv6 only network interface. network-interface.ipv6-prefixes.ipv6-prefix - The IPv6 prefix assigned to the network interface. network-interface.mac-address - The MAC address of the network interface. network-interface.network-interface-id - The ID of the network interface. network-interface.operator.managed - A Boolean that indicates whether the instance has a managed network interface. network-interface.operator.principal - The principal that manages the network interface. Only valid for instances with managed network interfaces, where managed is true. network-interface.outpost-arn - The ARN of the Outpost. network-interface.owner-id - The ID of the owner of the network interface. network-interface.private-dns-name - The private DNS name of the network interface. network-interface.private-ip-address - The private IPv4 address. network-interface.public-dns-name - The public DNS name. network-interface.requester-id - The requester ID for the network interface. network-interface.requester-managed - Indicates whether the network interface is being managed by Amazon Web Services. network-interface.status - The status of the network interface (available) | in-use). network-interface.source-dest-check - Whether the network interface performs source/destination checking. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the network interface to perform network address translation (NAT) in your VPC. network-interface.subnet-id - The ID of the subnet for the network interface. network-interface.tag-key - The key of a tag assigned to the network interface. network-interface.tag-value - The value of a tag assigned to the network interface. network-interface.vpc-id - The ID of the VPC for the network interface. network-performance-options.bandwidth-weighting - Where the performance boost is applied, if applicable. Valid values: default, vpc-1, ebs-1. operator.managed - A Boolean that indicates whether this is a managed instance. operator.principal - The principal that manages the instance. Only valid for managed instances, where managed is true. outpost-arn - The Amazon Resource Name (ARN) of the Outpost. owner-id - The Amazon Web Services account ID of the instance owner. placement-group-name - The name of the placement group for the instance. placement-partition-number - The partition in which the instance is located. platform - The platform. To list only Windows instances, use windows. platform-details - The platform (Linux/UNIX | Red Hat BYOL Linux | Red Hat Enterprise Linux | Red Hat Enterprise Linux with HA | Red Hat Enterprise Linux with High Availability | Red Hat Enterprise Linux with SQL Server Standard and HA | Red Hat Enterprise Linux with SQL Server Enterprise and HA | Red Hat Enterprise Linux with SQL Server Standard | Red Hat Enterprise Linux with SQL Server Web | Red Hat Enterprise Linux with SQL Server Enterprise | SQL Server Enterprise | SQL Server Standard | SQL Server Web | SUSE Linux | Ubuntu Pro | Windows | Windows BYOL | Windows with SQL Server Enterprise | Windows with SQL Server Standard | Windows with SQL Server Web). private-dns-name - The private IPv4 DNS name of the instance. private-dns-name-options.enable-resource-name-dns-a-record - A Boolean that indicates whether to respond to DNS queries for instance hostnames with DNS A records. private-dns-name-options.enable-resource-name-dns-aaaa-record - A Boolean that indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. private-dns-name-options.hostname-type - The type of hostname (ip-name | resource-name). private-ip-address - The private IPv4 address of the instance. This can only be used to filter by the primary IP address of the network interface attached to the instance. To filter by additional IP addresses assigned to the network interface, use the filter network-interface.addresses.private-ip-address. product-code - The product code associated with the AMI used to launch the instance. product-code.type - The type of product code (devpay | marketplace). ramdisk-id - The RAM disk ID. reason - The reason for the current state of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter. requester-id - The ID of the entity that launched the instance on your behalf (for example, Amazon Web Services Management Console, Auto Scaling, and so on). reservation-id - The ID of the instance's reservation. A reservation ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request. For example, if you launch one instance, you get one reservation ID. If you launch ten instances using the same launch request, you also get one reservation ID. root-device-name - The device name of the root device volume (for example, /dev/sda1). root-device-type - The type of the root device volume (ebs | instance-store). source-dest-check - Indicates whether the instance performs source/destination checking. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform network address translation (NAT) in your VPC. spot-instance-request-id - The ID of the Spot Instance request. state-reason-code - The reason code for the state change. state-reason-message - A message that describes the state change. subnet-id - The ID of the subnet for the instance. tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value. tenancy - The tenancy of an instance (dedicated | default | host). tpm-support - Indicates if the instance is configured for NitroTPM support (v2.0). usage-operation - The usage operation value for the instance (RunInstances | RunInstances:00g0 | RunInstances:0010 | RunInstances:1010 | RunInstances:1014 | RunInstances:1110 | RunInstances:0014 | RunInstances:0210 | RunInstances:0110 | RunInstances:0100 | RunInstances:0004 | RunInstances:0200 | RunInstances:000g | RunInstances:0g00 | RunInstances:0002 | RunInstances:0800 | RunInstances:0102 | RunInstances:0006 | RunInstances:0202). usage-operation-update-time - The time that the usage operation was last updated, for example, 2022-09-15T17:15:20.000Z. virtualization-type - The virtualization type of the instance (paravirtual | hvm). vpc-id - The ID of the VPC that the instance is running in.
ForcebooleanForces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata. After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see Troubleshoot Amazon EC2 instance stop issues in the Amazon EC2 User Guide. Default: false
GroupIdstringThe Group Id of a placement group. You must specify the Placement Group Group Id to launch an instance in a shared placement group.
GroupNamestringThe name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of default. For cluster and partition placement groups, the instance must have a tenancy of default or dedicated. To remove an instance from a placement group, specify an empty string ("").
HibernatebooleanHibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide. Default: false
HibernationOptionsobjectIndicates 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.
HostIdstringThe ID of the Dedicated Host with which to associate the instance.
HostResourceGroupArnstringThe ARN of the host resource group in which to place the instance. The instance must have a tenancy of host to specify this parameter.
HttpEndpointstringEnables or disables the HTTP metadata endpoint on your instances. If this parameter is not specified, the existing state is maintained. If you specify a value of disabled, you cannot access your instance metadata.
HttpProtocolIpv6stringEnables or disables the IPv6 endpoint for the instance metadata service. Applies only if you enabled the HTTP metadata endpoint.
HttpPutResponseHopLimitintegerThe desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. If no parameter is specified, the existing state is maintained. Possible values: Integers from 1 to 64
HttpTokensstringIndicates whether IMDSv2 is required. optional - IMDSv2 is optional. You can choose whether to send a session token in your instance metadata retrieval requests. If you retrieve IAM role credentials without a session token, you receive the IMDSv1 role credentials. If you retrieve IAM role credentials using a valid session token, you receive the IMDSv2 role credentials. required - IMDSv2 is required. You must send a session token in your instance metadata retrieval requests. With this option, retrieving the IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available. Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference, the default is required. If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0, but the account level default is set to V1 or V2, the default is optional. 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.
IamInstanceProfileobjectThe name or Amazon Resource Name (ARN) of an IAM instance profile.
ImageIdstringThe ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.
IncludeManagedResourcesbooleanIndicates whether to include managed resources in the output. If this parameter is set to true, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.
InstanceCountintegerThe maximum number of Spot Instances to launch. Default: 1
InstanceIdarrayThe instance IDs. Default: Describes all your instances.
InstanceInitiatedShutdownBehaviorstringIndicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown). Default: stop
InstanceInterruptionBehaviorstringThe behavior when a Spot Instance is interrupted. The default is terminate.
InstanceMarketOptionsobjectThe market (purchasing) option for the instances. For RunInstances, persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop.
InstanceMetadataTagsstringSet 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 View tags for your EC2 instances using instance metadata.
InstanceTypestringThe instance type. For more information, see Amazon EC2 Instance Types Guide.
Ipv6AddressarrayThe 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.
Ipv6AddressCountintegerThe 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.
KernelIdstringThe ID of the kernel. 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.
KeyNamestringThe name of the key pair. For more information, see Create a key pair for your EC2 instance. 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.
LaunchGroupstringThe instance launch group. Launch groups are Spot Instances that launch together and terminate together. Default: Instances are launched and terminated individually
LaunchSpecificationobjectThe launch specification.
LaunchTemplateobjectThe launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.
LicenseSpecificationarrayThe license configurations.
MacCredentialsstring[Apple silicon Mac instances only] Specifies the following credentials: Internal disk administrative user Username - Only the default administrative user (aws-managed-user) is supported and it is used by default. You can't specify a different administrative user. Password - If you did not change the default password for aws-managed-user, specify the default password, which is blank. Otherwise, specify your password. Amazon EBS root volume administrative user Username - If you did not change the default administrative user, specify ec2-user. Otherwise, specify the username for your administrative user. Password - Specify the password for the administrative user. The credentials must be specified in the following JSON format: { "internalDiskPassword":"internal-disk-admin_password", "rootVolumeUsername":"root-volume-admin_username", "rootVolumepassword":"root-volume-admin_password" }
MacSystemIntegrityProtectionConfigurationobjectSpecifies the overrides to selectively enable or disable individual SIP settings. The individual settings you specify here override the overall SIP status you specify for MacSystemIntegrityProtectionStatus.
MaintenanceOptionsobjectThe maintenance and recovery options for the instance.
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. You cannot specify this parameter and the instance IDs parameter in the same request.
MetadataOptionsobjectThe metadata options for the instance. For more information, see Configure the Instance Metadata Service options.
MonitoringobjectSpecifies whether detailed monitoring is enabled for the instance.
NestedVirtualizationstringIndicates whether to enable or disable nested virtualization for the instance. When nested virtualization is enabled, Virtual Secure Mode (VSM) is automatically disabled for the instance.
NetworkInterfacearrayThe network interfaces to associate with the instance.
NetworkPerformanceOptionsobjectContains settings for the network performance options for the instance.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
OperatorobjectReserved for internal use.
PartitionNumberintegerThe number of the partition in which to place the instance. Valid only if the placement group strategy is set to partition.
PlacementobjectThe placement for the instance.
PrivateDnsHostnameTypestringThe type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID.
PrivateDnsNameOptionsobjectThe 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.
PrivateIpAddressstringThe 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.
RamdiskIdstringThe 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. 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.
RebootMigrationstringSpecifies 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, the system-reboot event 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). The system-reboot event 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.
SecondaryInterfacearrayThe secondary interfaces to associate with the instance.
SecurityGrouparray[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.
SecurityGroupIdarrayThe IDs 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.
SkipOsShutdownbooleanSpecifies whether to bypass the graceful OS shutdown process when the instance is stopped. Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts. Default: false
SpotPricestringThe maximum price per unit hour that you are 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. If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
SqlServerCredentialsstringThe ARN of the Secrets Manager secret containing the SQL Server access credentials. The specified secret must contain valid SQL Server credentials for the specified instances. If not specified, deafult local user credentials will be used by the Amazon Web Services Systems Manager agent. To enable instances with different credentials, you must make separate requests.
StorageobjectThe bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
SubnetIdstringThe 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.
TagSpecificationarrayThe key-value pair for tagging the Spot Instance request on creation. The value for ResourceType must be spot-instances-request, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.
TenancystringThe tenancy for the instance. For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of host. You can't change the tenancy from host to dedicated or default. Attempting to make one of these unsupported tenancy changes results in an InvalidRequest error code.
ThreadsPerCoreintegerThe number of threads to run for each CPU core.
TypestringThe Spot Instance request type. Default: one-time
UserDatastringThe user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see Run commands at launch using instance user data.
ValidFromstring (date-time)The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled. The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
ValidUntilstring (date-time)The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it. For a one-time request, the request remains active until all instances launch, the request is canceled, or the ValidUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

SELECT examples

Describes the specified instances or all instances. If you specify instance IDs, the output includes information for only the specified instances. If you specify filters, the output includes information for only those instances that meet the filter criteria. If you do not specify instance IDs or filters, the output includes information for all instances, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully. The response includes SQL license exemption status information for instances registered with the SQL LE service, providing visibility into license exemption configuration and status. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the output. Recently terminated instances might appear in the returned results. This interval is usually less than one hour. If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally. The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see Eventual consistency in the Amazon EC2 API in the Amazon EC2 Developer Guide. We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts. The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

SELECT
ami_launch_index,
architecture,
block_device_mappings,
boot_mode,
capacity_block_id,
capacity_reservation_id,
capacity_reservation_specification,
client_token,
cpu_options,
current_instance_boot_mode,
ebs_optimized,
elastic_gpu_associations,
elastic_inference_accelerator_associations,
ena_support,
enclave_options,
hibernation_options,
hypervisor,
iam_instance_profile,
image_id,
instance_id,
instance_lifecycle,
instance_type,
ipv_6_address,
kernel_id,
key_name,
launch_time,
licenses,
maintenance_options,
metadata_options,
monitoring,
network_interfaces,
network_performance_options,
operator,
outpost_arn,
placement,
platform,
platform_details,
private_dns_name,
private_dns_name_options,
private_ip_address,
product_codes,
public_dns_name,
public_ip_address,
ramdisk_id,
root_device_name,
root_device_type,
secondary_interfaces,
security_groups,
source_dest_check,
spot_instance_request_id,
sriov_net_support,
state,
state_reason,
state_transition_reason,
subnet_id,
tags,
tpm_support,
usage_operation,
usage_operation_update_time,
virtualization_type,
vpc_id
FROM aws.ec2.instances
WHERE region = '{{ region }}' -- required
AND InstanceId = '{{ InstanceId }}'
AND IncludeManagedResources = '{{ IncludeManagedResources }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;

INSERT examples

Delegates ownership of the Amazon EBS root volume for an Apple silicon Mac instance to an administrative user.

INSERT INTO aws.ec2.instances (
InstanceId,
MacCredentials,
region,
ClientToken,
DryRun,
TagSpecification
)
SELECT
'{{ InstanceId }}',
'{{ MacCredentials }}',
'{{ region }}',
'{{ ClientToken }}',
'{{ DryRun }}',
'{{ TagSpecification }}'
RETURNING
instance_id,
mac_modification_task_id,
mac_system_integrity_protection_config,
start_time,
tags,
task_state,
task_type
;

UPDATE examples

Modifies the start time for a scheduled Amazon EC2 instance event.

UPDATE aws.ec2.instances
SET
-- No updatable properties
WHERE
InstanceId = '{{ InstanceId }}' --required
AND InstanceEventId = '{{ InstanceEventId }}' --required
AND NotBefore = '{{ NotBefore }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
code,
description,
instance_event_id,
not_after,
not_before,
not_before_deadline;

DELETE examples

Terminates (deletes) the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds. Terminating an instance is permanent and irreversible. After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see How instance termination works. Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage. If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated. If you terminate multiple instances across multiple Availability Zones, and one or more of the specified instances are enabled for termination protection, the request fails with the following results: The specified instances that are in the same Availability Zone as the protected instance are not terminated. The specified instances that are in different Availability Zones, where no other specified instances are protected, are successfully terminated. For example, say you have the following instances: Instance A: us-east-1a; Not protected Instance B: us-east-1a; Not protected Instance C: us-east-1b; Protected Instance D: us-east-1b; not protected If you attempt to terminate all of these instances in the same request, the request reports failure with the following results: Instance A and Instance B are successfully terminated because none of the specified instances in us-east-1a are enabled for termination protection. Instance C and Instance D fail to terminate because at least one of the specified instances in us-east-1b (Instance C) is enabled for termination protection. Terminated instances remain visible after termination (for approximately one hour). By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running. By default, the TerminateInstances operation includes a graceful operating system (OS) shutdown. To bypass the graceful shutdown, use the skipOsShutdown parameter; however, this might risk data integrity. You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Amazon EC2 instance state changes in the Amazon EC2 User Guide. When you terminate an instance, we attempt to terminate it forcibly after a short while. If your instance appears stuck in the shutting-down state after a period of time, there might be an issue with the underlying host computer. For more information about terminating and troubleshooting terminating your instances, see Terminate Amazon EC2 instances and Troubleshooting terminating your instance in the Amazon EC2 User Guide.

DELETE FROM aws.ec2.instances
WHERE InstanceId = '{{ InstanceId }}' --required
AND region = '{{ region }}' --required
AND Force = '{{ Force }}'
AND SkipOsShutdown = '{{ SkipOsShutdown }}'
AND DryRun = '{{ DryRun }}'
;

Lifecycle Methods

Bundles an Amazon instance store-backed Windows instance. During bundling, only the root device volume (C:) is bundled. Data on other instance store volumes is not preserved. BundleInstance is no longer supported. To create an AMI, use CreateImage instead. For more information about creating an Amazon EBS-backed AMI, see Create an Amazon EBS-backed AMI in the Amazon EC2 User Guide.

EXEC aws.ec2.instances.bundle_instance
@InstanceId='{{ InstanceId }}' --required,
@region='{{ region }}' --required,
@Storage='{{ Storage }}',
@DryRun={{ DryRun }}
;