# NOT RUN {
# This example launches the specified Scheduled Instance in a VPC.
# }
# NOT RUN {
svc$run_scheduled_instances(
InstanceCount = 1L,
LaunchSpecification = list(
IamInstanceProfile = list(
Name = "my-iam-role"
),
ImageId = "ami-12345678",
InstanceType = "c4.large",
KeyName = "my-key-pair",
NetworkInterfaces = list(
list(
AssociatePublicIpAddress = TRUE,
DeviceIndex = 0L,
Groups = list(
"sg-12345678"
),
SubnetId = "subnet-12345678"
)
)
),
ScheduledInstanceId = "sci-1234-1234-1234-1234-123456789012"
)
# }
# NOT RUN {
# This example launches the specified Scheduled Instance in EC2-Classic.
# }
# NOT RUN {
svc$run_scheduled_instances(
InstanceCount = 1L,
LaunchSpecification = list(
IamInstanceProfile = list(
Name = "my-iam-role"
),
ImageId = "ami-12345678",
InstanceType = "c4.large",
KeyName = "my-key-pair",
Placement = list(
AvailabilityZone = "us-west-2b"
),
SecurityGroupIds = list(
"sg-12345678"
)
),
ScheduledInstanceId = "sci-1234-1234-1234-1234-123456789012"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab