Interface AWSInstanceApi

  • All Superinterfaces:
    InstanceApi

    public interface AWSInstanceApi
    extends InstanceApi
    Provides access to EC2 Instance Services via their REST API.

    • Method Detail

      • runInstancesInRegion

        @Named("RunInstances")
        @POST
        @Path("/")
        Reservation<? extends AWSRunningInstance> runInstancesInRegion​(@Nullable
                                                                       String region,
                                                                       @Nullable
                                                                       String nullableAvailabilityZone,
                                                                       @FormParam("ImageId")
                                                                       String imageId,
                                                                       @FormParam("MinCount")
                                                                       int minCount,
                                                                       @FormParam("MaxCount")
                                                                       int maxCount,
                                                                       RunInstancesOptions... options)
        Description copied from interface: InstanceApi
        Launches a specified number of instances of an AMI for which you have permissions.

        If Amazon EC2 cannot launch the minimum number AMIs you request, no instances will be launched. If there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches the minimum number specified for each AMI and allocate the remaining available instances using round robin.

        Security Groups

        Note: Every instance is launched in a security group (created using the CreateSecurityGroup operation.

        Key Pair

        You can provide an optional key pair ID for each image in the launch request (created using the CreateKeyPair operation). All instances that are created from images that use this key pair will have access to the associated public key at boot. You can use this key to provide secure access to an instance of an image on a per-instance basis. Amazon EC2 public images use this feature to provide secure access without passwords.

        Note: Launching public images without a key pair ID will leave them inaccessible.

        The public key material is made available to the instance at boot time by placing it in the openssh_id.pub file on a logical device that is exposed to the instance as /dev/sda2 (the instance store). The format of this file is suitable for use as an entry within ~/.ssh/authorized_keys (the OpenSSH format). This can be done at boot (e.g., as part of rc.local) allowing for secure access without passwords.

        User Data

        Optional user data can be provided in the launch request. All instances that collectively comprise the launch request have access to this data. For more information, go the Amazon Elastic Compute Cloud Developer Guide.

        Product Codes

        Note: If any of the AMIs have a product code attached for which the user has not subscribed, the RunInstances call will fail.

        Kernel

        Important: We strongly recommend using the 2.6.18 Xen stock kernel with High-CPU and High-Memory instances. Although the default Amazon EC2 kernels will work, the new kernels provide greater stability and performance for these instance types. For more information about kernels, go the Amazon Elastic Compute Cloud Developer Guide.
        Specified by:
        runInstancesInRegion in interface InstanceApi
        Parameters:
        region - Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
        nullableAvailabilityZone - Specifies the placement constraints (Availability Zones) for launching the instances. If null, Amazon will determine the best availability zone to place the instance.
        imageId - Unique ID of a machine image, returned by a call to
        minCount - Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances a re launched at all. Constraints: Between 1 and the maximum number allowed for your account (default: 20).
        maxCount - Maximum number of instances to launch. If the value is more than Amazon EC2 can launch, the largest possible number above minCount will be launched instead. Constraints: Between 1 and the maximum number allowed for your account (default: 20).
        See Also:
        InstanceApi.describeInstancesInRegion(java.lang.String, java.lang.String...), InstanceApi.terminateInstancesInRegion(java.lang.String, java.lang.String...), #authorizeSecurityGroupIngressInRegion, #revokeSecurityGroupIngressInRegion, #describeSecurityGroupsInRegion, #createSecurityGroupInRegion, #createKeyPairInRegion, , RunInstancesOptions