Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
    /*
     * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
     * 
     * Licensed under the Apache License, Version 2.0 (the "License").
     * You may not use this file except in compliance with the License.
     * A copy of the License is located at
     * 
     *  http://aws.amazon.com/apache2.0
     * 
    * or in the "license" file accompanying this file. This file is distributed
    * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
    * express or implied. See the License for the specific language governing
    * permissions and limitations under the License.
    */
   package com.amazonaws.services.ec2;
   
   
   
Asynchronous client for accessing AmazonEC2. All asynchronous calls made using this client are non-blocking. Callers could either process the result and handle the exceptions in the worker thread by providing a callback handler when making the call, or use the returned Future object to check the result of the call in the calling thread. Amazon Elastic Compute Cloud

Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster.

   
   public class AmazonEC2AsyncClient extends AmazonEC2Client
           implements AmazonEC2Async {

    
Executor service for executing asynchronous requests.
   
       private ExecutorService executorService;
   
       private static final int DEFAULT_THREAD_POOL_SIZE = 50;

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

   
       public AmazonEC2AsyncClient() {
           this(new DefaultAWSCredentialsProviderChain());
       }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AmazonEC2 (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
   
       public AmazonEC2AsyncClient(ClientConfiguration clientConfiguration) {
           this(new DefaultAWSCredentialsProviderChain(), clientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections()));
       }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials. Default client settings will be used, and a fixed size thread pool will be created for executing the asynchronous tasks.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
  
      public AmazonEC2AsyncClient(AWSCredentials awsCredentials) {
          this(awsCredentials, Executors.newFixedThreadPool());
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials and executor service. Default client settings will be used.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
executorService The executor service by which all asynchronous requests will be executed.
  
      public AmazonEC2AsyncClient(AWSCredentials awsCredentialsExecutorService executorService) {
          super(awsCredentials);
          this. = executorService;
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials, executor service, and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
executorService The executor service by which all asynchronous requests will be executed.
  
      public AmazonEC2AsyncClient(AWSCredentials awsCredentials,
                  ClientConfiguration clientConfigurationExecutorService executorService) {
          super(awsCredentialsclientConfiguration);
          this. = executorService;
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials provider. Default client settings will be used, and a fixed size thread pool will be created for executing the asynchronous tasks.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
  
      public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
          this(awsCredentialsProvider, Executors.newFixedThreadPool());
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials provider and executor service. Default client settings will be used.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
executorService The executor service by which all asynchronous requests will be executed.
  
      public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProviderExecutorService executorService) {
          this(awsCredentialsProvidernew ClientConfiguration(), executorService);
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials provider and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
  
      public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider,
                  ClientConfiguration clientConfiguration) {
          this(awsCredentialsProviderclientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections()));
      }

    
Constructs a new asynchronous client to invoke service methods on AmazonEC2 using the specified AWS account credentials provider, executor service, and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
executorService The executor service by which all asynchronous requests will be executed.
  
      public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider,
                  ClientConfiguration clientConfigurationExecutorService executorService) {
          super(awsCredentialsProviderclientConfiguration);
          this. = executorService;
      }

    
Returns the executor service used by this async client to execute requests.

Returns:
The executor service used by this async client to execute requests.
  
      public ExecutorService getExecutorService() {
          return ;
      }

    
Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should call getExecutorService().shutdown() followed by getExecutorService().awaitTermination() prior to calling this method.
  
      @Override
      public void shutdown() {
          super.shutdown();
          .shutdownNow();
      }
            
    

Requests a reboot of one or more 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 a Linux/Unix instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.

For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .

Parameters:
rebootInstancesRequest Container for the necessary parameters to execute the RebootInstances operation on AmazonEC2.
Returns:
A Java Future object containing the response from the RebootInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<VoidrebootInstancesAsync(final RebootInstancesRequest rebootInstancesRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<Void>() {
              public Void call() throws Exception {
                  rebootInstances(rebootInstancesRequest);
                  return null;
          }
      });
      }

    

Requests a reboot of one or more 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 a Linux/Unix instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.

For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .

Parameters:
rebootInstancesRequest Container for the necessary parameters to execute the RebootInstances operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the RebootInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<VoidrebootInstancesAsync(
              final RebootInstancesRequest rebootInstancesRequest,
              final AsyncHandler<RebootInstancesRequestVoidasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<Void>() {
              public Void call() throws Exception {
                try {
                  rebootInstances(rebootInstancesRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(rebootInstancesRequestnull);
                   return null;
          }
      });
      }
    
    

Describes one or more of the Reserved Instances that you purchased.

For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
describeReservedInstancesRequest Container for the necessary parameters to execute the DescribeReservedInstances operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeReservedInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<DescribeReservedInstancesResultdescribeReservedInstancesAsync(final DescribeReservedInstancesRequest describeReservedInstancesRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DescribeReservedInstancesResult>() {
              public DescribeReservedInstancesResult call() throws Exception {
                  return describeReservedInstances(describeReservedInstancesRequest);
          }
      });
      }

    

Describes one or more of the Reserved Instances that you purchased.

For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
describeReservedInstancesRequest Container for the necessary parameters to execute the DescribeReservedInstances operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeReservedInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final DescribeReservedInstancesRequest describeReservedInstancesRequest,
              final AsyncHandler<DescribeReservedInstancesRequestDescribeReservedInstancesResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DescribeReservedInstancesResult>() {
              public DescribeReservedInstancesResult call() throws Exception {
                DescribeReservedInstancesResult result;
                  try {
                  result = describeReservedInstances(describeReservedInstancesRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(describeReservedInstancesRequestresult);
                   return result;
          }
      });
      }
    
    

Describes one or more of the Availability Zones that are available to you. The results include zones only for the region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.

For more information, see Regions and Availability Zones in the Amazon Elastic Compute Cloud User Guide .

Parameters:
describeAvailabilityZonesRequest Container for the necessary parameters to execute the DescribeAvailabilityZones operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeAvailabilityZones service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<DescribeAvailabilityZonesResultdescribeAvailabilityZonesAsync(final DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DescribeAvailabilityZonesResult>() {
              public DescribeAvailabilityZonesResult call() throws Exception {
                  return describeAvailabilityZones(describeAvailabilityZonesRequest);
          }
      });
      }

    

Describes one or more of the Availability Zones that are available to you. The results include zones only for the region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.

For more information, see Regions and Availability Zones in the Amazon Elastic Compute Cloud User Guide .

Parameters:
describeAvailabilityZonesRequest Container for the necessary parameters to execute the DescribeAvailabilityZones operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeAvailabilityZones service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest,
              final AsyncHandler<DescribeAvailabilityZonesRequestDescribeAvailabilityZonesResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DescribeAvailabilityZonesResult>() {
              public DescribeAvailabilityZonesResult call() throws Exception {
                DescribeAvailabilityZonesResult result;
                  try {
                  result = describeAvailabilityZones(describeAvailabilityZonesRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(describeAvailabilityZonesRequestresult);
                   return result;
          }
      });
      }
    
    

Restores an Elastic IP address that was previously moved to the EC2-VPC platform back to the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in EC2-VPC. The Elastic IP address must not be associated with an instance or network interface.

Parameters:
restoreAddressToClassicRequest Container for the necessary parameters to execute the RestoreAddressToClassic operation on AmazonEC2.
Returns:
A Java Future object containing the response from the RestoreAddressToClassic service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<RestoreAddressToClassicResultrestoreAddressToClassicAsync(final RestoreAddressToClassicRequest restoreAddressToClassicRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<RestoreAddressToClassicResult>() {
              public RestoreAddressToClassicResult call() throws Exception {
                  return restoreAddressToClassic(restoreAddressToClassicRequest);
          }
      });
      }

    

Restores an Elastic IP address that was previously moved to the EC2-VPC platform back to the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in EC2-VPC. The Elastic IP address must not be associated with an instance or network interface.

Parameters:
restoreAddressToClassicRequest Container for the necessary parameters to execute the RestoreAddressToClassic operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the RestoreAddressToClassic service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final RestoreAddressToClassicRequest restoreAddressToClassicRequest,
              final AsyncHandler<RestoreAddressToClassicRequestRestoreAddressToClassicResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<RestoreAddressToClassicResult>() {
              public RestoreAddressToClassicResult call() throws Exception {
                RestoreAddressToClassicResult result;
                  try {
                  result = restoreAddressToClassic(restoreAddressToClassicRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(restoreAddressToClassicRequestresult);
                   return result;
          }
      });
      }
    
    

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so results in the volume being stuck in a busy state while detaching.

If an Amazon EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.

When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.

For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
detachVolumeRequest Container for the necessary parameters to execute the DetachVolume operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DetachVolume service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<DetachVolumeResultdetachVolumeAsync(final DetachVolumeRequest detachVolumeRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DetachVolumeResult>() {
              public DetachVolumeResult call() throws Exception {
                  return detachVolume(detachVolumeRequest);
          }
      });
      }

    

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so results in the volume being stuck in a busy state while detaching.

If an Amazon EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.

When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.

For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
detachVolumeRequest Container for the necessary parameters to execute the DetachVolume operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DetachVolume service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final DetachVolumeRequest detachVolumeRequest,
              final AsyncHandler<DetachVolumeRequestDetachVolumeResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<DetachVolumeResult>() {
              public DetachVolumeResult call() throws Exception {
                DetachVolumeResult result;
                  try {
                  result = detachVolume(detachVolumeRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(detachVolumeRequestresult);
                   return result;
          }
      });
      }
    
    

Deletes the specified key pair, by removing the public key from Amazon EC2.

Parameters:
deleteKeyPairRequest Container for the necessary parameters to execute the DeleteKeyPair operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DeleteKeyPair service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<VoiddeleteKeyPairAsync(final DeleteKeyPairRequest deleteKeyPairRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<Void>() {
              public Void call() throws Exception {
                  deleteKeyPair(deleteKeyPairRequest);
                  return null;
          }
      });
      }

    

Deletes the specified key pair, by removing the public key from Amazon EC2.

Parameters:
deleteKeyPairRequest Container for the necessary parameters to execute the DeleteKeyPair operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DeleteKeyPair service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<VoiddeleteKeyPairAsync(
              final DeleteKeyPairRequest deleteKeyPairRequest,
              final AsyncHandler<DeleteKeyPairRequestVoidasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<Void>() {
              public Void call() throws Exception {
                try {
                  deleteKeyPair(deleteKeyPairRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(deleteKeyPairRequestnull);
                   return null;
          }
      });
      }
    
    

Disables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .

Parameters:
unmonitorInstancesRequest Container for the necessary parameters to execute the UnmonitorInstances operation on AmazonEC2.
Returns:
A Java Future object containing the response from the UnmonitorInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<UnmonitorInstancesResultunmonitorInstancesAsync(final UnmonitorInstancesRequest unmonitorInstancesRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<UnmonitorInstancesResult>() {
              public UnmonitorInstancesResult call() throws Exception {
                  return unmonitorInstances(unmonitorInstancesRequest);
          }
      });
      }

    

Disables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .

Parameters:
unmonitorInstancesRequest Container for the necessary parameters to execute the UnmonitorInstances operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the UnmonitorInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final UnmonitorInstancesRequest unmonitorInstancesRequest,
              final AsyncHandler<UnmonitorInstancesRequestUnmonitorInstancesResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<UnmonitorInstancesResult>() {
              public UnmonitorInstancesResult call() throws Exception {
                UnmonitorInstancesResult result;
                  try {
                  result = unmonitorInstances(unmonitorInstancesRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(unmonitorInstancesRequestresult);
                   return result;
          }
      });
      }
    
    

Attaches a virtual private gateway to a VPC. For more information, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide .

Parameters:
attachVpnGatewayRequest Container for the necessary parameters to execute the AttachVpnGateway operation on AmazonEC2.
Returns:
A Java Future object containing the response from the AttachVpnGateway service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public Future<AttachVpnGatewayResultattachVpnGatewayAsync(final AttachVpnGatewayRequest attachVpnGatewayRequest
              throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<AttachVpnGatewayResult>() {
              public AttachVpnGatewayResult call() throws Exception {
                  return attachVpnGateway(attachVpnGatewayRequest);
          }
      });
      }

    

Attaches a virtual private gateway to a VPC. For more information, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide .

Parameters:
attachVpnGatewayRequest Container for the necessary parameters to execute the AttachVpnGateway operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the AttachVpnGateway service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
              final AttachVpnGatewayRequest attachVpnGatewayRequest,
              final AsyncHandler<AttachVpnGatewayRequestAttachVpnGatewayResultasyncHandler)
                      throws AmazonServiceExceptionAmazonClientException {
          return .submit(new Callable<AttachVpnGatewayResult>() {
              public AttachVpnGatewayResult call() throws Exception {
                AttachVpnGatewayResult result;
                  try {
                  result = attachVpnGateway(attachVpnGatewayRequest);
                } catch (Exception ex) {
                    asyncHandler.onError(ex);
              throw ex;
                }
                asyncHandler.onSuccess(attachVpnGatewayRequestresult);
                   return result;
          }
      });
      }
    
    

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide .

Parameters:
createImageRequest Container for the necessary parameters to execute the CreateImage operation on AmazonEC2.
Returns:
A Java Future object containing the response from the CreateImage service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<CreateImageResultcreateImageAsync(final CreateImageRequest createImageRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateImageResult>() {
             public CreateImageResult call() throws Exception {
                 return createImage(createImageRequest);
         }
     });
     }

    

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide .

Parameters:
createImageRequest Container for the necessary parameters to execute the CreateImage operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateImage service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final CreateImageRequest createImageRequest,
             final AsyncHandler<CreateImageRequestCreateImageResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateImageResult>() {
             public CreateImageResult call() throws Exception {
               CreateImageResult result;
                 try {
                 result = createImage(createImageRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createImageRequestresult);
                  return result;
         }
     });
     }
    
    

Deletes a security group.

If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.

Parameters:
deleteSecurityGroupRequest Container for the necessary parameters to execute the DeleteSecurityGroup operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DeleteSecurityGroup service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<VoiddeleteSecurityGroupAsync(final DeleteSecurityGroupRequest deleteSecurityGroupRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 deleteSecurityGroup(deleteSecurityGroupRequest);
                 return null;
         }
     });
     }

    

Deletes a security group.

If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.

Parameters:
deleteSecurityGroupRequest Container for the necessary parameters to execute the DeleteSecurityGroup operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DeleteSecurityGroup service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DeleteSecurityGroupRequest deleteSecurityGroupRequest,
             final AsyncHandler<DeleteSecurityGroupRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 deleteSecurityGroup(deleteSecurityGroupRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(deleteSecurityGroupRequestnull);
                  return null;
         }
     });
     }
    
    

Exports a running or stopped instance to an S3 bucket.

For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting EC2 Instances in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
createInstanceExportTaskRequest Container for the necessary parameters to execute the CreateInstanceExportTask operation on AmazonEC2.
Returns:
A Java Future object containing the response from the CreateInstanceExportTask service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             throws AmazonServiceExceptionAmazonClientException {
             public CreateInstanceExportTaskResult call() throws Exception {
                 return createInstanceExportTask(createInstanceExportTaskRequest);
         }
     });
     }

    

Exports a running or stopped instance to an S3 bucket.

For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting EC2 Instances in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
createInstanceExportTaskRequest Container for the necessary parameters to execute the CreateInstanceExportTask operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateInstanceExportTask service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final CreateInstanceExportTaskRequest createInstanceExportTaskRequest,
             final AsyncHandler<CreateInstanceExportTaskRequestCreateInstanceExportTaskResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
             public CreateInstanceExportTaskResult call() throws Exception {
               CreateInstanceExportTaskResult result;
                 try {
                 result = createInstanceExportTask(createInstanceExportTaskRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createInstanceExportTaskRequestresult);
                  return result;
         }
     });
     }
    
    

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .

