Launches the specified Scheduled Instances.
Before you can launch a Scheduled Instance, you must purchase it and obtain an identifier using PurchaseScheduledInstances .
You must launch a Scheduled Instance during its scheduled time period. You can’t stop or reboot a Scheduled Instance, but you can terminate it as needed. If you terminate a Scheduled Instance before the current scheduled time period ends, you can launch it again after a few minutes. For more information, see Scheduled Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
run-scheduled-instances
[--client-token <value>]
[--dry-run | --no-dry-run]
[--instance-count <value>]
--launch-specification <value>
--scheduled-instance-id <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--client-token
(string)
Unique, case-sensitive identifier that ensures the idempotency of the request. For more information, see Ensuring Idempotency .
--dry-run
| --no-dry-run
(boolean)
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation
. Otherwise, it isUnauthorizedOperation
.
--instance-count
(integer)
The number of instances.
Default: 1
--launch-specification
(structure)
The launch specification. You must match the instance type, Availability Zone, network, and platform of the schedule that you purchased.
BlockDeviceMappings -> (list)
The block device mapping entries.
(structure)
Describes a block device mapping for a Scheduled Instance.
DeviceName -> (string)
The device name (for example,
/dev/sdh
orxvdh
).Ebs -> (structure)
Parameters used to set up EBS volumes automatically when the instance is launched.
DeleteOnTermination -> (boolean)
Indicates whether the volume is deleted on instance termination.
Encrypted -> (boolean)
Indicates whether the volume is encrypted. You can attached encrypted volumes only to instances that support them.
Iops -> (integer)
The number of I/O operations per second (IOPS) to provision for an
io1
orio2
volume, with a maximum ratio of 50 IOPS/GiB forio1
, and 500 IOPS/GiB forio2
. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .This parameter is valid only for Provisioned IOPS SSD (
io1
andio2
) volumes.SnapshotId -> (string)
The ID of the snapshot.
VolumeSize -> (integer)
The size of the volume, in GiB.
Default: If you’re creating the volume from a snapshot and don’t specify a volume size, the default is the snapshot size.
VolumeType -> (string)
The volume type.
gp2
for General Purpose SSD,io1
orio2
for Provisioned IOPS SSD, Throughput Optimized HDD forst1
, Cold HDD forsc1
, orstandard
for Magnetic.Default:
gp2
NoDevice -> (string)
Suppresses the specified device included in the block device mapping of the AMI.
VirtualName -> (string)
The virtual device name (
ephemeral
N). Instance store volumes are numbered starting from 0. An instance type with two available instance store volumes can specify mappings forephemeral0
andephemeral1
. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.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.
EbsOptimized -> (boolean)
Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal 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
IamInstanceProfile -> (structure)
The IAM instance profile.
Arn -> (string)
The Amazon Resource Name (ARN).
Name -> (string)
The name.
ImageId -> (string)
The ID of the Amazon Machine Image (AMI).
InstanceType -> (string)
The instance type.
KernelId -> (string)
The ID of the kernel.
KeyName -> (string)
The name of the key pair.
Monitoring -> (structure)
Enable or disable monitoring for the instances.
Enabled -> (boolean)
Indicates whether monitoring is enabled.
NetworkInterfaces -> (list)
The network interfaces.
(structure)
Describes a network interface for a Scheduled Instance.
AssociatePublicIpAddress -> (boolean)
Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 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
.DeleteOnTermination -> (boolean)
Indicates whether to delete the interface when the instance is terminated.
Description -> (string)
The description.
DeviceIndex -> (integer)
The index of the device for the network interface attachment.
Groups -> (list)
The IDs of the security groups.
(string)
Ipv6AddressCount -> (integer)
The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.
Ipv6Addresses -> (list)
The specific IPv6 addresses from the subnet range.
(structure)
Describes an IPv6 address.
Ipv6Address -> (string)
The IPv6 address.
NetworkInterfaceId -> (string)
The ID of the network interface.
PrivateIpAddress -> (string)
The IPv4 address of the network interface within the subnet.
PrivateIpAddressConfigs -> (list)
The private IPv4 addresses.
(structure)
Describes a private IPv4 address for a Scheduled Instance.
Primary -> (boolean)
Indicates whether this is a primary IPv4 address. Otherwise, this is a secondary IPv4 address.
PrivateIpAddress -> (string)
The IPv4 address.
SecondaryPrivateIpAddressCount -> (integer)
The number of secondary private IPv4 addresses.
SubnetId -> (string)
The ID of the subnet.
Placement -> (structure)
The placement information.
AvailabilityZone -> (string)
The Availability Zone.
GroupName -> (string)
The name of the placement group.
RamdiskId -> (string)
The ID of the RAM disk.
SecurityGroupIds -> (list)
The IDs of the security groups.
(string)
SubnetId -> (string)
The ID of the subnet in which to launch the instances.
UserData -> (string)
The base64-encoded MIME user data.
JSON Syntax:
{
"BlockDeviceMappings": [
{
"DeviceName": "string",
"Ebs": {
"DeleteOnTermination": true|false,
"Encrypted": true|false,
"Iops": integer,
"SnapshotId": "string",
"VolumeSize": integer,
"VolumeType": "string"
},
"NoDevice": "string",
"VirtualName": "string"
}
...
],
"EbsOptimized": true|false,
"IamInstanceProfile": {
"Arn": "string",
"Name": "string"
},
"ImageId": "string",
"InstanceType": "string",
"KernelId": "string",
"KeyName": "string",
"Monitoring": {
"Enabled": true|false
},
"NetworkInterfaces": [
{
"AssociatePublicIpAddress": true|false,
"DeleteOnTermination": true|false,
"Description": "string",
"DeviceIndex": integer,
"Groups": ["string", ...],
"Ipv6AddressCount": integer,
"Ipv6Addresses": [
{
"Ipv6Address": "string"
}
...
],
"NetworkInterfaceId": "string",
"PrivateIpAddress": "string",
"PrivateIpAddressConfigs": [
{
"Primary": true|false,
"PrivateIpAddress": "string"
}
...
],
"SecondaryPrivateIpAddressCount": integer,
"SubnetId": "string"
}
...
],
"Placement": {
"AvailabilityZone": "string",
"GroupName": "string"
},
"RamdiskId": "string",
"SecurityGroupIds": ["string", ...],
"SubnetId": "string",
"UserData": "string"
}
--scheduled-instance-id
(string)
The Scheduled Instance ID.
--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.
See ‘aws help’ for descriptions of global parameters.
To launch a Scheduled Instance
This example launches the specified Scheduled Instance in a VPC.
Command:
aws ec2 run-scheduled-instances --scheduled-instance-id sci-1234-1234-1234-1234-123456789012 --instance-count 1 --launch-specification file://launch-specification.json
Launch-specification.json:
{
"ImageId": "ami-12345678",
"KeyName": "my-key-pair",
"InstanceType": "c4.large",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-12345678",
"AssociatePublicIpAddress": true,
"Groups": ["sg-12345678"]
}
],
"IamInstanceProfile": {
"Name": "my-iam-role"
}
}
Output:
{
"InstanceIdSet": [
"i-1234567890abcdef0"
]
}
This example launches the specified Scheduled Instance in EC2-Classic.
Command:
aws ec2 run-scheduled-instances --scheduled-instance-id sci-1234-1234-1234-1234-123456789012 --instance-count 1 --launch-specification file://launch-specification.json
Launch-specification.json:
{
"ImageId": "ami-12345678",
"KeyName": "my-key-pair",
"SecurityGroupIds": ["sg-12345678"],
"InstanceType": "c4.large",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
"IamInstanceProfile": {
"Name": "my-iam-role"
}
}
Output:
{
"InstanceIdSet": [
"i-1234567890abcdef0"
]
}