Parameters:
associateDhcpOptionsRequest Container for the necessary parameters to execute the AssociateDhcpOptions operation on AmazonEC2.
Returns:
A Java Future object containing the response from the AssociateDhcpOptions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<VoidassociateDhcpOptionsAsync(final AssociateDhcpOptionsRequest associateDhcpOptionsRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 associateDhcpOptions(associateDhcpOptionsRequest);
                 return null;
         }
     });
     }

    

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .

Parameters:
associateDhcpOptionsRequest Container for the necessary parameters to execute the AssociateDhcpOptions operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the AssociateDhcpOptions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final AssociateDhcpOptionsRequest associateDhcpOptionsRequest,
             final AsyncHandler<AssociateDhcpOptionsRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 associateDhcpOptions(associateDhcpOptionsRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(associateDhcpOptionsRequestnull);
                  return null;
         }
     });
     }
    
    

Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination CIDR IP address ranges, or to one or more destination security groups for the same VPC.

IMPORTANT: You can have up to 50 rules per security group (covering both ingress and egress rules).

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. This action doesn't apply to security groups for use in EC2-Classic. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

Parameters:
authorizeSecurityGroupEgressRequest Container for the necessary parameters to execute the AuthorizeSecurityGroupEgress operation on AmazonEC2.
Returns:
A Java Future object containing the response from the AuthorizeSecurityGroupEgress service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<VoidauthorizeSecurityGroupEgressAsync(final AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 authorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest);
                 return null;
         }
     });
     }

    

Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination CIDR IP address ranges, or to one or more destination security groups for the same VPC.

IMPORTANT: You can have up to 50 rules per security group (covering both ingress and egress rules).

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. This action doesn't apply to security groups for use in EC2-Classic. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

Parameters:
authorizeSecurityGroupEgressRequest Container for the necessary parameters to execute the AuthorizeSecurityGroupEgress operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the AuthorizeSecurityGroupEgress service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest,
             final AsyncHandler<AuthorizeSecurityGroupEgressRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 authorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(authorizeSecurityGroupEgressRequestnull);
                  return null;
         }
     });
     }
    
    

Retrieves the encrypted administrator password for an instance running Windows.

The Windows password is generated at boot if the EC2Config service plugin, Ec2SetPassword , is enabled. This usually only happens the first time an AMI is launched, and then Ec2SetPassword is automatically disabled. The password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.

The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.

Password generation and encryption takes a few moments. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.

Parameters:
getPasswordDataRequest Container for the necessary parameters to execute the GetPasswordData operation on AmazonEC2.
Returns:
A Java Future object containing the response from the GetPasswordData service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<GetPasswordDataResultgetPasswordDataAsync(final GetPasswordDataRequest getPasswordDataRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GetPasswordDataResult>() {
             public GetPasswordDataResult call() throws Exception {
                 return getPasswordData(getPasswordDataRequest);
         }
     });
     }

    

Retrieves the encrypted administrator password for an instance running Windows.

The Windows password is generated at boot if the EC2Config service plugin, Ec2SetPassword , is enabled. This usually only happens the first time an AMI is launched, and then Ec2SetPassword is automatically disabled. The password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.

The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.

Password generation and encryption takes a few moments. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.

Parameters:
getPasswordDataRequest Container for the necessary parameters to execute the GetPasswordData operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GetPasswordData service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final GetPasswordDataRequest getPasswordDataRequest,
             final AsyncHandler<GetPasswordDataRequestGetPasswordDataResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GetPasswordDataResult>() {
             public GetPasswordDataResult call() throws Exception {
               GetPasswordDataResult result;
                 try {
                 result = getPasswordData(getPasswordDataRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(getPasswordDataRequestresult);
                  return result;
         }
     });
     }
    
    

Stops an Amazon EBS-backed instance. Each time you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even if transitions happen multiple times within a single hour.

You can't start or stop Spot Instances.

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 hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.

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.

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 it 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, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .

For more information about troubleshooting, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .

Parameters:
stopInstancesRequest Container for the necessary parameters to execute the StopInstances operation on AmazonEC2.
Returns:
A Java Future object containing the response from the StopInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<StopInstancesResultstopInstancesAsync(final StopInstancesRequest stopInstancesRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<StopInstancesResult>() {
             public StopInstancesResult call() throws Exception {
                 return stopInstances(stopInstancesRequest);
         }
     });
     }

    

Stops an Amazon EBS-backed instance. Each time you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even if transitions happen multiple times within a single hour.

You can't start or stop Spot Instances.

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 hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.

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.

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 it 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, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .

For more information about troubleshooting, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .

Parameters:
stopInstancesRequest Container for the necessary parameters to execute the StopInstances operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the StopInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final StopInstancesRequest stopInstancesRequest,
             final AsyncHandler<StopInstancesRequestStopInstancesResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<StopInstancesResult>() {
             public StopInstancesResult call() throws Exception {
               StopInstancesResult result;
                 try {
                 result = stopInstances(stopInstancesRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(stopInstancesRequestresult);
                  return result;
         }
     });
     }
    
    

Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
importKeyPairRequest Container for the necessary parameters to execute the ImportKeyPair operation on AmazonEC2.
Returns:
A Java Future object containing the response from the ImportKeyPair service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<ImportKeyPairResultimportKeyPairAsync(final ImportKeyPairRequest importKeyPairRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ImportKeyPairResult>() {
             public ImportKeyPairResult call() throws Exception {
                 return importKeyPair(importKeyPairRequest);
         }
     });
     }

    

Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide for Linux .

Parameters:
importKeyPairRequest Container for the necessary parameters to execute the ImportKeyPair operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ImportKeyPair service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final ImportKeyPairRequest importKeyPairRequest,
             final AsyncHandler<ImportKeyPairRequestImportKeyPairResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ImportKeyPairResult>() {
             public ImportKeyPairResult call() throws Exception {
               ImportKeyPairResult result;
                 try {
                 result = importKeyPair(importKeyPairRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(importKeyPairRequestresult);
                  return result;
         }
     });
     }
    
    

Deletes the specified network interface. You must detach the network interface before you can delete it.

Parameters:
deleteNetworkInterfaceRequest Container for the necessary parameters to execute the DeleteNetworkInterface operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DeleteNetworkInterface service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<VoiddeleteNetworkInterfaceAsync(final DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 deleteNetworkInterface(deleteNetworkInterfaceRequest);
                 return null;
         }
     });
     }

    

Deletes the specified network interface. You must detach the network interface before you can delete it.

Parameters:
deleteNetworkInterfaceRequest Container for the necessary parameters to execute the DeleteNetworkInterface operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DeleteNetworkInterface service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest,
             final AsyncHandler<DeleteNetworkInterfaceRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 deleteNetworkInterface(deleteNetworkInterfaceRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(deleteNetworkInterfaceRequestnull);
                  return null;
         }
     });
     }
    
    

Modifies the specified attribute of the specified VPC.

Parameters:
modifyVpcAttributeRequest Container for the necessary parameters to execute the ModifyVpcAttribute operation on AmazonEC2.
Returns:
A Java Future object containing the response from the ModifyVpcAttribute service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<VoidmodifyVpcAttributeAsync(final ModifyVpcAttributeRequest modifyVpcAttributeRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 modifyVpcAttribute(modifyVpcAttributeRequest);
                 return null;
         }
     });
     }

    

Modifies the specified attribute of the specified VPC.

Parameters:
modifyVpcAttributeRequest Container for the necessary parameters to execute the ModifyVpcAttribute operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ModifyVpcAttribute service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final ModifyVpcAttributeRequest modifyVpcAttributeRequest,
             final AsyncHandler<ModifyVpcAttributeRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 modifyVpcAttribute(modifyVpcAttributeRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(modifyVpcAttributeRequestnull);
                  return null;
         }
     });
     }
    
    

Describes the running instances for the specified Spot fleet.

Parameters:
describeSpotFleetInstancesRequest Container for the necessary parameters to execute the DescribeSpotFleetInstances operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeSpotFleetInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             throws AmazonServiceExceptionAmazonClientException {
             public DescribeSpotFleetInstancesResult call() throws Exception {
                 return describeSpotFleetInstances(describeSpotFleetInstancesRequest);
         }
     });
     }

    

Describes the running instances for the specified Spot fleet.

Parameters:
describeSpotFleetInstancesRequest Container for the necessary parameters to execute the DescribeSpotFleetInstances operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeSpotFleetInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DescribeSpotFleetInstancesRequest describeSpotFleetInstancesRequest,
                     throws AmazonServiceExceptionAmazonClientException {
             public DescribeSpotFleetInstancesResult call() throws Exception {
               DescribeSpotFleetInstancesResult result;
                 try {
                 result = describeSpotFleetInstances(describeSpotFleetInstancesRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(describeSpotFleetInstancesRequestresult);
                  return result;
         }
     });
     }
    
    

Creates a security group.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide for Linux and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

IMPORTANT: EC2-Classic: You can have up to 500 security groups. EC2-VPC: You can create up to 100 security groups per VPC.

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.

Parameters:
createSecurityGroupRequest Container for the necessary parameters to execute the CreateSecurityGroup operation on AmazonEC2.
Returns:
A Java Future object containing the response from the CreateSecurityGroup service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<CreateSecurityGroupResultcreateSecurityGroupAsync(final CreateSecurityGroupRequest createSecurityGroupRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateSecurityGroupResult>() {
             public CreateSecurityGroupResult call() throws Exception {
                 return createSecurityGroup(createSecurityGroupRequest);
         }
     });
     }

    

Creates a security group.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide for Linux and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

IMPORTANT: EC2-Classic: You can have up to 500 security groups. EC2-VPC: You can create up to 100 security groups per VPC.

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.

Parameters:
createSecurityGroupRequest Container for the necessary parameters to execute the CreateSecurityGroup operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateSecurityGroup service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final CreateSecurityGroupRequest createSecurityGroupRequest,
             final AsyncHandler<CreateSecurityGroupRequestCreateSecurityGroupResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateSecurityGroupResult>() {
             public CreateSecurityGroupResult call() throws Exception {
               CreateSecurityGroupResult result;
                 try {
                 result = createSecurityGroup(createSecurityGroupRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createSecurityGroupRequestresult);
                  return result;
         }
     });
     }
    
    

Describes the Spot Price history. The prices returned are listed in chronological order, from the oldest to the most recent, for up to the past 90 days. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide for Linux .

When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.

Parameters:
describeSpotPriceHistoryRequest Container for the necessary parameters to execute the DescribeSpotPriceHistory operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeSpotPriceHistory service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             throws AmazonServiceExceptionAmazonClientException {
             public DescribeSpotPriceHistoryResult call() throws Exception {
                 return describeSpotPriceHistory(describeSpotPriceHistoryRequest);
         }
     });
     }

    

Describes the Spot Price history. The prices returned are listed in chronological order, from the oldest to the most recent, for up to the past 90 days. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide for Linux .

When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.

Parameters:
describeSpotPriceHistoryRequest Container for the necessary parameters to execute the DescribeSpotPriceHistory operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeSpotPriceHistory service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DescribeSpotPriceHistoryRequest describeSpotPriceHistoryRequest,
             final AsyncHandler<DescribeSpotPriceHistoryRequestDescribeSpotPriceHistoryResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
             public DescribeSpotPriceHistoryResult call() throws Exception {
               DescribeSpotPriceHistoryResult result;
                 try {
                 result = describeSpotPriceHistory(describeSpotPriceHistoryRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(describeSpotPriceHistoryRequestresult);
                  return result;
         }
     });
     }
    
    

Describes one or more of your network interfaces.

Parameters:
describeNetworkInterfacesRequest Container for the necessary parameters to execute the DescribeNetworkInterfaces operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeNetworkInterfaces service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             throws AmazonServiceExceptionAmazonClientException {
             public DescribeNetworkInterfacesResult call() throws Exception {
                 return describeNetworkInterfaces(describeNetworkInterfacesRequest);
         }
     });
     }

    

Describes one or more of your network interfaces.

Parameters:
describeNetworkInterfacesRequest Container for the necessary parameters to execute the DescribeNetworkInterfaces operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeNetworkInterfaces service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DescribeNetworkInterfacesRequest describeNetworkInterfacesRequest,
             final AsyncHandler<DescribeNetworkInterfacesRequestDescribeNetworkInterfacesResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
             public DescribeNetworkInterfacesResult call() throws Exception {
               DescribeNetworkInterfacesResult result;
                 try {
                 result = describeNetworkInterfaces(describeNetworkInterfacesRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(describeNetworkInterfacesRequestresult);
                  return result;
         }
     });
     }
    
    

Describes one or more regions that are currently available to you.

For a list of the regions supported by Amazon EC2, see Regions and Endpoints .

Parameters:
describeRegionsRequest Container for the necessary parameters to execute the DescribeRegions operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DescribeRegions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<DescribeRegionsResultdescribeRegionsAsync(final DescribeRegionsRequest describeRegionsRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<DescribeRegionsResult>() {
             public DescribeRegionsResult call() throws Exception {
                 return describeRegions(describeRegionsRequest);
         }
     });
     }

    

Describes one or more regions that are currently available to you.

For a list of the regions supported by Amazon EC2, see Regions and Endpoints .

Parameters:
describeRegionsRequest Container for the necessary parameters to execute the DescribeRegions operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeRegions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final DescribeRegionsRequest describeRegionsRequest,
             final AsyncHandler<DescribeRegionsRequestDescribeRegionsResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<DescribeRegionsResult>() {
             public DescribeRegionsResult call() throws Exception {
               DescribeRegionsResult result;
                 try {
                 result = describeRegions(describeRegionsRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(describeRegionsRequestresult);
                  return result;
         }
     });
     }
    
    

Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132 .

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS . The default DHCP option set specifies AmazonProvidedDNS . If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas.
  • domain-name - If you're using AmazonProvidedDNS in us-east-1 , specify ec2.internal . If you're using AmazonProvidedDNS in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal ). Otherwise, specify a domain name (for example, MyCompany.com ). Important : Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.
  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.
  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.
  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132 .

Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an Internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .

Parameters:
createDhcpOptionsRequest Container for the necessary parameters to execute the CreateDhcpOptions operation on AmazonEC2.
Returns:
A Java Future object containing the response from the CreateDhcpOptions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<CreateDhcpOptionsResultcreateDhcpOptionsAsync(final CreateDhcpOptionsRequest createDhcpOptionsRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateDhcpOptionsResult>() {
             public CreateDhcpOptionsResult call() throws Exception {
                 return createDhcpOptions(createDhcpOptionsRequest);
         }
     });
     }

    

Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132 .

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS . The default DHCP option set specifies AmazonProvidedDNS . If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas.
  • domain-name - If you're using AmazonProvidedDNS in us-east-1 , specify ec2.internal . If you're using AmazonProvidedDNS in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal ). Otherwise, specify a domain name (for example, MyCompany.com ). Important : Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.
  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.
  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.
  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132 .

Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an Internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .

Parameters:
createDhcpOptionsRequest Container for the necessary parameters to execute the CreateDhcpOptions operation on AmazonEC2.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateDhcpOptions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
             final CreateDhcpOptionsRequest createDhcpOptionsRequest,
             final AsyncHandler<CreateDhcpOptionsRequestCreateDhcpOptionsResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateDhcpOptionsResult>() {
             public CreateDhcpOptionsResult call() throws Exception {
               CreateDhcpOptionsResult result;
                 try {
                 result = createDhcpOptions(createDhcpOptionsRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createDhcpOptionsRequestresult);
                  return result;
         }
     });
     }
    
    

Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint.

Parameters:
deleteVpcEndpointsRequest Container for the necessary parameters to execute the DeleteVpcEndpoints operation on AmazonEC2.
Returns:
A Java Future object containing the response from the DeleteVpcEndpoints service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public Future<DeleteVpcEndpointsResultdeleteVpcEndpointsAsync(final DeleteVpcEndpointsRequest deleteVpcEndpointsRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<DeleteVpcEndpointsResult>() {
             public DeleteVpcEndpointsResult call()