Class: AWS.EC2

Inherits:
AWS.Service show all
Identifier:
ec2
API Version:
2016-11-15
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using EC2

var ec2 = new AWS.EC2();
ec2.acceptReservedInstancesExchangeQuote(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the EC2 object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var ec2 = new AWS.EC2({apiVersion: '2016-11-15'});

You can also set the API version globally in AWS.config.apiVersions using the ec2 service identifier:

AWS.config.apiVersions = {
  ec2: '2016-11-15',
  // other service API versions
};

var ec2 = new AWS.EC2();

Version:

  • 2016-11-15

Waiter Resource States

This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:

instanceExists, bundleTaskComplete, conversionTaskCancelled, conversionTaskCompleted, conversionTaskDeleted, customerGatewayAvailable, exportTaskCancelled, exportTaskCompleted, imageExists, imageAvailable, instanceRunning, instanceStatusOk, instanceStopped, instanceTerminated, keyPairExists, natGatewayAvailable, networkInterfaceAvailable, passwordDataAvailable, snapshotCompleted, spotInstanceRequestFulfilled, subnetAvailable, systemStatusOk, volumeAvailable, volumeDeleted, volumeInUse, vpcAvailable, vpcExists, vpnConnectionAvailable, vpnConnectionDeleted, vpcPeeringConnectionExists, vpcPeeringConnectionDeleted

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, defineService

Constructor Details

new AWS.EC2(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a EC2 object

var ec2 = new AWS.EC2({apiVersion: '2016-11-15'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.EC2.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.EC2.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.EC2.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • clientSideMonitoring (Boolean)

    whether to collect and

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

acceptReservedInstancesExchangeQuote(params = {}, callback) ⇒ AWS.Request

Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.

Examples:

Calling the acceptReservedInstancesExchangeQuote operation

var params = {
  ReservedInstanceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false,
  TargetConfigurations: [
    {
      OfferingId: 'STRING_VALUE', /* required */
      InstanceCount: 0
    },
    /* more items */
  ]
};
ec2.acceptReservedInstancesExchangeQuote(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ReservedInstanceIds — (Array<String>)

      The IDs of the Convertible Reserved Instances to exchange for another Convertible Reserved Instance of the same or higher value.

    • TargetConfigurations — (Array<map>)

      The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.

      • InstanceCount — (Integer)

        The number of instances the Covertible Reserved Instance offering can be applied to. This parameter is reserved and cannot be specified in a request

      • OfferingIdrequired — (String)

        The Convertible Reserved Instance offering ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ExchangeId — (String)

        The ID of the successful exchange.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

acceptVpcEndpointConnections(params = {}, callback) ⇒ AWS.Request

Accepts one or more interface VPC endpoint connection requests to your VPC endpoint service.

Service Reference:

Examples:

Calling the acceptVpcEndpointConnections operation

var params = {
  ServiceId: 'STRING_VALUE', /* required */
  VpcEndpointIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.acceptVpcEndpointConnections(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ServiceId — (String)

      The ID of the endpoint service.

    • VpcEndpointIds — (Array<String>)

      The IDs of one or more interface VPC endpoints.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Unsuccessful — (Array<map>)

        Information about the interface endpoints that were not accepted, if applicable.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

acceptVpcPeeringConnection(params = {}, callback) ⇒ AWS.Request

Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.

For an inter-region VPC peering connection request, you must accept the VPC peering connection in the region of the accepter VPC.

Service Reference:

Examples:

Calling the acceptVpcPeeringConnection operation

var params = {
  DryRun: true || false,
  VpcPeeringConnectionId: 'STRING_VALUE'
};
ec2.acceptVpcPeeringConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcPeeringConnectionId — (String)

      The ID of the VPC peering connection. You must specify this parameter in the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpcPeeringConnection — (map)

        Information about the VPC peering connection.

        • AccepterVpcInfo — (map)

          Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.

          • CidrBlock — (String)

            The IPv4 CIDR block for the VPC.

          • Ipv6CidrBlockSet — (Array<map>)

            The IPv6 CIDR block for the VPC.

            • Ipv6CidrBlock — (String)

              The IPv6 CIDR block.

          • CidrBlockSet — (Array<map>)

            Information about the IPv4 CIDR blocks for the VPC.

            • CidrBlock — (String)

              The IPv4 CIDR block.

          • OwnerId — (String)

            The AWS account ID of the VPC owner.

          • PeeringOptions — (map)

            Information about the VPC peering connection options for the accepter or requester VPC.

            • AllowDnsResolutionFromRemoteVpc — (Boolean)

              Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.

            • AllowEgressFromLocalClassicLinkToRemoteVpc — (Boolean)

              Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.

            • AllowEgressFromLocalVpcToRemoteClassicLink — (Boolean)

              Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.

          • VpcId — (String)

            The ID of the VPC.

          • Region — (String)

            The region in which the VPC is located.

        • ExpirationTime — (Date)

          The time that an unaccepted VPC peering connection will expire.

        • RequesterVpcInfo — (map)

          Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.

          • CidrBlock — (String)

            The IPv4 CIDR block for the VPC.

          • Ipv6CidrBlockSet — (Array<map>)

            The IPv6 CIDR block for the VPC.

            • Ipv6CidrBlock — (String)

              The IPv6 CIDR block.

          • CidrBlockSet — (Array<map>)

            Information about the IPv4 CIDR blocks for the VPC.

            • CidrBlock — (String)

              The IPv4 CIDR block.

          • OwnerId — (String)

            The AWS account ID of the VPC owner.

          • PeeringOptions — (map)

            Information about the VPC peering connection options for the accepter or requester VPC.

            • AllowDnsResolutionFromRemoteVpc — (Boolean)

              Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.

            • AllowEgressFromLocalClassicLinkToRemoteVpc — (Boolean)

              Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.

            • AllowEgressFromLocalVpcToRemoteClassicLink — (Boolean)

              Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.

          • VpcId — (String)

            The ID of the VPC.

          • Region — (String)

            The region in which the VPC is located.

        • Status — (map)

          The status of the VPC peering connection.

          • Code — (String)

            The status of the VPC peering connection.

            Possible values include:
            • "initiating-request"
            • "pending-acceptance"
            • "active"
            • "deleted"
            • "rejected"
            • "failed"
            • "expired"
            • "provisioning"
            • "deleting"
          • Message — (String)

            A message that provides more information about the status, if applicable.

        • Tags — (Array<map>)

          Any tags assigned to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VpcPeeringConnectionId — (String)

          The ID of the VPC peering connection.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

advertiseByoipCidr(params = {}, callback) ⇒ AWS.Request

Advertises an IPv4 address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).

You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time.

We recommend that you stop advertising the BYOIP CIDR from other locations when you advertise it from AWS. To minimize down time, you can configure your AWS resources to use an address from a BYOIP CIDR before it is advertised, and then simultaneously stop advertising it from the current location and start advertising it through AWS.

It can take a few minutes before traffic to the specified addresses starts routing to AWS because of BGP propagation delays.

To stop advertising the BYOIP CIDR, use WithdrawByoipCidr.

Service Reference:

Examples:

Calling the advertiseByoipCidr operation

var params = {
  Cidr: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.advertiseByoipCidr(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Cidr — (String)

      The IPv4 address range, in CIDR notation.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ByoipCidr — (map)

        Information about the address range.

        • Cidr — (String)

          The public IPv4 address range, in CIDR notation.

        • Description — (String)

          The description of the address range.

        • StatusMessage — (String)

          Upon success, contains the ID of the address pool. Otherwise, contains an error message.

        • State — (String)

          The state of the address pool.

          Possible values include:
          • "advertised"
          • "deprovisioned"
          • "failed-deprovision"
          • "failed-provision"
          • "pending-deprovision"
          • "pending-provision"
          • "provisioned"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

allocateAddress(params = {}, callback) ⇒ AWS.Request

Allocates an Elastic IP address to your AWS account. After you allocate the Elastic IP address you can associate it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address pool and can be allocated to a different AWS account.

You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon Elastic Compute Cloud User Guide.

[EC2-VPC] If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address that you released after it is allocated to another AWS account. You cannot recover an Elastic IP address for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per region and 5 Elastic IP addresses for EC2-VPC per region.

For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To allocate an Elastic IP address for EC2-VPC


/* This example allocates an Elastic IP address to use with an instance in a VPC. */

 var params = {
  Domain: "vpc"
 };
 ec2.allocateAddress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AllocationId: "eipalloc-64d5890a", 
    Domain: "vpc", 
    PublicIp: "203.0.113.0"
   }
   */
 });

To allocate an Elastic IP address for EC2-Classic


/* This example allocates an Elastic IP address to use with an instance in EC2-Classic. */

 var params = {
 };
 ec2.allocateAddress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Domain: "standard", 
    PublicIp: "198.51.100.0"
   }
   */
 });

Calling the allocateAddress operation

var params = {
  Address: 'STRING_VALUE',
  Domain: vpc | standard,
  DryRun: true || false,
  PublicIpv4Pool: 'STRING_VALUE'
};
ec2.allocateAddress(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Domain — (String)

      Set to vpc to allocate the address for use with instances in a VPC.

      Default: The address is for use with instances in EC2-Classic.

      Possible values include:
      • "vpc"
      • "standard"
    • Address — (String)

      [EC2-VPC] The Elastic IP address to recover or an IPv4 address from an address pool.

    • PublicIpv4Pool — (String)

      The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the Address parameter instead.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • PublicIp — (String)

        The Elastic IP address.

      • AllocationId — (String)

        [EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.

      • PublicIpv4Pool — (String)

        The ID of an address pool.

      • Domain — (String)

        Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard) or instances in a VPC (vpc).

        Possible values include:
        • "vpc"
        • "standard"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

allocateHosts(params = {}, callback) ⇒ AWS.Request

Allocates a Dedicated Host to your account. At a minimum, specify the instance size type, Availability Zone, and quantity of hosts to allocate.

Service Reference:

Examples:

Calling the allocateHosts operation

var params = {
  AvailabilityZone: 'STRING_VALUE', /* required */
  InstanceType: 'STRING_VALUE', /* required */
  Quantity: 0, /* required */
  AutoPlacement: on | off,
  ClientToken: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
ec2.allocateHosts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AutoPlacement — (String)

      This is enabled by default. This property allows instances to be automatically placed onto available Dedicated Hosts, when you are launching instances without specifying a host ID.

      Default: Enabled

      Possible values include:
      • "on"
      • "off"
    • AvailabilityZone — (String)

      The Availability Zone for the Dedicated Hosts.

    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

    • InstanceType — (String)

      Specify the instance type for which to configure your Dedicated Hosts. When you specify the instance type, that is the only instance type that you can launch onto that host.

    • Quantity — (Integer)

      The number of Dedicated Hosts to allocate to your account with these parameters.

    • TagSpecifications — (Array<map>)

      The tags to apply to the Dedicated Host during creation.

      • ResourceType — (String)

        The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

        Possible values include:
        • "customer-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "image"
        • "instance"
        • "internet-gateway"
        • "network-acl"
        • "network-interface"
        • "reserved-instances"
        • "route-table"
        • "snapshot"
        • "spot-instances-request"
        • "subnet"
        • "security-group"
        • "volume"
        • "vpc"
        • "vpn-connection"
        • "vpn-gateway"
      • Tags — (Array<map>)

        The tags to apply to the resource.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • HostIds — (Array<String>)

        The ID of the allocated Dedicated Host. This is used to launch an instance onto a specific host.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

assignIpv6Addresses(params = {}, callback) ⇒ AWS.Request

Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per Network Interface Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the assignIpv6Addresses operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  Ipv6AddressCount: 0,
  Ipv6Addresses: [
    'STRING_VALUE',
    /* more items */
  ]
};
ec2.assignIpv6Addresses(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Ipv6AddressCount — (Integer)

      The number of IPv6 addresses to assign to the network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.

    • Ipv6Addresses — (Array<String>)

      One or more specific IPv6 addresses to be assigned to the network interface. You can't use this option if you're specifying a number of IPv6 addresses.

    • NetworkInterfaceId — (String)

      The ID of the network interface.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AssignedIpv6Addresses — (Array<String>)

        The IPv6 addresses assigned to the network interface.

      • NetworkInterfaceId — (String)

        The ID of the network interface.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

assignPrivateIpAddresses(params = {}, callback) ⇒ AWS.Request

Assigns one or more secondary private IP addresses to the specified network interface.

You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses that you can assign to an instance varies by instance type. For information about instance types, see Instance Types in the Amazon Elastic Compute Cloud User Guide. For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

When you move a secondary private IP address to another network interface, any Elastic IP address that is associated with the IP address is also moved.

Remapping an IP address is an asynchronous operation. When you move an IP address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s in the instance metadata to confirm that the remapping is complete.

Service Reference:

Examples:

To assign a specific secondary private IP address to an interface


/* This example assigns the specified secondary private IP address to the specified network interface. */

 var params = {
  NetworkInterfaceId: "eni-e5aa89a3", 
  PrivateIpAddresses: [
     "10.0.0.82"
  ]
 };
 ec2.assignPrivateIpAddresses(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To assign secondary private IP addresses that Amazon EC2 selects to an interface


/* This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with. */

 var params = {
  NetworkInterfaceId: "eni-e5aa89a3", 
  SecondaryPrivateIpAddressCount: 2
 };
 ec2.assignPrivateIpAddresses(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the assignPrivateIpAddresses operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  AllowReassignment: true || false,
  PrivateIpAddresses: [
    'STRING_VALUE',
    /* more items */
  ],
  SecondaryPrivateIpAddressCount: 0
};
ec2.assignPrivateIpAddresses(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AllowReassignment — (Boolean)

      Indicates whether to allow an IP address that is already assigned to another network interface or instance to be reassigned to the specified network interface.

    • NetworkInterfaceId — (String)

      The ID of the network interface.

    • PrivateIpAddresses — (Array<String>)

      One or more IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify this parameter when also specifying a number of secondary IP addresses.

      If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.

    • SecondaryPrivateIpAddressCount — (Integer)

      The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when also specifying private IP addresses.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateAddress(params = {}, callback) ⇒ AWS.Request

Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.

[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing.

Service Reference:

Examples:

To associate an Elastic IP address in EC2-VPC


/* This example associates the specified Elastic IP address with the specified instance in a VPC. */

 var params = {
  AllocationId: "eipalloc-64d5890a", 
  InstanceId: "i-0b263919b6498b123"
 };
 ec2.associateAddress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AssociationId: "eipassoc-2bebb745"
   }
   */
 });

To associate an Elastic IP address with a network interface


/* This example associates the specified Elastic IP address with the specified network interface. */

 var params = {
  AllocationId: "eipalloc-64d5890a", 
  NetworkInterfaceId: "eni-1a2b3c4d"
 };
 ec2.associateAddress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AssociationId: "eipassoc-2bebb745"
   }
   */
 });

To associate an Elastic IP address in EC2-Classic


/* This example associates an Elastic IP address with an instance in EC2-Classic. */

 var params = {
  InstanceId: "i-07ffe74c7330ebf53", 
  PublicIp: "198.51.100.0"
 };
 ec2.associateAddress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the associateAddress operation

var params = {
  AllocationId: 'STRING_VALUE',
  AllowReassociation: true || false,
  DryRun: true || false,
  InstanceId: 'STRING_VALUE',
  NetworkInterfaceId: 'STRING_VALUE',
  PrivateIpAddress: 'STRING_VALUE',
  PublicIp: 'STRING_VALUE'
};
ec2.associateAddress(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AllocationId — (String)

      [EC2-VPC] The allocation ID. This is required for EC2-VPC.

    • InstanceId — (String)

      The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

    • PublicIp — (String)

      The Elastic IP address. This is required for EC2-Classic.

    • AllowReassociation — (Boolean)

      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • NetworkInterfaceId — (String)

      [EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

    • PrivateIpAddress — (String)

      [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AssociationId — (String)

        [EC2-VPC] The ID that represents the association of the Elastic IP address with an instance.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateDhcpOptions(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

To associate a DHCP options set with a VPC


/* This example associates the specified DHCP options set with the specified VPC. */

 var params = {
  DhcpOptionsId: "dopt-d9070ebb", 
  VpcId: "vpc-a01106c2"
 };
 ec2.associateDhcpOptions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To associate the default DHCP options set with a VPC


/* This example associates the default DHCP options set with the specified VPC. */

 var params = {
  DhcpOptionsId: "default", 
  VpcId: "vpc-a01106c2"
 };
 ec2.associateDhcpOptions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the associateDhcpOptions operation

var params = {
  DhcpOptionsId: 'STRING_VALUE', /* required */
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.associateDhcpOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DhcpOptionsId — (String)

      The ID of the DHCP options set, or default to associate no DHCP options with the VPC.

    • VpcId — (String)

      The ID of the VPC.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateIamInstanceProfile(params = {}, callback) ⇒ AWS.Request

Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.

Service Reference:

Examples:

To associate an IAM instance profile with an instance


/* This example associates an IAM instance profile named admin-role with the specified instance. */

 var params = {
  IamInstanceProfile: {
   Name: "admin-role"
  }, 
  InstanceId: "i-123456789abcde123"
 };
 ec2.associateIamInstanceProfile(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    IamInstanceProfileAssociation: {
     AssociationId: "iip-assoc-0e7736511a163c209", 
     IamInstanceProfile: {
      Arn: "arn:aws:iam::123456789012:instance-profile/admin-role", 
      Id: "AIPAJBLK7RKJKWDXVHIEC"
     }, 
     InstanceId: "i-123456789abcde123", 
     State: "associating"
    }
   }
   */
 });

Calling the associateIamInstanceProfile operation

var params = {
  IamInstanceProfile: { /* required */
    Arn: 'STRING_VALUE',
    Name: 'STRING_VALUE'
  },
  InstanceId: 'STRING_VALUE' /* required */
};
ec2.associateIamInstanceProfile(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • IamInstanceProfile — (map)

      The IAM instance profile.

      • Arn — (String)

        The Amazon Resource Name (ARN) of the instance profile.

      • Name — (String)

        The name of the instance profile.

    • InstanceId — (String)

      The ID of the instance.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • IamInstanceProfileAssociation — (map)

        Information about the IAM instance profile association.

        • AssociationId — (String)

          The ID of the association.

        • InstanceId — (String)

          The ID of the instance.

        • IamInstanceProfile — (map)

          The IAM instance profile.

          • Arn — (String)

            The Amazon Resource Name (ARN) of the instance profile.

          • Id — (String)

            The ID of the instance profile.

        • State — (String)

          The state of the association.

          Possible values include:
          • "associating"
          • "associated"
          • "disassociating"
          • "disassociated"
        • Timestamp — (Date)

          The time the IAM instance profile was associated with the instance.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateRouteTable(params = {}, callback) ⇒ AWS.Request

Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.

For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To associate a route table with a subnet


/* This example associates the specified route table with the specified subnet. */

 var params = {
  RouteTableId: "rtb-22574640", 
  SubnetId: "subnet-9d4a7b6"
 };
 ec2.associateRouteTable(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AssociationId: "rtbassoc-781d0d1a"
   }
   */
 });

Calling the associateRouteTable operation

var params = {
  RouteTableId: 'STRING_VALUE', /* required */
  SubnetId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.associateRouteTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • RouteTableId — (String)

      The ID of the route table.

    • SubnetId — (String)

      The ID of the subnet.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AssociationId — (String)

        The route table association ID. This ID is required for disassociating the route table.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateSubnetCidrBlock(params = {}, callback) ⇒ AWS.Request

Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length of /64.

Service Reference:

Examples:

Calling the associateSubnetCidrBlock operation

var params = {
  Ipv6CidrBlock: 'STRING_VALUE', /* required */
  SubnetId: 'STRING_VALUE' /* required */
};
ec2.associateSubnetCidrBlock(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Ipv6CidrBlock — (String)

      The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length.

    • SubnetId — (String)

      The ID of your subnet.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Ipv6CidrBlockAssociation — (map)

        Information about the IPv6 CIDR block association.

        • AssociationId — (String)

          The association ID for the CIDR block.

        • Ipv6CidrBlock — (String)

          The IPv6 CIDR block.

        • Ipv6CidrBlockState — (map)

          Information about the state of the CIDR block.

          • State — (String)

            The state of a CIDR block.

            Possible values include:
            • "associating"
            • "associated"
            • "disassociating"
            • "disassociated"
            • "failing"
            • "failed"
          • StatusMessage — (String)

            A message about the status of the CIDR block, if applicable.

      • SubnetId — (String)

        The ID of the subnet.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateVpcCidrBlock(params = {}, callback) ⇒ AWS.Request

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The IPv6 CIDR block size is fixed at /56.

For more information about associating CIDR blocks with your VPC and applicable restrictions, see VPC and Subnet Sizing in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the associateVpcCidrBlock operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  AmazonProvidedIpv6CidrBlock: true || false,
  CidrBlock: 'STRING_VALUE'
};
ec2.associateVpcCidrBlock(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AmazonProvidedIpv6CidrBlock — (Boolean)

      Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses, or the size of the CIDR block.

    • CidrBlock — (String)

      An IPv4 CIDR block to associate with the VPC.

    • VpcId — (String)

      The ID of the VPC.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Ipv6CidrBlockAssociation — (map)

        Information about the IPv6 CIDR block association.

        • AssociationId — (String)

          The association ID for the IPv6 CIDR block.

        • Ipv6CidrBlock — (String)

          The IPv6 CIDR block.

        • Ipv6CidrBlockState — (map)

          Information about the state of the CIDR block.

          • State — (String)

            The state of the CIDR block.

            Possible values include:
            • "associating"
            • "associated"
            • "disassociating"
            • "disassociated"
            • "failing"
            • "failed"
          • StatusMessage — (String)

            A message about the status of the CIDR block, if applicable.

      • CidrBlockAssociation — (map)

        Information about the IPv4 CIDR block association.

        • AssociationId — (String)

          The association ID for the IPv4 CIDR block.

        • CidrBlock — (String)

          The IPv4 CIDR block.

        • CidrBlockState — (map)

          Information about the state of the CIDR block.

          • State — (String)

            The state of the CIDR block.

            Possible values include:
            • "associating"
            • "associated"
            • "disassociating"
            • "disassociated"
            • "failing"
            • "failed"
          • StatusMessage — (String)

            A message about the status of the CIDR block, if applicable.

      • VpcId — (String)

        The ID of the VPC.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachClassicLinkVpc(params = {}, callback) ⇒ AWS.Request

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

Linking your instance to a VPC is sometimes referred to as attaching your instance.

Service Reference:

Examples:

Calling the attachClassicLinkVpc operation

var params = {
  Groups: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  InstanceId: 'STRING_VALUE', /* required */
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.attachClassicLinkVpc(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Groups — (Array<String>)

      The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.

    • InstanceId — (String)

      The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.

    • VpcId — (String)

      The ID of a ClassicLink-enabled VPC.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Returns true if the request succeeds; otherwise, it returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachInternetGateway(params = {}, callback) ⇒ AWS.Request

Attaches an internet gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To attach an Internet gateway to a VPC


/* This example attaches the specified Internet gateway to the specified VPC. */

 var params = {
  InternetGatewayId: "igw-c0a643a9", 
  VpcId: "vpc-a01106c2"
 };
 ec2.attachInternetGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the attachInternetGateway operation

var params = {
  InternetGatewayId: 'STRING_VALUE', /* required */
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.attachInternetGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InternetGatewayId — (String)

      The ID of the internet gateway.

    • VpcId — (String)

      The ID of the VPC.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachNetworkInterface(params = {}, callback) ⇒ AWS.Request

Attaches a network interface to an instance.

Service Reference:

Examples:

To attach a network interface to an instance


/* This example attaches the specified network interface to the specified instance. */

 var params = {
  DeviceIndex: 1, 
  InstanceId: "i-1234567890abcdef0", 
  NetworkInterfaceId: "eni-e5aa89a3"
 };
 ec2.attachNetworkInterface(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AttachmentId: "eni-attach-66c4350a"
   }
   */
 });

Calling the attachNetworkInterface operation

var params = {
  DeviceIndex: 0, /* required */
  InstanceId: 'STRING_VALUE', /* required */
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.attachNetworkInterface(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DeviceIndex — (Integer)

      The index of the device for the network interface attachment.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InstanceId — (String)

      The ID of the instance.

    • NetworkInterfaceId — (String)

      The ID of the network interface.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AttachmentId — (String)

        The ID of the network interface attachment.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachVolume(params = {}, callback) ⇒ AWS.Request

Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

For a list of supported device names, see Attaching an EBS Volume to an Instance. Any device names that aren't reserved for instance store volumes can be used for EBS volumes. For more information, see Amazon EC2 Instance Store in the Amazon Elastic Compute Cloud User Guide.

If a volume has an AWS Marketplace product code:

  • The volume can be attached only to a stopped instance.

  • AWS Marketplace product codes are copied from the volume to the instance.

  • You must be subscribed to the product.

  • The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.

For more information about EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To attach a volume to an instance


/* This example attaches a volume (``vol-1234567890abcdef0``) to an instance (``i-01474ef662b89480``) as ``/dev/sdf``. */

 var params = {
  Device: "/dev/sdf", 
  InstanceId: "i-01474ef662b89480", 
  VolumeId: "vol-1234567890abcdef0"
 };
 ec2.attachVolume(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AttachTime: <Date Representation>, 
    Device: "/dev/sdf", 
    InstanceId: "i-01474ef662b89480", 
    State: "attaching", 
    VolumeId: "vol-1234567890abcdef0"
   }
   */
 });

Calling the attachVolume operation

var params = {
  Device: 'STRING_VALUE', /* required */
  InstanceId: 'STRING_VALUE', /* required */
  VolumeId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.attachVolume(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Device — (String)

      The device name (for example, /dev/sdh or xvdh).

    • InstanceId — (String)

      The ID of the instance.

    • VolumeId — (String)

      The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AttachTime — (Date)

        The time stamp when the attachment initiated.

      • Device — (String)

        The device name.

      • InstanceId — (String)

        The ID of the instance.

      • State — (String)

        The attachment state of the volume.

        Possible values include:
        • "attaching"
        • "attached"
        • "detaching"
        • "detached"
        • "busy"
      • VolumeId — (String)

        The ID of the volume.

      • DeleteOnTermination — (Boolean)

        Indicates whether the EBS volume is deleted on instance termination.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachVpnGateway(params = {}, callback) ⇒ AWS.Request

Attaches a virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.

For more information, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the attachVpnGateway operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  VpnGatewayId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.attachVpnGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • VpcId — (String)

      The ID of the VPC.

    • VpnGatewayId — (String)

      The ID of the virtual private gateway.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpcAttachment — (map)

        Information about the attachment.

        • State — (String)

          The current state of the attachment.

          Possible values include:
          • "attaching"
          • "attached"
          • "detaching"
          • "detached"
        • VpcId — (String)

          The ID of the VPC.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

authorizeSecurityGroupEgress(params = {}, callback) ⇒ AWS.Request

[EC2-VPC only] 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 IPv4 or IPv6 CIDR address ranges, or to one or more destination security groups for the same 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. For more information about security group limits, see Amazon VPC Limits.

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. You can optionally specify a description for the rule.

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

Service Reference:

Examples:

To add a rule that allows outbound traffic to a specific address range


/* This example adds a rule that grants access to the specified address ranges on TCP port 80. */

 var params = {
  GroupId: "sg-1a2b3c4d", 
  IpPermissions: [
     {
    FromPort: 80, 
    IpProtocol: "tcp", 
    IpRanges: [
       {
      CidrIp: "10.0.0.0/16"
     }
    ], 
    ToPort: 80
   }
  ]
 };
 ec2.authorizeSecurityGroupEgress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To add a rule that allows outbound traffic to a specific security group


/* This example adds a rule that grants access to the specified security group on TCP port 80. */

 var params = {
  GroupId: "sg-1a2b3c4d", 
  IpPermissions: [
     {
    FromPort: 80, 
    IpProtocol: "tcp", 
    ToPort: 80, 
    UserIdGroupPairs: [
       {
      GroupId: "sg-4b51a32f"
     }
    ]
   }
  ]
 };
 ec2.authorizeSecurityGroupEgress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the authorizeSecurityGroupEgress operation

var params = {
  GroupId: 'STRING_VALUE', /* required */
  CidrIp: 'STRING_VALUE',
  DryRun: true || false,
  FromPort: 0,
  IpPermissions: [
    {
      FromPort: 0,
      IpProtocol: 'STRING_VALUE',
      IpRanges: [
        {
          CidrIp: 'STRING_VALUE',
          Description: 'STRING_VALUE'
        },
        /* more items */
      ],
      Ipv6Ranges: [
        {
          CidrIpv6: 'STRING_VALUE',
          Description: 'STRING_VALUE'
        },
        /* more items */
      ],
      PrefixListIds: [
        {
          Description: 'STRING_VALUE',
          PrefixListId: 'STRING_VALUE'
        },
        /* more items */
      ],
      ToPort: 0,
      UserIdGroupPairs: [
        {
          Description: 'STRING_VALUE',
          GroupId: 'STRING_VALUE',
          GroupName: 'STRING_VALUE',
          PeeringStatus: 'STRING_VALUE',
          UserId: 'STRING_VALUE',
          VpcId: 'STRING_VALUE',
          VpcPeeringConnectionId: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  IpProtocol: 'STRING_VALUE',
  SourceSecurityGroupName: 'STRING_VALUE',
  SourceSecurityGroupOwnerId: 'STRING_VALUE',
  ToPort: 0
};
ec2.authorizeSecurityGroupEgress(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • GroupId — (String)

      The ID of the security group.

    • IpPermissions — (Array<map>)

      One or more sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.

      • FromPort — (Integer)

        The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • IpProtocol — (String)

        The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).

        [EC2-VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6) allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For 58 (ICMPv6), you can optionally specify a port range; if you don't, traffic for all types and codes is allowed when authorizing rules.

      • IpRanges — (Array<map>)

        One or more IPv4 ranges.

        • CidrIp — (String)

          The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.

        • Description — (String)

          A description for the security group rule that references this IPv4 address range.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

      • Ipv6Ranges — (Array<map>)

        [EC2-VPC only] One or more IPv6 ranges.

        • CidrIpv6 — (String)

          The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.

        • Description — (String)

          A description for the security group rule that references this IPv6 address range.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

      • PrefixListIds — (Array<map>)

        [EC2-VPC only] One or more prefix list IDs for an AWS service. With AuthorizeSecurityGroupEgress, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

        • Description — (String)

          A description for the security group rule that references this prefix list ID.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

        • PrefixListId — (String)

          The ID of the prefix.

      • ToPort — (Integer)

        The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • UserIdGroupPairs — (Array<map>)

        One or more security group and AWS account ID pairs.

        • Description — (String)

          A description for the security group rule that references this user ID group pair.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

        • GroupId — (String)

          The ID of the security group.

        • GroupName — (String)

          The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.

          For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.

        • PeeringStatus — (String)

          The status of a VPC peering connection, if applicable.

        • UserId — (String)

          The ID of an AWS account.

          For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.

          [EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.

        • VpcId — (String)

          The ID of the VPC for the referenced security group, if applicable.

        • VpcPeeringConnectionId — (String)

          The ID of the VPC peering connection, if applicable.

    • CidrIp — (String)

      Not supported. Use a set of IP permissions to specify the CIDR.

    • FromPort — (Integer)

      Not supported. Use a set of IP permissions to specify the port.

    • IpProtocol — (String)

      Not supported. Use a set of IP permissions to specify the protocol name or number.

    • ToPort — (Integer)

      Not supported. Use a set of IP permissions to specify the port.

    • SourceSecurityGroupName — (String)

      Not supported. Use a set of IP permissions to specify a destination security group.

    • SourceSecurityGroupOwnerId — (String)

      Not supported. Use a set of IP permissions to specify a destination security group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

authorizeSecurityGroupIngress(params = {}, callback) ⇒ AWS.Request

Adds one or more ingress rules to a security group.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

[EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission to access a security group in your account, or gives one or more security groups (called the source groups) permission to access a security group for your account. A source group can be for your own AWS account, or another. You can have up to 100 rules per group.

[EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges permission to access a security group in your VPC, or gives one or more other security groups (called the source groups) permission to access a security group for your VPC. The security groups must all be for the same VPC or a peer VPC in a VPC peering connection. For more information about VPC security group limits, see Amazon VPC Limits.

You can optionally specify a description for the security group rule.

Service Reference:

Examples:

To add a rule that allows inbound SSH traffic from an IPv4 address range


/* This example enables inbound traffic on TCP port 22 (SSH). The rule includes a description to help you identify it later. */

 var params = {
  GroupId: "sg-903004f8", 
  IpPermissions: [
     {
    FromPort: 22, 
    IpProtocol: "tcp", 
    IpRanges: [
       {
      CidrIp: "203.0.113.0/24", 
      Description: "SSH access from the LA office"
     }
    ], 
    ToPort: 22
   }
  ]
 };
 ec2.authorizeSecurityGroupIngress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To add a rule that allows inbound HTTP traffic from another security group


/* This example enables inbound traffic on TCP port 80 from the specified security group. The group must be in the same VPC or a peer VPC. Incoming traffic is allowed based on the private IP addresses of instances that are associated with the specified security group. */

 var params = {
  GroupId: "sg-111aaa22", 
  IpPermissions: [
     {
    FromPort: 80, 
    IpProtocol: "tcp", 
    ToPort: 80, 
    UserIdGroupPairs: [
       {
      Description: "HTTP access from other instances", 
      GroupId: "sg-1a2b3c4d"
     }
    ]
   }
  ]
 };
 ec2.authorizeSecurityGroupIngress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

To add a rule that allows inbound RDP traffic from an IPv6 address range


/* This example adds an inbound rule that allows RDP traffic from the specified IPv6 address range. The rule includes a description to help you identify it later. */

 var params = {
  GroupId: "sg-123abc12 ", 
  IpPermissions: [
     {
    FromPort: 3389, 
    IpProtocol: "tcp", 
    Ipv6Ranges: [
       {
      CidrIpv6: "2001:db8:1234:1a00::/64", 
      Description: "RDP access from the NY office"
     }
    ], 
    ToPort: 3389
   }
  ]
 };
 ec2.authorizeSecurityGroupIngress(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the authorizeSecurityGroupIngress operation

var params = {
  CidrIp: 'STRING_VALUE',
  DryRun: true || false,
  FromPort: 0,
  GroupId: 'STRING_VALUE',
  GroupName: 'STRING_VALUE',
  IpPermissions: [
    {
      FromPort: 0,
      IpProtocol: 'STRING_VALUE',
      IpRanges: [
        {
          CidrIp: 'STRING_VALUE',
          Description: 'STRING_VALUE'
        },
        /* more items */
      ],
      Ipv6Ranges: [
        {
          CidrIpv6: 'STRING_VALUE',
          Description: 'STRING_VALUE'
        },
        /* more items */
      ],
      PrefixListIds: [
        {
          Description: 'STRING_VALUE',
          PrefixListId: 'STRING_VALUE'
        },
        /* more items */
      ],
      ToPort: 0,
      UserIdGroupPairs: [
        {
          Description: 'STRING_VALUE',
          GroupId: 'STRING_VALUE',
          GroupName: 'STRING_VALUE',
          PeeringStatus: 'STRING_VALUE',
          UserId: 'STRING_VALUE',
          VpcId: 'STRING_VALUE',
          VpcPeeringConnectionId: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  IpProtocol: 'STRING_VALUE',
  SourceSecurityGroupName: 'STRING_VALUE',
  SourceSecurityGroupOwnerId: 'STRING_VALUE',
  ToPort: 0
};
ec2.authorizeSecurityGroupIngress(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CidrIp — (String)

      The CIDR IPv4 address range. You can't specify this parameter when specifying a source security group.

    • FromPort — (Integer)

      The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. For the ICMP/ICMPv6 type number, use -1 to specify all types. If you specify all ICMP/ICMPv6 types, you must specify all codes.

    • GroupId — (String)

      The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.

    • GroupName — (String)

      [EC2-Classic, default VPC] The name of the security group. You must specify either the security group ID or the security group name in the request.

    • IpPermissions — (Array<map>)

      One or more sets of IP permissions. Can be used to specify multiple rules in a single command.

      • FromPort — (Integer)

        The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • IpProtocol — (String)

        The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).

        [EC2-VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6) allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For 58 (ICMPv6), you can optionally specify a port range; if you don't, traffic for all types and codes is allowed when authorizing rules.

      • IpRanges — (Array<map>)

        One or more IPv4 ranges.

        • CidrIp — (String)

          The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.

        • Description — (String)

          A description for the security group rule that references this IPv4 address range.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

      • Ipv6Ranges — (Array<map>)

        [EC2-VPC only] One or more IPv6 ranges.

        • CidrIpv6 — (String)

          The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.

        • Description — (String)

          A description for the security group rule that references this IPv6 address range.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

      • PrefixListIds — (Array<map>)

        [EC2-VPC only] One or more prefix list IDs for an AWS service. With AuthorizeSecurityGroupEgress, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

        • Description — (String)

          A description for the security group rule that references this prefix list ID.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

        • PrefixListId — (String)

          The ID of the prefix.

      • ToPort — (Integer)

        The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • UserIdGroupPairs — (Array<map>)

        One or more security group and AWS account ID pairs.

        • Description — (String)

          A description for the security group rule that references this user ID group pair.

          Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

        • GroupId — (String)

          The ID of the security group.

        • GroupName — (String)

          The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.

          For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.

        • PeeringStatus — (String)

          The status of a VPC peering connection, if applicable.

        • UserId — (String)

          The ID of an AWS account.

          For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.

          [EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.

        • VpcId — (String)

          The ID of the VPC for the referenced security group, if applicable.

        • VpcPeeringConnectionId — (String)

          The ID of the VPC peering connection, if applicable.

    • IpProtocol — (String)

      The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). (VPC only) Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don't, traffic for all types and codes is allowed.

    • SourceSecurityGroupName — (String)

      [EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set of IP permissions instead. For EC2-VPC, the source security group must be in the same VPC.

    • SourceSecurityGroupOwnerId — (String)

      [EC2-Classic] The AWS account ID for the source security group, if the source security group is in a different account. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set of IP permissions instead.

    • ToPort — (Integer)

      The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code number. For the ICMP/ICMPv6 code number, use -1 to specify all codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

bundleInstance(params = {}, callback) ⇒ AWS.Request

Bundles an Amazon instance store-backed Windows instance.

During bundling, only the root device volume (C:) is bundled. Data on other instance store volumes is not preserved.

Note: This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.

Service Reference:

Examples:

Calling the bundleInstance operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  Storage: { /* required */
    S3: {
      AWSAccessKeyId: 'STRING_VALUE',
      Bucket: 'STRING_VALUE',
      Prefix: 'STRING_VALUE',
      UploadPolicy: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      UploadPolicySignature: 'STRING_VALUE'
    }
  },
  DryRun: true || false
};
ec2.bundleInstance(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceId — (String)

      The ID of the instance to bundle.

      Type: String

      Default: None

      Required: Yes

    • Storage — (map)

      The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

      • S3 — (map)

        An Amazon S3 storage location.

        • AWSAccessKeyId — (String)

          The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

        • Bucket — (String)

          The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

        • Prefix — (String)

          The beginning of the file name of the AMI.

        • UploadPolicy — (Buffer, Typed Array, Blob, String)

          An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

        • UploadPolicySignature — (String)

          The signature of the JSON document.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • BundleTask — (map)

        Information about the bundle task.

        • BundleId — (String)

          The ID of the bundle task.

        • BundleTaskError — (map)

          If the task fails, a description of the error.

          • Code — (String)

            The error code.

          • Message — (String)

            The error message.

        • InstanceId — (String)

          The ID of the instance associated with this bundle task.

        • Progress — (String)

          The level of task completion, as a percent (for example, 20%).

        • StartTime — (Date)

          The time this task started.

        • State — (String)

          The state of the task.

          Possible values include:
          • "pending"
          • "waiting-for-shutdown"
          • "bundling"
          • "storing"
          • "cancelling"
          • "complete"
          • "failed"
        • Storage — (map)

          The Amazon S3 storage locations.

          • S3 — (map)

            An Amazon S3 storage location.

            • AWSAccessKeyId — (String)

              The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

            • Bucket — (String)

              The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

            • Prefix — (String)

              The beginning of the file name of the AMI.

            • UploadPolicy — (Buffer, Typed Array, Blob, String)

              An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

            • UploadPolicySignature — (String)

              The signature of the JSON document.

        • UpdateTime — (Date)

          The time of the most recent update for the task.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelBundleTask(params = {}, callback) ⇒ AWS.Request

Cancels a bundling operation for an instance store-backed Windows instance.

Service Reference:

Examples:

Calling the cancelBundleTask operation

var params = {
  BundleId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.cancelBundleTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • BundleId — (String)

      The ID of the bundle task.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • BundleTask — (map)

        Information about the bundle task.

        • BundleId — (String)

          The ID of the bundle task.

        • BundleTaskError — (map)

          If the task fails, a description of the error.

          • Code — (String)

            The error code.

          • Message — (String)

            The error message.

        • InstanceId — (String)

          The ID of the instance associated with this bundle task.

        • Progress — (String)

          The level of task completion, as a percent (for example, 20%).

        • StartTime — (Date)

          The time this task started.

        • State — (String)

          The state of the task.

          Possible values include:
          • "pending"
          • "waiting-for-shutdown"
          • "bundling"
          • "storing"
          • "cancelling"
          • "complete"
          • "failed"
        • Storage — (map)

          The Amazon S3 storage locations.

          • S3 — (map)

            An Amazon S3 storage location.

            • AWSAccessKeyId — (String)

              The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

            • Bucket — (String)

              The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

            • Prefix — (String)

              The beginning of the file name of the AMI.

            • UploadPolicy — (Buffer, Typed Array, Blob, String)

              An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

            • UploadPolicySignature — (String)

              The signature of the JSON document.

        • UpdateTime — (Date)

          The time of the most recent update for the task.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelCapacityReservation(params = {}, callback) ⇒ AWS.Request

Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity Reservation's state to cancelled.

Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.

Service Reference:

Examples:

Calling the cancelCapacityReservation operation

var params = {
  CapacityReservationId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.cancelCapacityReservation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CapacityReservationId — (String)

      The ID of the Capacity Reservation to be cancelled.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Returns true if the request succeeds; otherwise, it returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelConversionTask(params = {}, callback) ⇒ AWS.Request

Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final disk image, the command fails and returns an exception.

For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI.

Service Reference:

Examples:

Calling the cancelConversionTask operation

var params = {
  ConversionTaskId: 'STRING_VALUE', /* required */
  DryRun: true || false,
  ReasonMessage: 'STRING_VALUE'
};
ec2.cancelConversionTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ConversionTaskId — (String)

      The ID of the conversion task.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ReasonMessage — (String)

      The reason for canceling the conversion task.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelExportTask(params = {}, callback) ⇒ AWS.Request

Cancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.

Service Reference:

Examples:

Calling the cancelExportTask operation

var params = {
  ExportTaskId: 'STRING_VALUE' /* required */
};
ec2.cancelExportTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ExportTaskId — (String)

      The ID of the export task. This is the ID returned by CreateInstanceExportTask.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelImportTask(params = {}, callback) ⇒ AWS.Request

Cancels an in-process import virtual machine or import snapshot task.

Service Reference:

Examples:

Calling the cancelImportTask operation

var params = {
  CancelReason: 'STRING_VALUE',
  DryRun: true || false,
  ImportTaskId: 'STRING_VALUE'
};
ec2.cancelImportTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CancelReason — (String)

      The reason for canceling the task.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ImportTaskId — (String)

      The ID of the import image or import snapshot task to be canceled.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ImportTaskId — (String)

        The ID of the task being canceled.

      • PreviousState — (String)

        The current state of the task being canceled.

      • State — (String)

        The current state of the task being canceled.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelReservedInstancesListing(params = {}, callback) ⇒ AWS.Request

Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the cancelReservedInstancesListing operation

var params = {
  ReservedInstancesListingId: 'STRING_VALUE' /* required */
};
ec2.cancelReservedInstancesListing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ReservedInstancesListingId — (String)

      The ID of the Reserved Instance listing.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ReservedInstancesListings — (Array<map>)

        The Reserved Instance listing.

        • ClientToken — (String)

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

        • CreateDate — (Date)

          The time the listing was created.

        • InstanceCounts — (Array<map>)

          The number of instances in this state.

          • InstanceCount — (Integer)

            The number of listed Reserved Instances in the state specified by the state.

          • State — (String)

            The states of the listed Reserved Instances.

            Possible values include:
            • "available"
            • "sold"
            • "cancelled"
            • "pending"
        • PriceSchedules — (Array<map>)

          The price of the Reserved Instance listing.

          • Active — (Boolean)

            The current price schedule, as determined by the term remaining for the Reserved Instance in the listing.

            A specific price schedule is always in effect, but only one price schedule can be active at any time. Take, for example, a Reserved Instance listing that has five months remaining in its term. When you specify price schedules for five months and two months, this means that schedule 1, covering the first three months of the remaining term, will be active during months 5, 4, and 3. Then schedule 2, covering the last two months of the term, will be active for months 2 and 1.

          • CurrencyCode — (String)

            The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

            Possible values include:
            • "USD"
          • Price — (Float)

            The fixed price for the term.

          • Term — (Integer)

            The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.

        • ReservedInstancesId — (String)

          The ID of the Reserved Instance.

        • ReservedInstancesListingId — (String)

          The ID of the Reserved Instance listing.

        • Status — (String)

          The status of the Reserved Instance listing.

          Possible values include:
          • "active"
          • "pending"
          • "cancelled"
          • "closed"
        • StatusMessage — (String)

          The reason for the current status of the Reserved Instance listing. The response can be blank.

        • Tags — (Array<map>)

          Any tags assigned to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • UpdateDate — (Date)

          The last modified timestamp of the listing.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelSpotFleetRequests(params = {}, callback) ⇒ AWS.Request

Cancels the specified Spot Fleet requests.

After you cancel a Spot Fleet request, the Spot Fleet launches no new Spot Instances. You must specify whether the Spot Fleet should also terminate its Spot Instances. If you terminate the instances, the Spot Fleet request enters the cancelled_terminating state. Otherwise, the Spot Fleet request enters the cancelled_running state and the instances continue to run until they are interrupted or you terminate them manually.

Service Reference:

Examples:

To cancel a Spot fleet request


/* This example cancels the specified Spot fleet request and terminates its associated Spot Instances. */

 var params = {
  SpotFleetRequestIds: [
     "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
  ], 
  TerminateInstances: true
 };
 ec2.cancelSpotFleetRequests(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SuccessfulFleetRequests: [
       {
      CurrentSpotFleetRequestState: "cancelled_running", 
      PreviousSpotFleetRequestState: "active", 
      SpotFleetRequestId: "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
     }
    ]
   }
   */
 });

To cancel a Spot fleet request without terminating its Spot Instances


/* This example cancels the specified Spot fleet request without terminating its associated Spot Instances. */

 var params = {
  SpotFleetRequestIds: [
     "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
  ], 
  TerminateInstances: false
 };
 ec2.cancelSpotFleetRequests(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SuccessfulFleetRequests: [
       {
      CurrentSpotFleetRequestState: "cancelled_terminating", 
      PreviousSpotFleetRequestState: "active", 
      SpotFleetRequestId: "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
     }
    ]
   }
   */
 });

Calling the cancelSpotFleetRequests operation

var params = {
  SpotFleetRequestIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  TerminateInstances: true || false, /* required */
  DryRun: true || false
};
ec2.cancelSpotFleetRequests(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • SpotFleetRequestIds — (Array<String>)

      The IDs of the Spot Fleet requests.

    • TerminateInstances — (Boolean)

      Indicates whether to terminate instances for a Spot Fleet request if it is canceled successfully.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SuccessfulFleetRequests — (Array<map>)

        Information about the Spot Fleet requests that are successfully canceled.

        • CurrentSpotFleetRequestStaterequired — (String)

          The current state of the Spot Fleet request.

          Possible values include:
          • "submitted"
          • "active"
          • "cancelled"
          • "failed"
          • "cancelled_running"
          • "cancelled_terminating"
          • "modifying"
        • PreviousSpotFleetRequestStaterequired — (String)

          The previous state of the Spot Fleet request.

          Possible values include:
          • "submitted"
          • "active"
          • "cancelled"
          • "failed"
          • "cancelled_running"
          • "cancelled_terminating"
          • "modifying"
        • SpotFleetRequestIdrequired — (String)

          The ID of the Spot Fleet request.

      • UnsuccessfulFleetRequests — (Array<map>)

        Information about the Spot Fleet requests that are not successfully canceled.

        • Errorrequired — (map)

          The error.

          • Coderequired — (String)

            The error code.

            Possible values include:
            • "fleetRequestIdDoesNotExist"
            • "fleetRequestIdMalformed"
            • "fleetRequestNotInCancellableState"
            • "unexpectedError"
          • Messagerequired — (String)

            The description for the error code.

        • SpotFleetRequestIdrequired — (String)

          The ID of the Spot Fleet request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelSpotInstanceRequests(params = {}, callback) ⇒ AWS.Request

Cancels one or more Spot Instance requests.

Canceling a Spot Instance request does not terminate running Spot Instances associated with the request.

Service Reference:

Examples:

To cancel Spot Instance requests


/* This example cancels a Spot Instance request. */

 var params = {
  SpotInstanceRequestIds: [
     "sir-08b93456"
  ]
 };
 ec2.cancelSpotInstanceRequests(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    CancelledSpotInstanceRequests: [
       {
      SpotInstanceRequestId: "sir-08b93456", 
      State: "cancelled"
     }
    ]
   }
   */
 });

Calling the cancelSpotInstanceRequests operation

var params = {
  SpotInstanceRequestIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.cancelSpotInstanceRequests(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • SpotInstanceRequestIds — (Array<String>)

      One or more Spot Instance request IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CancelledSpotInstanceRequests — (Array<map>)

        One or more Spot Instance requests.

        • SpotInstanceRequestId — (String)

          The ID of the Spot Instance request.

        • State — (String)

          The state of the Spot Instance request.

          Possible values include:
          • "active"
          • "open"
          • "closed"
          • "cancelled"
          • "completed"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

confirmProductInstance(params = {}, callback) ⇒ AWS.Request

Determines whether a product code is associated with an instance. This action can only be used by the owner of the product code. It is useful when a product code owner must verify whether another user's instance is eligible for support.

Service Reference:

Examples:

To confirm the product instance


/* This example determines whether the specified product code is associated with the specified instance. */

 var params = {
  InstanceId: "i-1234567890abcdef0", 
  ProductCode: "774F4FF8"
 };
 ec2.confirmProductInstance(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OwnerId: "123456789012"
   }
   */
 });

Calling the confirmProductInstance operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  ProductCode: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.confirmProductInstance(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • InstanceId — (String)

      The ID of the instance.

    • ProductCode — (String)

      The product code. This must be a product code that you own.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • OwnerId — (String)

        The AWS account ID of the instance owner. This is only present if the product code is attached to the instance.

      • Return — (Boolean)

        The return value of the request. Returns true if the specified product code is owned by the requester and associated with the specified instance.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

copyFpgaImage(params = {}, callback) ⇒ AWS.Request

Copies the specified Amazon FPGA Image (AFI) to the current region.

Service Reference:

Examples:

Calling the copyFpgaImage operation

var params = {
  SourceFpgaImageId: 'STRING_VALUE', /* required */
  SourceRegion: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DryRun: true || false,
  Name: 'STRING_VALUE'
};
ec2.copyFpgaImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • SourceFpgaImageId — (String)

      The ID of the source AFI.

    • Description — (String)

      The description for the new AFI.

    • Name — (String)

      The name for the new AFI. The default is the name of the source AFI.

    • SourceRegion — (String)

      The region that contains the source AFI.

    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • FpgaImageId — (String)

        The ID of the new AFI.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

copyImage(params = {}, callback) ⇒ AWS.Request

Initiates the copy of an AMI from the specified source region to the current region. You specify the destination region by using its endpoint when making the request.

Copies of encrypted backing snapshots for the AMI are encrypted. Copies of unencrypted backing snapshots remain unencrypted, unless you set Encrypted during the copy operation. You cannot create an unencrypted copy of an encrypted backing snapshot.

For more information about the prerequisites and limits when copying an AMI, see Copying an AMI in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To copy an AMI to another region


/* This example copies the specified AMI from the us-east-1 region to the current region. */

 var params = {
  Description: "", 
  Name: "My server", 
  SourceImageId: "ami-5731123e", 
  SourceRegion: "us-east-1"
 };
 ec2.copyImage(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ImageId: "ami-438bea42"
   }
   */
 });

Calling the copyImage operation

var params = {
  Name: 'STRING_VALUE', /* required */
  SourceImageId: 'STRING_VALUE', /* required */
  SourceRegion: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DryRun: true || false,
  Encrypted: true || false,
  KmsKeyId: 'STRING_VALUE'
};
ec2.copyImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

    • Description — (String)

      A description for the new AMI in the destination region.

    • Encrypted — (Boolean)

      Specifies whether the destination snapshots of the copied image should be encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK using KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

    • KmsKeyId — (String)

      An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.

      The CMK identifier may be provided in any of the following formats:

      • Key ID

      • Key alias, in the form alias/ExampleAlias

      • ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

      • ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

      AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.

      The specified CMK must exist in the region that the snapshot is being copied to.

    • Name — (String)

      The name of the new AMI in the destination region.

    • SourceImageId — (String)

      The ID of the AMI to copy.

    • SourceRegion — (String)

      The name of the region that contains the AMI to copy.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ImageId — (String)

        The ID of the new AMI.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

copySnapshot(params = {}, callback) ⇒ AWS.Request

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same region or from one region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.

Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless the Encrypted flag is specified during the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a non-default CMK with the KmsKeyId parameter.

To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.

Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any purpose.

For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To copy a snapshot


/* This example copies a snapshot with the snapshot ID of ``snap-066877671789bd71b`` from the ``us-west-2`` region to the ``us-east-1`` region and adds a short description to identify the snapshot. */

 var params = {
  Description: "This is my copied snapshot.", 
  DestinationRegion: "us-east-1", 
  SourceRegion: "us-west-2", 
  SourceSnapshotId: "snap-066877671789bd71b"
 };
 ec2.copySnapshot(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SnapshotId: "snap-066877671789bd71b"
   }
   */
 });

Calling the copySnapshot operation

var params = {
  SourceRegion: 'STRING_VALUE', /* required */
  SourceSnapshotId: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE',
  DestinationRegion: 'STRING_VALUE',
  DryRun: true || false,
  Encrypted: true || false,
  KmsKeyId: 'STRING_VALUE',
  PresignedUrl: 'STRING_VALUE'
};
ec2.copySnapshot(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Description — (String)

      A description for the EBS snapshot.

    • DestinationRegion — (String)

      The destination region to use in the PresignedUrl parameter of a snapshot copy operation. This parameter is only valid for specifying the destination region in a PresignedUrl parameter, where it is required.

      The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, ec2.us-east-1.amazonaws.com). With the AWS CLI, this is specified using the --region parameter or the default region in your AWS configuration file.

    • Encrypted — (Boolean)

      Specifies whether the destination snapshot should be encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot use it to create an unencrypted copy of an encrypted snapshot. Your default CMK for EBS is used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK using KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

    • KmsKeyId — (String)

      An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.

      The CMK identifier may be provided in any of the following formats:

      • Key ID

      • Key alias

      • ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

      • ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

      AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. The action will eventually fail.

    • PresignedUrl — (String)

      When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see Query Requests.

      The PresignedUrl should use the snapshot source endpoint, the CopySnapshot action, and include the SourceRegion, SourceSnapshotId, and DestinationRegion parameters. The PresignedUrl must be signed using AWS Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in Authenticating Requests by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service API Reference. An invalid or improperly signed PresignedUrl will cause the copy operation to fail asynchronously, and the snapshot will move to an error state.

    • SourceRegion — (String)

      The ID of the region that contains the snapshot to be copied.

    • SourceSnapshotId — (String)

      The ID of the EBS snapshot to copy.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SnapshotId — (String)

        The ID of the new snapshot.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createCapacityReservation(params = {}, callback) ⇒ AWS.Request

Creates a new Capacity Reservation with the specified attributes.

Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. This gives you the flexibility to selectively add capacity reservations and still get the Regional RI discounts for that usage. By creating Capacity Reservations, you ensure that you always have access to Amazon EC2 capacity when you need it, for as long as you need it. For more information, see Capacity Reservations in the Amazon Elastic Compute Cloud User Guide.

Your request to create a Capacity Reservation could fail if Amazon EC2 does not have sufficient capacity to fulfill the request. If your request fails due to Amazon EC2 capacity constraints, either try again at a later time, try in a different Availability Zone, or request a smaller capacity reservation. If your application is flexible across instance types and sizes, try to create a Capacity Reservation with different instance attributes.

Your request could also fail if the requested quantity exceeds your On-Demand Instance limit for the selected instance type. If your request fails due to limit constraints, increase your On-Demand Instance limit for the required instance type and try again. For more information about increasing your instance limits, see Amazon EC2 Service Limits in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the createCapacityReservation operation

var params = {
  AvailabilityZone: 'STRING_VALUE', /* required */
  InstanceCount: 0, /* required */
  InstancePlatform: Linux/UNIX | Red Hat Enterprise Linux | SUSE Linux | Windows | Windows with SQL Server | Windows with SQL Server Enterprise | Windows with SQL Server Standard | Windows with SQL Server Web, /* required */
  InstanceType: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  EbsOptimized: true || false,
  EndDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  EndDateType: unlimited | limited,
  EphemeralStorage: true || false,
  InstanceMatchCriteria: open | targeted,
  TagSpecifications: [
    {
      ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  Tenancy: default | dedicated
};
ec2.createCapacityReservation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

      Constraint: Maximum 64 ASCII characters.

    • InstanceType — (String)

      The instance type for which to reserve capacity. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

    • InstancePlatform — (String)

      The type of operating system for which to reserve capacity.

      Possible values include:
      • "Linux/UNIX"
      • "Red Hat Enterprise Linux"
      • "SUSE Linux"
      • "Windows"
      • "Windows with SQL Server"
      • "Windows with SQL Server Enterprise"
      • "Windows with SQL Server Standard"
      • "Windows with SQL Server Web"
    • AvailabilityZone — (String)

      The Availability Zone in which to create the Capacity Reservation.

    • Tenancy — (String)

      Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:

      • default - The Capacity Reservation is created on hardware that is shared with other AWS accounts.

      • dedicated - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account.

      Possible values include:
      • "default"
      • "dedicated"
    • InstanceCount — (Integer)

      The number of instances for which to reserve capacity.

    • EbsOptimized — (Boolean)

      Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.

    • EphemeralStorage — (Boolean)

      Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

    • EndDate — (Date)

      The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.

      You must provide an EndDate value if EndDateType is limited. Omit EndDate if EndDateType is unlimited.

      If the EndDateType is limited, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.

    • EndDateType — (String)

      Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:

      • unlimited - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an EndDate if the EndDateType is unlimited.

      • limited - The Capacity Reservation expires automatically at a specified date and time. You must provide an EndDate value if the EndDateType value is limited.

      Possible values include:
      • "unlimited"
      • "limited"
    • InstanceMatchCriteria — (String)

      Indicates the type of instance launches that the Capacity Reservation accepts. The options include:

      • open - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.

      • targeted - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.

      Default: open

      Possible values include:
      • "open"
      • "targeted"
    • TagSpecifications — (Array<map>)

      The tags to apply to the Capacity Reservation during launch.

      • ResourceType — (String)

        The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

        Possible values include:
        • "customer-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "image"
        • "instance"
        • "internet-gateway"
        • "network-acl"
        • "network-interface"
        • "reserved-instances"
        • "route-table"
        • "snapshot"
        • "spot-instances-request"
        • "subnet"
        • "security-group"
        • "volume"
        • "vpc"
        • "vpn-connection"
        • "vpn-gateway"
      • Tags — (Array<map>)

        The tags to apply to the resource.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CapacityReservation — (map)

        Information about the Capacity Reservation.

        • CapacityReservationId — (String)

          The ID of the Capacity Reservation.

        • InstanceType — (String)

          The type of instance for which the Capacity Reservation reserves capacity.

        • InstancePlatform — (String)

          The type of operating system for which the Capacity Reservation reserves capacity.

          Possible values include:
          • "Linux/UNIX"
          • "Red Hat Enterprise Linux"
          • "SUSE Linux"
          • "Windows"
          • "Windows with SQL Server"
          • "Windows with SQL Server Enterprise"
          • "Windows with SQL Server Standard"
          • "Windows with SQL Server Web"
        • AvailabilityZone — (String)

          The Availability Zone in which the capacity is reserved.

        • Tenancy — (String)

          Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:

          • default - The Capacity Reservation is created on hardware that is shared with other AWS accounts.

          • dedicated - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account.

          Possible values include:
          • "default"
          • "dedicated"
        • TotalInstanceCount — (Integer)

          The number of instances for which the Capacity Reservation reserves capacity.

        • AvailableInstanceCount — (Integer)

          The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.

        • EbsOptimized — (Boolean)

          Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.

        • EphemeralStorage — (Boolean)

          Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

        • State — (String)

          The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:

          • active - The Capacity Reservation is active and the capacity is available for your use.

          • cancelled - The Capacity Reservation expired automatically at the date and time specified in your request. The reserved capacity is no longer available for your use.

          • expired - The Capacity Reservation was manually cancelled. The reserved capacity is no longer available for your use.

          • pending - The Capacity Reservation request was successful but the capacity provisioning is still pending.

          • failed - The Capacity Reservation request has failed. A request might fail due to invalid request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.

          Possible values include:
          • "active"
          • "expired"
          • "cancelled"
          • "pending"
          • "failed"
        • EndDate — (Date)

          The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.

        • EndDateType — (String)

          Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:

          • unlimited - The Capacity Reservation remains active until you explicitly cancel it.

          • limited - The Capacity Reservation expires automatically at a specified date and time.

          Possible values include:
          • "unlimited"
          • "limited"
        • InstanceMatchCriteria — (String)

          Indicates the type of instance launches that the Capacity Reservation accepts. The options include:

          • open - The Capacity Reservation accepts all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation automatically without specifying any additional parameters.

          • targeted - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.

          Possible values include:
          • "open"
          • "targeted"
        • CreateDate — (Date)

          The date and time at which the Capacity Reservation was created.

        • Tags — (Array<map>)

          Any tags assigned to the Capacity Reservation.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createCustomerGateway(params = {}, callback) ⇒ AWS.Request

Provides information to AWS about your VPN customer gateway device. The customer gateway is the appliance at your end of the VPN connection. (The device on the AWS side of the VPN connection is the virtual private gateway.) You must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must be static and may be behind a device performing network address translation (NAT).

For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use a private ASN (in the 64512 - 65534 range).

Note: Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of 7224, which is reserved in the us-east-1 region, and 9059, which is reserved in the eu-west-1 region.

For more information about VPN customer gateways, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

You cannot create more than one customer gateway with the same VPN type, IP address, and BGP ASN parameter values. If you run an identical request more than one time, the first request creates the customer gateway, and subsequent requests return information about the existing customer gateway. The subsequent requests do not create new customer gateway resources.

Service Reference:

Examples:

To create a customer gateway


/* This example creates a customer gateway with the specified IP address for its outside interface. */

 var params = {
  BgpAsn: 65534, 
  PublicIp: "12.1.2.3", 
  Type: "ipsec.1"
 };
 ec2.createCustomerGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    CustomerGateway: {
     BgpAsn: "65534", 
     CustomerGatewayId: "cgw-0e11f167", 
     IpAddress: "12.1.2.3", 
     State: "available", 
     Type: "ipsec.1"
    }
   }
   */
 });

Calling the createCustomerGateway operation

var params = {
  BgpAsn: 0, /* required */
  PublicIp: 'STRING_VALUE', /* required */
  Type: ipsec.1, /* required */
  DryRun: true || false
};
ec2.createCustomerGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • BgpAsn — (Integer)

      For devices that support BGP, the customer gateway's BGP ASN.

      Default: 65000

    • PublicIp — (String)

      The Internet-routable IP address for the customer gateway's outside interface. The address must be static.

    • Type — (String)

      The type of VPN connection that this customer gateway supports (ipsec.1).

      Possible values include:
      • "ipsec.1"
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CustomerGateway — (map)

        Information about the customer gateway.

        • BgpAsn — (String)

          The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

        • CustomerGatewayId — (String)

          The ID of the customer gateway.

        • IpAddress — (String)

          The Internet-routable IP address of the customer gateway's outside interface.

        • State — (String)

          The current state of the customer gateway (pending | available | deleting | deleted).

        • Type — (String)

          The type of VPN connection the customer gateway supports (ipsec.1).

        • Tags — (Array<map>)

          Any tags assigned to the customer gateway.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDefaultSubnet(params = {}, callback) ⇒ AWS.Request

Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see Creating a Default Subnet in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the createDefaultSubnet operation

var params = {
  AvailabilityZone: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.createDefaultSubnet(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AvailabilityZone — (String)

      The Availability Zone in which to create the default subnet.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Subnet — (map)

        Information about the subnet.

        • AvailabilityZone — (String)

          The Availability Zone of the subnet.

        • AvailableIpAddressCount — (Integer)

          The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.

        • CidrBlock — (String)

          The IPv4 CIDR block assigned to the subnet.

        • DefaultForAz — (Boolean)

          Indicates whether this is the default subnet for the Availability Zone.

        • MapPublicIpOnLaunch — (Boolean)

          Indicates whether instances launched in this subnet receive a public IPv4 address.

        • State — (String)

          The current state of the subnet.

          Possible values include:
          • "pending"
          • "available"
        • SubnetId — (String)

          The ID of the subnet.

        • VpcId — (String)

          The ID of the VPC the subnet is in.

        • AssignIpv6AddressOnCreation — (Boolean)

          Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives an IPv6 address.

        • Ipv6CidrBlockAssociationSet — (Array<map>)

          Information about the IPv6 CIDR blocks associated with the subnet.

          • AssociationId — (String)

            The association ID for the CIDR block.

          • Ipv6CidrBlock — (String)

            The IPv6 CIDR block.

          • Ipv6CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of a CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • Tags — (Array<map>)

          Any tags assigned to the subnet.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDefaultVpc(params = {}, callback) ⇒ AWS.Request

Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet in each Availability Zone. For more information about the components of a default VPC, see Default VPC and Default Subnets in the Amazon Virtual Private Cloud User Guide. You cannot specify the components of the default VPC yourself.

If you deleted your previous default VPC, you can create a default VPC. You cannot have more than one default VPC per Region.

If your account supports EC2-Classic, you cannot use this action to create a default VPC in a Region that supports EC2-Classic. If you want a default VPC in a Region that supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ.

Service Reference:

Examples:

Calling the createDefaultVpc operation

var params = {
  DryRun: true || false
};
ec2.createDefaultVpc(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Vpc — (map)

        Information about the VPC.

        • CidrBlock — (String)

          The primary IPv4 CIDR block for the VPC.

        • DhcpOptionsId — (String)

          The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).

        • State — (String)

          The current state of the VPC.

          Possible values include:
          • "pending"
          • "available"
        • VpcId — (String)

          The ID of the VPC.

        • InstanceTenancy — (String)

          The allowed tenancy of instances launched into the VPC.

          Possible values include:
          • "default"
          • "dedicated"
          • "host"
        • Ipv6CidrBlockAssociationSet — (Array<map>)

          Information about the IPv6 CIDR blocks associated with the VPC.

          • AssociationId — (String)

            The association ID for the IPv6 CIDR block.

          • Ipv6CidrBlock — (String)

            The IPv6 CIDR block.

          • Ipv6CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of the CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • CidrBlockAssociationSet — (Array<map>)

          Information about the IPv4 CIDR blocks associated with the VPC.

          • AssociationId — (String)

            The association ID for the IPv4 CIDR block.

          • CidrBlock — (String)

            The IPv4 CIDR block.

          • CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of the CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • IsDefault — (Boolean)

          Indicates whether the VPC is the default VPC.

        • Tags — (Array<map>)

          Any tags assigned to the VPC.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDhcpOptions(params = {}, callback) ⇒ AWS.Request

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. ITo have your instance to receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers to a custom DNS server.

  • 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). This value is used to complete unqualified DNS hostnames. 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, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a DHCP options set


/* This example creates a DHCP options set. */

 var params = {
  DhcpConfigurations: [
     {
    Key: "domain-name-servers", 
    Values: [
       "10.2.5.1", 
       "10.2.5.2"
    ]
   }
  ]
 };
 ec2.createDhcpOptions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    DhcpOptions: {
     DhcpConfigurations: [
        {
       Key: "domain-name-servers", 
       Values: [
          {
         Value: "10.2.5.2"
        }, 
          {
         Value: "10.2.5.1"
        }
       ]
      }
     ], 
     DhcpOptionsId: "dopt-d9070ebb"
    }
   }
   */
 });

Calling the createDhcpOptions operation

var params = {
  DhcpConfigurations: [ /* required */
    {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  DryRun: true || false
};
ec2.createDhcpOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DhcpConfigurations — (Array<map>)

      A DHCP configuration option.

      • Key — (String)
      • Values — (Array<String>)
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DhcpOptions — (map)

        A set of DHCP options.

        • DhcpConfigurations — (Array<map>)

          One or more DHCP options in the set.

          • Key — (String)

            The name of a DHCP option.

          • Values — (Array<map>)

            One or more values for the DHCP option.

            • Value — (String)

              The attribute value. The value is case-sensitive.

        • DhcpOptionsId — (String)

          The ID of the set of DHCP options.

        • Tags — (Array<map>)

          Any tags assigned to the DHCP options set.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createEgressOnlyInternetGateway(params = {}, callback) ⇒ AWS.Request

[IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.

Service Reference:

Examples:

Calling the createEgressOnlyInternetGateway operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false
};
ec2.createEgressOnlyInternetGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcId — (String)

      The ID of the VPC for which to create the egress-only internet gateway.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ClientToken — (String)

        Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

      • EgressOnlyInternetGateway — (map)

        Information about the egress-only internet gateway.

        • Attachments — (Array<map>)

          Information about the attachment of the egress-only internet gateway.

          • State — (String)

            The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.

            Possible values include:
            • "attaching"
            • "attached"
            • "detaching"
            • "detached"
          • VpcId — (String)

            The ID of the VPC.

        • EgressOnlyInternetGatewayId — (String)

          The ID of the egress-only internet gateway.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createFleet(params = {}, callback) ⇒ AWS.Request

Launches an EC2 Fleet.

You can create a single EC2 Fleet that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.

For more information, see Launching an EC2 Fleet in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the createFleet operation

var params = {
  LaunchTemplateConfigs: [ /* required */
    {
      LaunchTemplateSpecification: {
        LaunchTemplateId: 'STRING_VALUE',
        LaunchTemplateName: 'STRING_VALUE',
        Version: 'STRING_VALUE'
      },
      Overrides: [
        {
          AvailabilityZone: 'STRING_VALUE',
          InstanceType: t1.micro | t2.nano | t2.micro | t2.small | t2.medium | t2.large | t2.xlarge | t2.2xlarge | t3.nano | t3.micro | t3.small | t3.medium | t3.large | t3.xlarge | t3.2xlarge | m1.small | m1.medium | m1.large | m1.xlarge | m3.medium | m3.large | m3.xlarge | m3.2xlarge | m4.large | m4.xlarge | m4.2xlarge | m4.4xlarge | m4.10xlarge | m4.16xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cr1.8xlarge | r3.large | r3.xlarge | r3.2xlarge | r3.4xlarge | r3.8xlarge | r4.large | r4.xlarge | r4.2xlarge | r4.4xlarge | r4.8xlarge | r4.16xlarge | r5.large | r5.xlarge | r5.2xlarge | r5.4xlarge | r5.8xlarge | r5.12xlarge | r5.16xlarge | r5.24xlarge | r5.metal | r5a.large | r5a.xlarge | r5a.2xlarge | r5a.4xlarge | r5a.12xlarge | r5a.24xlarge | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | x1.16xlarge | x1.32xlarge | x1e.xlarge | x1e.2xlarge | x1e.4xlarge | x1e.8xlarge | x1e.16xlarge | x1e.32xlarge | i2.xlarge | i2.2xlarge | i2.4xlarge | i2.8xlarge | i3.large | i3.xlarge | i3.2xlarge | i3.4xlarge | i3.8xlarge | i3.16xlarge | i3.metal | hi1.4xlarge | hs1.8xlarge | c1.medium | c1.xlarge | c3.large | c3.xlarge | c3.2xlarge | c3.4xlarge | c3.8xlarge | c4.large | c4.xlarge | c4.2xlarge | c4.4xlarge | c4.8xlarge | c5.large | c5.xlarge | c5.2xlarge | c5.4xlarge | c5.9xlarge | c5.18xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.18xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4xlarge | g3.8xlarge | g3.16xlarge | g3s.xlarge | cg1.4xlarge | p2.xlarge | p2.8xlarge | p2.16xlarge | p3.2xlarge | p3.8xlarge | p3.16xlarge | d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge | f1.2xlarge | f1.4xlarge | f1.16xlarge | m5.large | m5.xlarge | m5.2xlarge | m5.4xlarge | m5.12xlarge | m5.24xlarge | m5a.large | m5a.xlarge | m5a.2xlarge | m5a.4xlarge | m5a.12xlarge | m5a.24xlarge | m5d.large | m5d.xlarge | m5d.2xlarge | m5d.4xlarge | m5d.12xlarge | m5d.24xlarge | h1.2xlarge | h1.4xlarge | h1.8xlarge | h1.16xlarge | z1d.large | z1d.xlarge | z1d.2xlarge | z1d.3xlarge | z1d.6xlarge | z1d.12xlarge | u-6tb1.metal | u-9tb1.metal | u-12tb1.metal,
          MaxPrice: 'STRING_VALUE',
          Placement: {
            Affinity: 'STRING_VALUE',
            AvailabilityZone: 'STRING_VALUE',
            GroupName: 'STRING_VALUE',
            HostId: 'STRING_VALUE',
            SpreadDomain: 'STRING_VALUE',
            Tenancy: default | dedicated | host
          },
          Priority: 0.0,
          SubnetId: 'STRING_VALUE',
          WeightedCapacity: 0.0
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  TargetCapacitySpecification: { /* required */
    TotalTargetCapacity: 0, /* required */
    DefaultTargetCapacityType: spot | on-demand,
    OnDemandTargetCapacity: 0,
    SpotTargetCapacity: 0
  },
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  ExcessCapacityTerminationPolicy: no-termination | termination,
  OnDemandOptions: {
    AllocationStrategy: lowest-price | prioritized,
    MinTargetCapacity: 0,
    SingleInstanceType: true || false
  },
  ReplaceUnhealthyInstances: true || false,
  SpotOptions: {
    AllocationStrategy: lowest-price | diversified,
    InstanceInterruptionBehavior: hibernate | stop | terminate,
    InstancePoolsToUseCount: 0,
    MinTargetCapacity: 0,
    SingleInstanceType: true || false
  },
  TagSpecifications: [
    {
      ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  TerminateInstancesWithExpiration: true || false,
  Type: request | maintain | instant,
  ValidFrom: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  ValidUntil: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
};
ec2.createFleet(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

    • SpotOptions — (map)

      Describes the configuration of Spot Instances in an EC2 Fleet.

      • AllocationStrategy — (String)

        Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice.

        Possible values include:
        • "lowest-price"
        • "diversified"
      • InstanceInterruptionBehavior — (String)

        The behavior when a Spot Instance is interrupted. The default is terminate.

        Possible values include:
        • "hibernate"
        • "stop"
        • "terminate"
      • InstancePoolsToUseCount — (Integer)

        The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price. EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.

      • SingleInstanceType — (Boolean)

        Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.

      • MinTargetCapacity — (Integer)

        The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.

    • OnDemandOptions — (map)

      The allocation strategy of On-Demand Instances in an EC2 Fleet.

      • AllocationStrategy — (String)

        The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowest-price, EC2 Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized, EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first. If you do not specify a value, EC2 Fleet defaults to lowest-price.

        Possible values include:
        • "lowest-price"
        • "prioritized"
      • SingleInstanceType — (Boolean)

        Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.

      • MinTargetCapacity — (Integer)

        The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.

    • ExcessCapacityTerminationPolicy — (String)

      Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

      Possible values include:
      • "no-termination"
      • "termination"
    • LaunchTemplateConfigs — (Array<map>)

      The configuration for the EC2 Fleet.

      • LaunchTemplateSpecification — (map)

        The launch template to use. You must specify either the launch template ID or launch template name in the request.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • Version — (String)

          The version number of the launch template.

      • Overrides — (Array<map>)

        Any parameters that you specify override the same parameters in the launch template.

        • InstanceType — (String)

          The instance type.

          Possible values include:
          • "t1.micro"
          • "t2.nano"
          • "t2.micro"
          • "t2.small"
          • "t2.medium"
          • "t2.large"
          • "t2.xlarge"
          • "t2.2xlarge"
          • "t3.nano"
          • "t3.micro"
          • "t3.small"
          • "t3.medium"
          • "t3.large"
          • "t3.xlarge"
          • "t3.2xlarge"
          • "m1.small"
          • "m1.medium"
          • "m1.large"
          • "m1.xlarge"
          • "m3.medium"
          • "m3.large"
          • "m3.xlarge"
          • "m3.2xlarge"
          • "m4.large"
          • "m4.xlarge"
          • "m4.2xlarge"
          • "m4.4xlarge"
          • "m4.10xlarge"
          • "m4.16xlarge"
          • "m2.xlarge"
          • "m2.2xlarge"
          • "m2.4xlarge"
          • "cr1.8xlarge"
          • "r3.large"
          • "r3.xlarge"
          • "r3.2xlarge"
          • "r3.4xlarge"
          • "r3.8xlarge"
          • "r4.large"
          • "r4.xlarge"
          • "r4.2xlarge"
          • "r4.4xlarge"
          • "r4.8xlarge"
          • "r4.16xlarge"
          • "r5.large"
          • "r5.xlarge"
          • "r5.2xlarge"
          • "r5.4xlarge"
          • "r5.8xlarge"
          • "r5.12xlarge"
          • "r5.16xlarge"
          • "r5.24xlarge"
          • "r5.metal"
          • "r5a.large"
          • "r5a.xlarge"
          • "r5a.2xlarge"
          • "r5a.4xlarge"
          • "r5a.12xlarge"
          • "r5a.24xlarge"
          • "r5d.large"
          • "r5d.xlarge"
          • "r5d.2xlarge"
          • "r5d.4xlarge"
          • "r5d.8xlarge"
          • "r5d.12xlarge"
          • "r5d.16xlarge"
          • "r5d.24xlarge"
          • "r5d.metal"
          • "x1.16xlarge"
          • "x1.32xlarge"
          • "x1e.xlarge"
          • "x1e.2xlarge"
          • "x1e.4xlarge"
          • "x1e.8xlarge"
          • "x1e.16xlarge"
          • "x1e.32xlarge"
          • "i2.xlarge"
          • "i2.2xlarge"
          • "i2.4xlarge"
          • "i2.8xlarge"
          • "i3.large"
          • "i3.xlarge"
          • "i3.2xlarge"
          • "i3.4xlarge"
          • "i3.8xlarge"
          • "i3.16xlarge"
          • "i3.metal"
          • "hi1.4xlarge"
          • "hs1.8xlarge"
          • "c1.medium"
          • "c1.xlarge"
          • "c3.large"
          • "c3.xlarge"
          • "c3.2xlarge"
          • "c3.4xlarge"
          • "c3.8xlarge"
          • "c4.large"
          • "c4.xlarge"
          • "c4.2xlarge"
          • "c4.4xlarge"
          • "c4.8xlarge"
          • "c5.large"
          • "c5.xlarge"
          • "c5.2xlarge"
          • "c5.4xlarge"
          • "c5.9xlarge"
          • "c5.18xlarge"
          • "c5d.large"
          • "c5d.xlarge"
          • "c5d.2xlarge"
          • "c5d.4xlarge"
          • "c5d.9xlarge"
          • "c5d.18xlarge"
          • "cc1.4xlarge"
          • "cc2.8xlarge"
          • "g2.2xlarge"
          • "g2.8xlarge"
          • "g3.4xlarge"
          • "g3.8xlarge"
          • "g3.16xlarge"
          • "g3s.xlarge"
          • "cg1.4xlarge"
          • "p2.xlarge"
          • "p2.8xlarge"
          • "p2.16xlarge"
          • "p3.2xlarge"
          • "p3.8xlarge"
          • "p3.16xlarge"
          • "d2.xlarge"
          • "d2.2xlarge"
          • "d2.4xlarge"
          • "d2.8xlarge"
          • "f1.2xlarge"
          • "f1.4xlarge"
          • "f1.16xlarge"
          • "m5.large"
          • "m5.xlarge"
          • "m5.2xlarge"
          • "m5.4xlarge"
          • "m5.12xlarge"
          • "m5.24xlarge"
          • "m5a.large"
          • "m5a.xlarge"
          • "m5a.2xlarge"
          • "m5a.4xlarge"
          • "m5a.12xlarge"
          • "m5a.24xlarge"
          • "m5d.large"
          • "m5d.xlarge"
          • "m5d.2xlarge"
          • "m5d.4xlarge"
          • "m5d.12xlarge"
          • "m5d.24xlarge"
          • "h1.2xlarge"
          • "h1.4xlarge"
          • "h1.8xlarge"
          • "h1.16xlarge"
          • "z1d.large"
          • "z1d.xlarge"
          • "z1d.2xlarge"
          • "z1d.3xlarge"
          • "z1d.6xlarge"
          • "z1d.12xlarge"
          • "u-6tb1.metal"
          • "u-9tb1.metal"
          • "u-12tb1.metal"
        • MaxPrice — (String)

          The maximum price per unit hour that you are willing to pay for a Spot Instance.

        • SubnetId — (String)

          The ID of the subnet in which to launch the instances.

        • AvailabilityZone — (String)

          The Availability Zone in which to launch the instances.

        • WeightedCapacity — (Float)

          The number of units provided by the specified instance type.

        • Priority — (Float)

          The priority for the launch template override. If AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0. The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority.

        • Placement — (map)

          The location where the instance launched, if applicable.

          • AvailabilityZone — (String)

            The Availability Zone of the instance.

          • Affinity — (String)

            The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.

          • GroupName — (String)

            The name of the placement group the instance is in.

          • HostId — (String)

            The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

          • Tenancy — (String)

            The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.

            Possible values include:
            • "default"
            • "dedicated"
            • "host"
          • SpreadDomain — (String)

            Reserved for future use.

    • TargetCapacitySpecification — (map)

      The TotalTargetCapacity, OnDemandTargetCapacity, SpotTargetCapacity, and DefaultCapacityType structure.

      • TotalTargetCapacityrequired — (Integer)

        The number of units to request, filled using DefaultTargetCapacityType.

      • OnDemandTargetCapacity — (Integer)

        The number of On-Demand units to request.

      • SpotTargetCapacity — (Integer)

        The number of Spot units to request.

      • DefaultTargetCapacityType — (String)

        The default TotalTargetCapacity, which is either Spot or On-Demand.

        Possible values include:
        • "spot"
        • "on-demand"
    • TerminateInstancesWithExpiration — (Boolean)

      Indicates whether running instances should be terminated when the EC2 Fleet expires.

    • Type — (String)

      The type of request. instant indicates whether the EC2 Fleet submits a one-time request for your desired capacity. request indicates whether the EC2 Fleet submits ongoing requests until your desired capacity is fulfilled, but does not attempt to submit requests in alternative capacity pools if capacity is unavailable or maintain the capacity. maintain indicates whether the EC2 Fleet submits ongoing requests until your desired capacity is fulfilled, and continues to maintain your desired capacity by replenishing interrupted Spot Instances. Default: maintain.

      Possible values include:
      • "request"
      • "maintain"
      • "instant"
    • ValidFrom — (Date)

      The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.

    • ValidUntil — (Date)

      The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. The default end date is 7 days from the current date.

    • ReplaceUnhealthyInstances — (Boolean)

      Indicates whether EC2 Fleet should replace unhealthy instances.

    • TagSpecifications — (Array<map>)

      The key-value pair for tagging the EC2 Fleet request on creation. The value for ResourceType must be fleet, otherwise the fleet request fails. To tag instances at launch, specify the tags in the launch template. For information about tagging after launch, see Tagging Your Resources.

      • ResourceType — (String)

        The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

        Possible values include:
        • "customer-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "image"
        • "instance"
        • "internet-gateway"
        • "network-acl"
        • "network-interface"
        • "reserved-instances"
        • "route-table"
        • "snapshot"
        • "spot-instances-request"
        • "subnet"
        • "security-group"
        • "volume"
        • "vpc"
        • "vpn-connection"
        • "vpn-gateway"
      • Tags — (Array<map>)

        The tags to apply to the resource.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • FleetId — (String)

        The ID of the EC2 Fleet.

      • Errors — (Array<map>)

        Information about the instances that could not be launched by the fleet. Valid only when Type is set to instant.

        • LaunchTemplateAndOverrides — (map)

          The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.

          • LaunchTemplateSpecification — (map)

            The launch template.

            • LaunchTemplateId — (String)

              The ID of the launch template. You must specify either a template ID or a template name.

            • LaunchTemplateName — (String)

              The name of the launch template. You must specify either a template name or a template ID.

            • Version — (String)

              The version number of the launch template. You must specify a version number.

          • Overrides — (map)

            Any parameters that you specify override the same parameters in the launch template.

            • InstanceType — (String)

              The instance type.

              Possible values include:
              • "t1.micro"
              • "t2.nano"
              • "t2.micro"
              • "t2.small"
              • "t2.medium"
              • "t2.large"
              • "t2.xlarge"
              • "t2.2xlarge"
              • "t3.nano"
              • "t3.micro"
              • "t3.small"
              • "t3.medium"
              • "t3.large"
              • "t3.xlarge"
              • "t3.2xlarge"
              • "m1.small"
              • "m1.medium"
              • "m1.large"
              • "m1.xlarge"
              • "m3.medium"
              • "m3.large"
              • "m3.xlarge"
              • "m3.2xlarge"
              • "m4.large"
              • "m4.xlarge"
              • "m4.2xlarge"
              • "m4.4xlarge"
              • "m4.10xlarge"
              • "m4.16xlarge"
              • "m2.xlarge"
              • "m2.2xlarge"
              • "m2.4xlarge"
              • "cr1.8xlarge"
              • "r3.large"
              • "r3.xlarge"
              • "r3.2xlarge"
              • "r3.4xlarge"
              • "r3.8xlarge"
              • "r4.large"
              • "r4.xlarge"
              • "r4.2xlarge"
              • "r4.4xlarge"
              • "r4.8xlarge"
              • "r4.16xlarge"
              • "r5.large"
              • "r5.xlarge"
              • "r5.2xlarge"
              • "r5.4xlarge"
              • "r5.8xlarge"
              • "r5.12xlarge"
              • "r5.16xlarge"
              • "r5.24xlarge"
              • "r5.metal"
              • "r5a.large"
              • "r5a.xlarge"
              • "r5a.2xlarge"
              • "r5a.4xlarge"
              • "r5a.12xlarge"
              • "r5a.24xlarge"
              • "r5d.large"
              • "r5d.xlarge"
              • "r5d.2xlarge"
              • "r5d.4xlarge"
              • "r5d.8xlarge"
              • "r5d.12xlarge"
              • "r5d.16xlarge"
              • "r5d.24xlarge"
              • "r5d.metal"
              • "x1.16xlarge"
              • "x1.32xlarge"
              • "x1e.xlarge"
              • "x1e.2xlarge"
              • "x1e.4xlarge"
              • "x1e.8xlarge"
              • "x1e.16xlarge"
              • "x1e.32xlarge"
              • "i2.xlarge"
              • "i2.2xlarge"
              • "i2.4xlarge"
              • "i2.8xlarge"
              • "i3.large"
              • "i3.xlarge"
              • "i3.2xlarge"
              • "i3.4xlarge"
              • "i3.8xlarge"
              • "i3.16xlarge"
              • "i3.metal"
              • "hi1.4xlarge"
              • "hs1.8xlarge"
              • "c1.medium"
              • "c1.xlarge"
              • "c3.large"
              • "c3.xlarge"
              • "c3.2xlarge"
              • "c3.4xlarge"
              • "c3.8xlarge"
              • "c4.large"
              • "c4.xlarge"
              • "c4.2xlarge"
              • "c4.4xlarge"
              • "c4.8xlarge"
              • "c5.large"
              • "c5.xlarge"
              • "c5.2xlarge"
              • "c5.4xlarge"
              • "c5.9xlarge"
              • "c5.18xlarge"
              • "c5d.large"
              • "c5d.xlarge"
              • "c5d.2xlarge"
              • "c5d.4xlarge"
              • "c5d.9xlarge"
              • "c5d.18xlarge"
              • "cc1.4xlarge"
              • "cc2.8xlarge"
              • "g2.2xlarge"
              • "g2.8xlarge"
              • "g3.4xlarge"
              • "g3.8xlarge"
              • "g3.16xlarge"
              • "g3s.xlarge"
              • "cg1.4xlarge"
              • "p2.xlarge"
              • "p2.8xlarge"
              • "p2.16xlarge"
              • "p3.2xlarge"
              • "p3.8xlarge"
              • "p3.16xlarge"
              • "d2.xlarge"
              • "d2.2xlarge"
              • "d2.4xlarge"
              • "d2.8xlarge"
              • "f1.2xlarge"
              • "f1.4xlarge"
              • "f1.16xlarge"
              • "m5.large"
              • "m5.xlarge"
              • "m5.2xlarge"
              • "m5.4xlarge"
              • "m5.12xlarge"
              • "m5.24xlarge"
              • "m5a.large"
              • "m5a.xlarge"
              • "m5a.2xlarge"
              • "m5a.4xlarge"
              • "m5a.12xlarge"
              • "m5a.24xlarge"
              • "m5d.large"
              • "m5d.xlarge"
              • "m5d.2xlarge"
              • "m5d.4xlarge"
              • "m5d.12xlarge"
              • "m5d.24xlarge"
              • "h1.2xlarge"
              • "h1.4xlarge"
              • "h1.8xlarge"
              • "h1.16xlarge"
              • "z1d.large"
              • "z1d.xlarge"
              • "z1d.2xlarge"
              • "z1d.3xlarge"
              • "z1d.6xlarge"
              • "z1d.12xlarge"
              • "u-6tb1.metal"
              • "u-9tb1.metal"
              • "u-12tb1.metal"
            • MaxPrice — (String)

              The maximum price per unit hour that you are willing to pay for a Spot Instance.

            • SubnetId — (String)

              The ID of the subnet in which to launch the instances.

            • AvailabilityZone — (String)

              The Availability Zone in which to launch the instances.

            • WeightedCapacity — (Float)

              The number of units provided by the specified instance type.

            • Priority — (Float)

              The priority for the launch template override. If AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0. The lower the number, the higher the priority. If no number is set, the override has the lowest priority.

            • Placement — (map)

              The location where the instance launched, if applicable.

              • GroupName — (String)

                The name of the placement group the instance is in.

        • Lifecycle — (String)

          Indicates if the instance that could not be launched was a Spot Instance or On-Demand Instance.

          Possible values include:
          • "spot"
          • "on-demand"
        • ErrorCode — (String)

          The error code that indicates why the instance could not be launched. For more information about error codes, see Error Codes.

        • ErrorMessage — (String)

          The error message that describes why the instance could not be launched. For more information about error messages, see ee Error Codes.

      • Instances — (Array<map>)

        Information about the instances that were launched by the fleet. Valid only when Type is set to instant.

        • LaunchTemplateAndOverrides — (map)

          The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.

          • LaunchTemplateSpecification — (map)

            The launch template.

            • LaunchTemplateId — (String)

              The ID of the launch template. You must specify either a template ID or a template name.

            • LaunchTemplateName — (String)

              The name of the launch template. You must specify either a template name or a template ID.

            • Version — (String)

              The version number of the launch template. You must specify a version number.

          • Overrides — (map)

            Any parameters that you specify override the same parameters in the launch template.

            • InstanceType — (String)

              The instance type.

              Possible values include:
              • "t1.micro"
              • "t2.nano"
              • "t2.micro"
              • "t2.small"
              • "t2.medium"
              • "t2.large"
              • "t2.xlarge"
              • "t2.2xlarge"
              • "t3.nano"
              • "t3.micro"
              • "t3.small"
              • "t3.medium"
              • "t3.large"
              • "t3.xlarge"
              • "t3.2xlarge"
              • "m1.small"
              • "m1.medium"
              • "m1.large"
              • "m1.xlarge"
              • "m3.medium"
              • "m3.large"
              • "m3.xlarge"
              • "m3.2xlarge"
              • "m4.large"
              • "m4.xlarge"
              • "m4.2xlarge"
              • "m4.4xlarge"
              • "m4.10xlarge"
              • "m4.16xlarge"
              • "m2.xlarge"
              • "m2.2xlarge"
              • "m2.4xlarge"
              • "cr1.8xlarge"
              • "r3.large"
              • "r3.xlarge"
              • "r3.2xlarge"
              • "r3.4xlarge"
              • "r3.8xlarge"
              • "r4.large"
              • "r4.xlarge"
              • "r4.2xlarge"
              • "r4.4xlarge"
              • "r4.8xlarge"
              • "r4.16xlarge"
              • "r5.large"
              • "r5.xlarge"
              • "r5.2xlarge"
              • "r5.4xlarge"
              • "r5.8xlarge"
              • "r5.12xlarge"
              • "r5.16xlarge"
              • "r5.24xlarge"
              • "r5.metal"
              • "r5a.large"
              • "r5a.xlarge"
              • "r5a.2xlarge"
              • "r5a.4xlarge"
              • "r5a.12xlarge"
              • "r5a.24xlarge"
              • "r5d.large"
              • "r5d.xlarge"
              • "r5d.2xlarge"
              • "r5d.4xlarge"
              • "r5d.8xlarge"
              • "r5d.12xlarge"
              • "r5d.16xlarge"
              • "r5d.24xlarge"
              • "r5d.metal"
              • "x1.16xlarge"
              • "x1.32xlarge"
              • "x1e.xlarge"
              • "x1e.2xlarge"
              • "x1e.4xlarge"
              • "x1e.8xlarge"
              • "x1e.16xlarge"
              • "x1e.32xlarge"
              • "i2.xlarge"
              • "i2.2xlarge"
              • "i2.4xlarge"
              • "i2.8xlarge"
              • "i3.large"
              • "i3.xlarge"
              • "i3.2xlarge"
              • "i3.4xlarge"
              • "i3.8xlarge"
              • "i3.16xlarge"
              • "i3.metal"
              • "hi1.4xlarge"
              • "hs1.8xlarge"
              • "c1.medium"
              • "c1.xlarge"
              • "c3.large"
              • "c3.xlarge"
              • "c3.2xlarge"
              • "c3.4xlarge"
              • "c3.8xlarge"
              • "c4.large"
              • "c4.xlarge"
              • "c4.2xlarge"
              • "c4.4xlarge"
              • "c4.8xlarge"
              • "c5.large"
              • "c5.xlarge"
              • "c5.2xlarge"
              • "c5.4xlarge"
              • "c5.9xlarge"
              • "c5.18xlarge"
              • "c5d.large"
              • "c5d.xlarge"
              • "c5d.2xlarge"
              • "c5d.4xlarge"
              • "c5d.9xlarge"
              • "c5d.18xlarge"
              • "cc1.4xlarge"
              • "cc2.8xlarge"
              • "g2.2xlarge"
              • "g2.8xlarge"
              • "g3.4xlarge"
              • "g3.8xlarge"
              • "g3.16xlarge"
              • "g3s.xlarge"
              • "cg1.4xlarge"
              • "p2.xlarge"
              • "p2.8xlarge"
              • "p2.16xlarge"
              • "p3.2xlarge"
              • "p3.8xlarge"
              • "p3.16xlarge"
              • "d2.xlarge"
              • "d2.2xlarge"
              • "d2.4xlarge"
              • "d2.8xlarge"
              • "f1.2xlarge"
              • "f1.4xlarge"
              • "f1.16xlarge"
              • "m5.large"
              • "m5.xlarge"
              • "m5.2xlarge"
              • "m5.4xlarge"
              • "m5.12xlarge"
              • "m5.24xlarge"
              • "m5a.large"
              • "m5a.xlarge"
              • "m5a.2xlarge"
              • "m5a.4xlarge"
              • "m5a.12xlarge"
              • "m5a.24xlarge"
              • "m5d.large"
              • "m5d.xlarge"
              • "m5d.2xlarge"
              • "m5d.4xlarge"
              • "m5d.12xlarge"
              • "m5d.24xlarge"
              • "h1.2xlarge"
              • "h1.4xlarge"
              • "h1.8xlarge"
              • "h1.16xlarge"
              • "z1d.large"
              • "z1d.xlarge"
              • "z1d.2xlarge"
              • "z1d.3xlarge"
              • "z1d.6xlarge"
              • "z1d.12xlarge"
              • "u-6tb1.metal"
              • "u-9tb1.metal"
              • "u-12tb1.metal"
            • MaxPrice — (String)

              The maximum price per unit hour that you are willing to pay for a Spot Instance.

            • SubnetId — (String)

              The ID of the subnet in which to launch the instances.

            • AvailabilityZone — (String)

              The Availability Zone in which to launch the instances.

            • WeightedCapacity — (Float)

              The number of units provided by the specified instance type.

            • Priority — (Float)

              The priority for the launch template override. If AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0. The lower the number, the higher the priority. If no number is set, the override has the lowest priority.

            • Placement — (map)

              The location where the instance launched, if applicable.

              • GroupName — (String)

                The name of the placement group the instance is in.

        • Lifecycle — (String)

          Indicates if the instance that was launched is a Spot Instance or On-Demand Instance.

          Possible values include:
          • "spot"
          • "on-demand"
        • InstanceIds — (Array<String>)

          The IDs of the instances.

        • InstanceType — (String)

          The instance type.

          Possible values include:
          • "t1.micro"
          • "t2.nano"
          • "t2.micro"
          • "t2.small"
          • "t2.medium"
          • "t2.large"
          • "t2.xlarge"
          • "t2.2xlarge"
          • "t3.nano"
          • "t3.micro"
          • "t3.small"
          • "t3.medium"
          • "t3.large"
          • "t3.xlarge"
          • "t3.2xlarge"
          • "m1.small"
          • "m1.medium"
          • "m1.large"
          • "m1.xlarge"
          • "m3.medium"
          • "m3.large"
          • "m3.xlarge"
          • "m3.2xlarge"
          • "m4.large"
          • "m4.xlarge"
          • "m4.2xlarge"
          • "m4.4xlarge"
          • "m4.10xlarge"
          • "m4.16xlarge"
          • "m2.xlarge"
          • "m2.2xlarge"
          • "m2.4xlarge"
          • "cr1.8xlarge"
          • "r3.large"
          • "r3.xlarge"
          • "r3.2xlarge"
          • "r3.4xlarge"
          • "r3.8xlarge"
          • "r4.large"
          • "r4.xlarge"
          • "r4.2xlarge"
          • "r4.4xlarge"
          • "r4.8xlarge"
          • "r4.16xlarge"
          • "r5.large"
          • "r5.xlarge"
          • "r5.2xlarge"
          • "r5.4xlarge"
          • "r5.8xlarge"
          • "r5.12xlarge"
          • "r5.16xlarge"
          • "r5.24xlarge"
          • "r5.metal"
          • "r5a.large"
          • "r5a.xlarge"
          • "r5a.2xlarge"
          • "r5a.4xlarge"
          • "r5a.12xlarge"
          • "r5a.24xlarge"
          • "r5d.large"
          • "r5d.xlarge"
          • "r5d.2xlarge"
          • "r5d.4xlarge"
          • "r5d.8xlarge"
          • "r5d.12xlarge"
          • "r5d.16xlarge"
          • "r5d.24xlarge"
          • "r5d.metal"
          • "x1.16xlarge"
          • "x1.32xlarge"
          • "x1e.xlarge"
          • "x1e.2xlarge"
          • "x1e.4xlarge"
          • "x1e.8xlarge"
          • "x1e.16xlarge"
          • "x1e.32xlarge"
          • "i2.xlarge"
          • "i2.2xlarge"
          • "i2.4xlarge"
          • "i2.8xlarge"
          • "i3.large"
          • "i3.xlarge"
          • "i3.2xlarge"
          • "i3.4xlarge"
          • "i3.8xlarge"
          • "i3.16xlarge"
          • "i3.metal"
          • "hi1.4xlarge"
          • "hs1.8xlarge"
          • "c1.medium"
          • "c1.xlarge"
          • "c3.large"
          • "c3.xlarge"
          • "c3.2xlarge"
          • "c3.4xlarge"
          • "c3.8xlarge"
          • "c4.large"
          • "c4.xlarge"
          • "c4.2xlarge"
          • "c4.4xlarge"
          • "c4.8xlarge"
          • "c5.large"
          • "c5.xlarge"
          • "c5.2xlarge"
          • "c5.4xlarge"
          • "c5.9xlarge"
          • "c5.18xlarge"
          • "c5d.large"
          • "c5d.xlarge"
          • "c5d.2xlarge"
          • "c5d.4xlarge"
          • "c5d.9xlarge"
          • "c5d.18xlarge"
          • "cc1.4xlarge"
          • "cc2.8xlarge"
          • "g2.2xlarge"
          • "g2.8xlarge"
          • "g3.4xlarge"
          • "g3.8xlarge"
          • "g3.16xlarge"
          • "g3s.xlarge"
          • "cg1.4xlarge"
          • "p2.xlarge"
          • "p2.8xlarge"
          • "p2.16xlarge"
          • "p3.2xlarge"
          • "p3.8xlarge"
          • "p3.16xlarge"
          • "d2.xlarge"
          • "d2.2xlarge"
          • "d2.4xlarge"
          • "d2.8xlarge"
          • "f1.2xlarge"
          • "f1.4xlarge"
          • "f1.16xlarge"
          • "m5.large"
          • "m5.xlarge"
          • "m5.2xlarge"
          • "m5.4xlarge"
          • "m5.12xlarge"
          • "m5.24xlarge"
          • "m5a.large"
          • "m5a.xlarge"
          • "m5a.2xlarge"
          • "m5a.4xlarge"
          • "m5a.12xlarge"
          • "m5a.24xlarge"
          • "m5d.large"
          • "m5d.xlarge"
          • "m5d.2xlarge"
          • "m5d.4xlarge"
          • "m5d.12xlarge"
          • "m5d.24xlarge"
          • "h1.2xlarge"
          • "h1.4xlarge"
          • "h1.8xlarge"
          • "h1.16xlarge"
          • "z1d.large"
          • "z1d.xlarge"
          • "z1d.2xlarge"
          • "z1d.3xlarge"
          • "z1d.6xlarge"
          • "z1d.12xlarge"
          • "u-6tb1.metal"
          • "u-9tb1.metal"
          • "u-12tb1.metal"
        • Platform — (String)

          The value is Windows for Windows instances; otherwise blank.

          Possible values include:
          • "Windows"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createFlowLogs(params = {}, callback) ⇒ AWS.Request

Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC.

Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see Flow Log Records in the Amazon Virtual Private Cloud User Guide.

When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket.

For more information, see VPC Flow Logs in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the createFlowLogs operation

var params = {
  ResourceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  ResourceType: VPC | Subnet | NetworkInterface, /* required */
  TrafficType: ACCEPT | REJECT | ALL, /* required */
  ClientToken: 'STRING_VALUE',
  DeliverLogsPermissionArn: 'STRING_VALUE',
  DryRun: true || false,
  LogDestination: 'STRING_VALUE',
  LogDestinationType: cloud-watch-logs | s3,
  LogGroupName: 'STRING_VALUE'
};
ec2.createFlowLogs(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

    • DeliverLogsPermissionArn — (String)

      The ARN for the IAM role that's used to post flow logs to a log group.

    • LogGroupName — (String)

      The name of the log group.

    • ResourceIds — (Array<String>)

      One or more subnet, network interface, or VPC IDs.

      Constraints: Maximum of 1000 resources

    • ResourceType — (String)

      The type of resource on which to create the flow log.

      Possible values include:
      • "VPC"
      • "Subnet"
      • "NetworkInterface"
    • TrafficType — (String)

      The type of traffic to log.

      Possible values include:
      • "ACCEPT"
      • "REJECT"
      • "ALL"
    • LogDestinationType — (String)

      Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3. To publish flow log data to CloudWatch Logs, specify cloud-watch-logs. To publish flow log data to Amazon S3, specify s3.

      Default: cloud-watch-logs

      Possible values include:
      • "cloud-watch-logs"
      • "s3"
    • LogDestination — (String)

      Specifies the destination to which the flow log data is to be published. Flow log data can be published to an CloudWatch Logs log group or an Amazon S3 bucket. The value specified for this parameter depends on the value specified for LogDestinationType.

      If LogDestinationType is not specified or cloud-watch-logs, specify the Amazon Resource Name (ARN) of the CloudWatch Logs log group.

      If LogDestinationType is s3, specify the ARN of the Amazon S3 bucket. You can also specify a subfolder in the bucket. To specify a subfolder in the bucket, use the following ARN format: bucket_ARN/subfolder_name/. For example, to specify a subfolder named my-logs in a bucket named my-bucket, use the following ARN: arn:aws:s3:::my-bucket/my-logs/. You cannot use AWSLogs as a subfolder name. This is a reserved term.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ClientToken — (String)

        Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

      • FlowLogIds — (Array<String>)

        The IDs of the flow logs.

      • Unsuccessful — (Array<map>)

        Information about the flow logs that could not be created successfully.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createFpgaImage(params = {}, callback) ⇒ AWS.Request

Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP).

The create operation is asynchronous. To verify that the AFI is ready for use, check the output logs.

An AFI contains the FPGA bitstream that is ready to download to an FPGA. You can securely deploy an AFI on one or more FPGA-accelerated instances. For more information, see the AWS FPGA Hardware Development Kit.

Service Reference:

Examples:

Calling the createFpgaImage operation

var params = {
  InputStorageLocation: { /* required */
    Bucket: 'STRING_VALUE',
    Key: 'STRING_VALUE'
  },
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DryRun: true || false,
  LogsStorageLocation: {
    Bucket: 'STRING_VALUE',
    Key: 'STRING_VALUE'
  },
  Name: 'STRING_VALUE'
};
ec2.createFpgaImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InputStorageLocation — (map)

      The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.

      • Bucket — (String)

        The name of the S3 bucket.

      • Key — (String)

        The key.

    • LogsStorageLocation — (map)

      The location in Amazon S3 for the output logs.

      • Bucket — (String)

        The name of the S3 bucket.

      • Key — (String)

        The key.

    • Description — (String)

      A description for the AFI.

    • Name — (String)

      A name for the AFI.

    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • FpgaImageId — (String)

        The FPGA image identifier (AFI ID).

      • FpgaImageGlobalId — (String)

        The global FPGA image identifier (AGFI ID).

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createImage(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

To create an AMI from an Amazon EBS-backed instance


/* This example creates an AMI from the specified instance and adds an EBS volume with the device name /dev/sdh and an instance store volume with the device name /dev/sdc. */

 var params = {
  BlockDeviceMappings: [
     {
    DeviceName: "/dev/sdh", 
    Ebs: {
     VolumeSize: 100
    }
   }, 
     {
    DeviceName: "/dev/sdc", 
    VirtualName: "ephemeral1"
   }
  ], 
  Description: "An AMI for my server", 
  InstanceId: "i-1234567890abcdef0", 
  Name: "My server", 
  NoReboot: true
 };
 ec2.createImage(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ImageId: "ami-1a2b3c4d"
   }
   */
 });

Calling the createImage operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE', /* required */
  BlockDeviceMappings: [
    {
      DeviceName: 'STRING_VALUE',
      Ebs: {
        DeleteOnTermination: true || false,
        Encrypted: true || false,
        Iops: 0,
        KmsKeyId: 'STRING_VALUE',
        SnapshotId: 'STRING_VALUE',
        VolumeSize: 0,
        VolumeType: standard | io1 | gp2 | sc1 | st1
      },
      NoDevice: 'STRING_VALUE',
      VirtualName: 'STRING_VALUE'
    },
    /* more items */
  ],
  Description: 'STRING_VALUE',
  DryRun: true || false,
  NoReboot: true || false
};
ec2.createImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • BlockDeviceMappings — (Array<map>)

      Information about one or more block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.

      • DeviceName — (String)

        The device name (for example, /dev/sdh or xvdh).

      • VirtualName — (String)

        The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

        NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.

        Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

      • Ebs — (map)

        Parameters used to automatically set up EBS volumes when the instance is launched.

        • DeleteOnTermination — (Boolean)

          Indicates whether the EBS volume is deleted on instance termination.

        • Iops — (Integer)

          The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

          Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

          Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.

        • SnapshotId — (String)

          The ID of the snapshot.

        • VolumeSize — (Integer)

          The size of the volume, in GiB.

          Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

          Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

        • VolumeType — (String)

          The volume type: gp2, io1, st1, sc1, or standard.

          Default: standard

          Possible values include:
          • "standard"
          • "io1"
          • "gp2"
          • "sc1"
          • "st1"
        • Encrypted — (Boolean)

          Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption.

          If you are creating a volume from a snapshot, you cannot specify an encryption value. This is because only blank volumes can be encrypted on creation. If you are creating a snapshot from an existing EBS volume, you cannot specify an encryption value that differs from that of the EBS volume. We recommend that you omit the encryption value from the block device mappings when creating an image from an instance.

        • KmsKeyId — (String)

          Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK under which the EBS volume is encrypted.

          This parameter is only supported on BlockDeviceMapping objects called by RunInstances, RequestSpotFleet, and RequestSpotInstances.

      • NoDevice — (String)

        Suppresses the specified device included in the block device mapping of the AMI.

    • Description — (String)

      A description for the new image.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InstanceId — (String)

      The ID of the instance.

    • Name — (String)

      A name for the new image.

      Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

    • NoReboot — (Boolean)

      By default, Amazon EC2 attempts to shut down and reboot the instance before creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ImageId — (String)

        The ID of the new AMI.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createInstanceExportTask(params = {}, callback) ⇒ AWS.Request

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 an Instance as a VM Using VM Import/Export in the VM Import/Export User Guide.

Service Reference:

Examples:

Calling the createInstanceExportTask operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE',
  ExportToS3Task: {
    ContainerFormat: ova,
    DiskImageFormat: VMDK | RAW | VHD,
    S3Bucket: 'STRING_VALUE',
    S3Prefix: 'STRING_VALUE'
  },
  TargetEnvironment: citrix | vmware | microsoft
};
ec2.createInstanceExportTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Description — (String)

      A description for the conversion task or the resource being exported. The maximum length is 255 bytes.

    • ExportToS3Task — (map)

      The format and location for an instance export task.

      • ContainerFormat — (String)

        The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.

        Possible values include:
        • "ova"
      • DiskImageFormat — (String)

        The format for the exported image.

        Possible values include:
        • "VMDK"
        • "RAW"
        • "VHD"
      • S3Bucket — (String)

        The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com.

      • S3Prefix — (String)

        The image is written to a single object in the S3 bucket at the S3 key s3prefix + exportTaskId + '.' + diskImageFormat.

    • InstanceId — (String)

      The ID of the instance.

    • TargetEnvironment — (String)

      The target virtualization environment.

      Possible values include:
      • "citrix"
      • "vmware"
      • "microsoft"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ExportTask — (map)

        Information about the instance export task.

        • Description — (String)

          A description of the resource being exported.

        • ExportTaskId — (String)

          The ID of the export task.

        • ExportToS3Task — (map)

          Information about the export task.

          • ContainerFormat — (String)

            The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.

            Possible values include:
            • "ova"
          • DiskImageFormat — (String)

            The format for the exported image.

            Possible values include:
            • "VMDK"
            • "RAW"
            • "VHD"
          • S3Bucket — (String)

            The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com.

          • S3Key — (String)

            The encryption key for your S3 bucket.

        • InstanceExportDetails — (map)

          Information about the instance to export.

          • InstanceId — (String)

            The ID of the resource being exported.

          • TargetEnvironment — (String)

            The target virtualization environment.

            Possible values include:
            • "citrix"
            • "vmware"
            • "microsoft"
        • State — (String)

          The state of the export task.

          Possible values include:
          • "active"
          • "cancelling"
          • "cancelled"
          • "completed"
        • StatusMessage — (String)

          The status message related to the export task.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createInternetGateway(params = {}, callback) ⇒ AWS.Request

Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway.

For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create an Internet gateway


/* This example creates an Internet gateway. */

 var params = {
 };
 ec2.createInternetGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    InternetGateway: {
     Attachments: [
     ], 
     InternetGatewayId: "igw-c0a643a9", 
     Tags: [
     ]
    }
   }
   */
 });

Calling the createInternetGateway operation

var params = {
  DryRun: true || false
};
ec2.createInternetGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • InternetGateway — (map)

        Information about the internet gateway.

        • Attachments — (Array<map>)

          Any VPCs attached to the internet gateway.

          • State — (String)

            The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.

            Possible values include:
            • "attaching"
            • "attached"
            • "detaching"
            • "detached"
          • VpcId — (String)

            The ID of the VPC.

        • InternetGatewayId — (String)

          The ID of the internet gateway.

        • Tags — (Array<map>)

          Any tags assigned to the internet gateway.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createKeyPair(params = {}, callback) ⇒ AWS.Request

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per region.

The key pair returned to you is available only in the region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any region using ImportKeyPair.

For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To create a key pair


/* This example creates a key pair named my-key-pair. */

 var params = {
  KeyName: "my-key-pair"
 };
 ec2.createKeyPair(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the createKeyPair operation

var params = {
  KeyName: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.createKeyPair(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • KeyName — (String)

      A unique name for the key pair.

      Constraints: Up to 255 ASCII characters

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • KeyFingerprint — (String)

        The SHA-1 digest of the DER encoded private key.

      • KeyMaterial — (String)

        An unencrypted PEM encoded RSA private key.

      • KeyName — (String)

        The name of the key pair.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createLaunchTemplate(params = {}, callback) ⇒ AWS.Request

Creates a launch template. A launch template contains the parameters to launch an instance. When you launch an instance using RunInstances, you can specify a launch template instead of providing the launch parameters in the request.

Service Reference:

Examples:

To create a launch template


/* This example creates a launch template that specifies the subnet in which to launch the instance, assigns a public IP address and an IPv6 address to the instance, and creates a tag for the instance. */

 var params = {
  LaunchTemplateData: {
   ImageId: "ami-8c1be5f6", 
   InstanceType: "t2.small", 
   NetworkInterfaces: [
      {
     AssociatePublicIpAddress: true, 
     DeviceIndex: 0, 
     Ipv6AddressCount: 1, 
     SubnetId: "subnet-7b16de0c"
    }
   ], 
   TagSpecifications: [
      {
     ResourceType: "instance", 
     Tags: [
        {
       Key: "Name", 
       Value: "webserver"
      }
     ]
    }
   ]
  }, 
  LaunchTemplateName: "my-template", 
  VersionDescription: "WebVersion1"
 };
 ec2.createLaunchTemplate(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LaunchTemplate: {
     CreateTime: <Date Representation>, 
     CreatedBy: "arn:aws:iam::123456789012:root", 
     DefaultVersionNumber: 1, 
     LatestVersionNumber: 1, 
     LaunchTemplateId: "lt-01238c059e3466abc", 
     LaunchTemplateName: "my-template"
    }
   }
   */
 });

Calling the createLaunchTemplate operation

var params = {
  LaunchTemplateData: { /* required */
    BlockDeviceMappings: [
      {
        DeviceName: 'STRING_VALUE',
        Ebs: {
          DeleteOnTermination: true || false,
          Encrypted: true || false,
          Iops: 0,
          KmsKeyId: 'STRING_VALUE',
          SnapshotId: 'STRING_VALUE',
          VolumeSize: 0,
          VolumeType: standard | io1 | gp2 | sc1 | st1
        },
        NoDevice: 'STRING_VALUE',
        VirtualName: 'STRING_VALUE'
      },
      /* more items */
    ],
    CapacityReservationSpecification: {
      CapacityReservationPreference: open | none,
      CapacityReservationTarget: {
        CapacityReservationId: 'STRING_VALUE'
      }
    },
    CpuOptions: {
      CoreCount: 0,
      ThreadsPerCore: 0
    },
    CreditSpecification: {
      CpuCredits: 'STRING_VALUE' /* required */
    },
    DisableApiTermination: true || false,
    EbsOptimized: true || false,
    ElasticGpuSpecifications: [
      {
        Type: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    IamInstanceProfile: {
      Arn: 'STRING_VALUE',
      Name: 'STRING_VALUE'
    },
    ImageId: 'STRING_VALUE',
    InstanceInitiatedShutdownBehavior: stop | terminate,
    InstanceMarketOptions: {
      MarketType: spot,
      SpotOptions: {
        BlockDurationMinutes: 0,
        InstanceInterruptionBehavior: hibernate | stop | terminate,
        MaxPrice: 'STRING_VALUE',
        SpotInstanceType: one-time | persistent,
        ValidUntil: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
      }
    },
    InstanceType: t1.micro | t2.nano | t2.micro | t2.small | t2.medium | t2.large | t2.xlarge | t2.2xlarge | t3.nano | t3.micro | t3.small | t3.medium | t3.large | t3.xlarge | t3.2xlarge | m1.small | m1.medium | m1.large | m1.xlarge | m3.medium | m3.large | m3.xlarge | m3.2xlarge | m4.large | m4.xlarge | m4.2xlarge | m4.4xlarge | m4.10xlarge | m4.16xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cr1.8xlarge | r3.large | r3.xlarge | r3.2xlarge | r3.4xlarge | r3.8xlarge | r4.large | r4.xlarge | r4.2xlarge | r4.4xlarge | r4.8xlarge | r4.16xlarge | r5.large | r5.xlarge | r5.2xlarge | r5.4xlarge | r5.8xlarge | r5.12xlarge | r5.16xlarge | r5.24xlarge | r5.metal | r5a.large | r5a.xlarge | r5a.2xlarge | r5a.4xlarge | r5a.12xlarge | r5a.24xlarge | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | x1.16xlarge | x1.32xlarge | x1e.xlarge | x1e.2xlarge | x1e.4xlarge | x1e.8xlarge | x1e.16xlarge | x1e.32xlarge | i2.xlarge | i2.2xlarge | i2.4xlarge | i2.8xlarge | i3.large | i3.xlarge | i3.2xlarge | i3.4xlarge | i3.8xlarge | i3.16xlarge | i3.metal | hi1.4xlarge | hs1.8xlarge | c1.medium | c1.xlarge | c3.large | c3.xlarge | c3.2xlarge | c3.4xlarge | c3.8xlarge | c4.large | c4.xlarge | c4.2xlarge | c4.4xlarge | c4.8xlarge | c5.large | c5.xlarge | c5.2xlarge | c5.4xlarge | c5.9xlarge | c5.18xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.18xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4xlarge | g3.8xlarge | g3.16xlarge | g3s.xlarge | cg1.4xlarge | p2.xlarge | p2.8xlarge | p2.16xlarge | p3.2xlarge | p3.8xlarge | p3.16xlarge | d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge | f1.2xlarge | f1.4xlarge | f1.16xlarge | m5.large | m5.xlarge | m5.2xlarge | m5.4xlarge | m5.12xlarge | m5.24xlarge | m5a.large | m5a.xlarge | m5a.2xlarge | m5a.4xlarge | m5a.12xlarge | m5a.24xlarge | m5d.large | m5d.xlarge | m5d.2xlarge | m5d.4xlarge | m5d.12xlarge | m5d.24xlarge | h1.2xlarge | h1.4xlarge | h1.8xlarge | h1.16xlarge | z1d.large | z1d.xlarge | z1d.2xlarge | z1d.3xlarge | z1d.6xlarge | z1d.12xlarge | u-6tb1.metal | u-9tb1.metal | u-12tb1.metal,
    KernelId: 'STRING_VALUE',
    KeyName: 'STRING_VALUE',
    Monitoring: {
      Enabled: true || false
    },
    NetworkInterfaces: [
      {
        AssociatePublicIpAddress: true || false,
        DeleteOnTermination: true || false,
        Description: 'STRING_VALUE',
        DeviceIndex: 0,
        Groups: [
          'STRING_VALUE',
          /* more items */
        ],
        Ipv6AddressCount: 0,
        Ipv6Addresses: [
          {
            Ipv6Address: 'STRING_VALUE'
          },
          /* more items */
        ],
        NetworkInterfaceId: 'STRING_VALUE',
        PrivateIpAddress: 'STRING_VALUE',
        PrivateIpAddresses: [
          {
            Primary: true || false,
            PrivateIpAddress: 'STRING_VALUE'
          },
          /* more items */
        ],
        SecondaryPrivateIpAddressCount: 0,
        SubnetId: 'STRING_VALUE'
      },
      /* more items */
    ],
    Placement: {
      Affinity: 'STRING_VALUE',
      AvailabilityZone: 'STRING_VALUE',
      GroupName: 'STRING_VALUE',
      HostId: 'STRING_VALUE',
      SpreadDomain: 'STRING_VALUE',
      Tenancy: default | dedicated | host
    },
    RamDiskId: 'STRING_VALUE',
    SecurityGroupIds: [
      'STRING_VALUE',
      /* more items */
    ],
    SecurityGroups: [
      'STRING_VALUE',
      /* more items */
    ],
    TagSpecifications: [
      {
        ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
        Tags: [
          {
            Key: 'STRING_VALUE',
            Value: 'STRING_VALUE'
          },
          /* more items */
        ]
      },
      /* more items */
    ],
    UserData: 'STRING_VALUE'
  },
  LaunchTemplateName: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  VersionDescription: 'STRING_VALUE'
};
ec2.createLaunchTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

    • LaunchTemplateName — (String)

      A name for the launch template.

    • VersionDescription — (String)

      A description for the first version of the launch template.

    • LaunchTemplateData — (map)

      The information for the launch template.

      • KernelId — (String)

        The ID of the kernel.

        We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide.

      • EbsOptimized — (Boolean)

        Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

      • IamInstanceProfile — (map)

        The IAM instance profile.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the instance profile.

        • Name — (String)

          The name of the instance profile.

      • BlockDeviceMappings — (Array<map>)

        The block device mapping.

        Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error. This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed using this action.

        • DeviceName — (String)

          The device name (for example, /dev/sdh or xvdh).

        • VirtualName — (String)

          The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

        • Ebs — (map)

          Parameters used to automatically set up EBS volumes when the instance is launched.

          • Encrypted — (Boolean)

            Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value.

          • DeleteOnTermination — (Boolean)

            Indicates whether the EBS volume is deleted on instance termination.

          • Iops — (Integer)

            The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

            Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.

          • KmsKeyId — (String)

            The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.

          • SnapshotId — (String)

            The ID of the snapshot.

          • VolumeSize — (Integer)

            The size of the volume, in GiB.

            Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

          • VolumeType — (String)

            The volume type.

            Possible values include:
            • "standard"
            • "io1"
            • "gp2"
            • "sc1"
            • "st1"
        • NoDevice — (String)

          Suppresses the specified device included in the block device mapping of the AMI.

      • NetworkInterfaces — (Array<map>)

        One or more network interfaces.

        • AssociatePublicIpAddress — (Boolean)

          Associates a public IPv4 address with eth0 for a new network interface.

        • DeleteOnTermination — (Boolean)

          Indicates whether the network interface is deleted when the instance is terminated.

        • Description — (String)

          A description for the network interface.

        • DeviceIndex — (Integer)

          The device index for the network interface attachment.

        • Groups — (Array<String>)

          The IDs of one or more security groups.

        • Ipv6AddressCount — (Integer)

          The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.

        • Ipv6Addresses — (Array<map>)

          One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.

          • Ipv6Address — (String)

            The IPv6 address.

        • NetworkInterfaceId — (String)

          The ID of the network interface.

        • PrivateIpAddress — (String)

          The primary private IPv4 address of the network interface.

        • PrivateIpAddresses — (Array<map>)

          One or more private IPv4 addresses.

          • Primary — (Boolean)

            Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

          • PrivateIpAddress — (String)

            The private IPv4 addresses.

        • SecondaryPrivateIpAddressCount — (Integer)

          The number of secondary private IPv4 addresses to assign to a network interface.

        • SubnetId — (String)

          The ID of the subnet for the network interface.

      • ImageId — (String)

        The ID of the AMI, which you can get by using DescribeImages.

      • InstanceType — (String)

        The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

        Possible values include:
        • "t1.micro"
        • "t2.nano"
        • "t2.micro"
        • "t2.small"
        • "t2.medium"
        • "t2.large"
        • "t2.xlarge"
        • "t2.2xlarge"
        • "t3.nano"
        • "t3.micro"
        • "t3.small"
        • "t3.medium"
        • "t3.large"
        • "t3.xlarge"
        • "t3.2xlarge"
        • "m1.small"
        • "m1.medium"
        • "m1.large"
        • "m1.xlarge"
        • "m3.medium"
        • "m3.large"
        • "m3.xlarge"
        • "m3.2xlarge"
        • "m4.large"
        • "m4.xlarge"
        • "m4.2xlarge"
        • "m4.4xlarge"
        • "m4.10xlarge"
        • "m4.16xlarge"
        • "m2.xlarge"
        • "m2.2xlarge"
        • "m2.4xlarge"
        • "cr1.8xlarge"
        • "r3.large"
        • "r3.xlarge"
        • "r3.2xlarge"
        • "r3.4xlarge"
        • "r3.8xlarge"
        • "r4.large"
        • "r4.xlarge"
        • "r4.2xlarge"
        • "r4.4xlarge"
        • "r4.8xlarge"
        • "r4.16xlarge"
        • "r5.large"
        • "r5.xlarge"
        • "r5.2xlarge"
        • "r5.4xlarge"
        • "r5.8xlarge"
        • "r5.12xlarge"
        • "r5.16xlarge"
        • "r5.24xlarge"
        • "r5.metal"
        • "r5a.large"
        • "r5a.xlarge"
        • "r5a.2xlarge"
        • "r5a.4xlarge"
        • "r5a.12xlarge"
        • "r5a.24xlarge"
        • "r5d.large"
        • "r5d.xlarge"
        • "r5d.2xlarge"
        • "r5d.4xlarge"
        • "r5d.8xlarge"
        • "r5d.12xlarge"
        • "r5d.16xlarge"
        • "r5d.24xlarge"
        • "r5d.metal"
        • "x1.16xlarge"
        • "x1.32xlarge"
        • "x1e.xlarge"
        • "x1e.2xlarge"
        • "x1e.4xlarge"
        • "x1e.8xlarge"
        • "x1e.16xlarge"
        • "x1e.32xlarge"
        • "i2.xlarge"
        • "i2.2xlarge"
        • "i2.4xlarge"
        • "i2.8xlarge"
        • "i3.large"
        • "i3.xlarge"
        • "i3.2xlarge"
        • "i3.4xlarge"
        • "i3.8xlarge"
        • "i3.16xlarge"
        • "i3.metal"
        • "hi1.4xlarge"
        • "hs1.8xlarge"
        • "c1.medium"
        • "c1.xlarge"
        • "c3.large"
        • "c3.xlarge"
        • "c3.2xlarge"
        • "c3.4xlarge"
        • "c3.8xlarge"
        • "c4.large"
        • "c4.xlarge"
        • "c4.2xlarge"
        • "c4.4xlarge"
        • "c4.8xlarge"
        • "c5.large"
        • "c5.xlarge"
        • "c5.2xlarge"
        • "c5.4xlarge"
        • "c5.9xlarge"
        • "c5.18xlarge"
        • "c5d.large"
        • "c5d.xlarge"
        • "c5d.2xlarge"
        • "c5d.4xlarge"
        • "c5d.9xlarge"
        • "c5d.18xlarge"
        • "cc1.4xlarge"
        • "cc2.8xlarge"
        • "g2.2xlarge"
        • "g2.8xlarge"
        • "g3.4xlarge"
        • "g3.8xlarge"
        • "g3.16xlarge"
        • "g3s.xlarge"
        • "cg1.4xlarge"
        • "p2.xlarge"
        • "p2.8xlarge"
        • "p2.16xlarge"
        • "p3.2xlarge"
        • "p3.8xlarge"
        • "p3.16xlarge"
        • "d2.xlarge"
        • "d2.2xlarge"
        • "d2.4xlarge"
        • "d2.8xlarge"
        • "f1.2xlarge"
        • "f1.4xlarge"
        • "f1.16xlarge"
        • "m5.large"
        • "m5.xlarge"
        • "m5.2xlarge"
        • "m5.4xlarge"
        • "m5.12xlarge"
        • "m5.24xlarge"
        • "m5a.large"
        • "m5a.xlarge"
        • "m5a.2xlarge"
        • "m5a.4xlarge"
        • "m5a.12xlarge"
        • "m5a.24xlarge"
        • "m5d.large"
        • "m5d.xlarge"
        • "m5d.2xlarge"
        • "m5d.4xlarge"
        • "m5d.12xlarge"
        • "m5d.24xlarge"
        • "h1.2xlarge"
        • "h1.4xlarge"
        • "h1.8xlarge"
        • "h1.16xlarge"
        • "z1d.large"
        • "z1d.xlarge"
        • "z1d.2xlarge"
        • "z1d.3xlarge"
        • "z1d.6xlarge"
        • "z1d.12xlarge"
        • "u-6tb1.metal"
        • "u-9tb1.metal"
        • "u-12tb1.metal"
      • KeyName — (String)

        The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.

        If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

      • Monitoring — (map)

        The monitoring for the instance.

        • Enabled — (Boolean)

          Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled.

      • Placement — (map)

        The placement for the instance.

        • AvailabilityZone — (String)

          The Availability Zone for the instance.

        • Affinity — (String)

          The affinity setting for an instance on a Dedicated Host.

        • GroupName — (String)

          The name of the placement group for the instance.

        • HostId — (String)

          The ID of the Dedicated Host for the instance.

        • Tenancy — (String)

          The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.

          Possible values include:
          • "default"
          • "dedicated"
          • "host"
        • SpreadDomain — (String)

          Reserved for future use.

      • RamDiskId — (String)

        The ID of the RAM disk.

        We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide.

      • DisableApiTermination — (Boolean)

        If set to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API. To change this attribute to false after launch, use ModifyInstanceAttribute.

      • InstanceInitiatedShutdownBehavior — (String)

        Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

        Default: stop

        Possible values include:
        • "stop"
        • "terminate"
      • UserData — (String)

        The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows).

      • TagSpecifications — (Array<map>)

        The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.

        • ResourceType — (String)

          The type of resource to tag. Currently, the resource types that support tagging on creation are instance and volume. To tag a resource after it has been created, see CreateTags.

          Possible values include:
          • "customer-gateway"
          • "dedicated-host"
          • "dhcp-options"
          • "image"
          • "instance"
          • "internet-gateway"
          • "network-acl"
          • "network-interface"
          • "reserved-instances"
          • "route-table"
          • "snapshot"
          • "spot-instances-request"
          • "subnet"
          • "security-group"
          • "volume"
          • "vpc"
          • "vpn-connection"
          • "vpn-gateway"
        • Tags — (Array<map>)

          The tags to apply to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      • ElasticGpuSpecifications — (Array<map>)

        An elastic GPU to associate with the instance.

        • Typerequired — (String)

          The type of Elastic GPU.

      • SecurityGroupIds — (Array<String>)

        One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.

      • SecurityGroups — (Array<String>)

        [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

      • InstanceMarketOptions — (map)

        The market (purchasing) option for the instances.

        • MarketType — (String)

          The market type.

          Possible values include:
          • "spot"
        • SpotOptions — (map)

          The options for Spot Instances.

          • MaxPrice — (String)

            The maximum hourly price you're willing to pay for the Spot Instances.

          • SpotInstanceType — (String)

            The Spot Instance request type.

            Possible values include:
            • "one-time"
            • "persistent"
          • BlockDurationMinutes — (Integer)

            The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

          • ValidUntil — (Date)

            The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.

          • InstanceInterruptionBehavior — (String)

            The behavior when a Spot Instance is interrupted. The default is terminate.

            Possible values include:
            • "hibernate"
            • "stop"
            • "terminate"
      • CreditSpecification — (map)

        The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.

        • CpuCreditsrequired — (String)

          The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited.

      • CpuOptions — (map)

        The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.

        • CoreCount — (Integer)

          The number of CPU cores for the instance.

        • ThreadsPerCore — (Integer)

          The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1. Otherwise, specify the default value of 2.

      • CapacityReservationSpecification — (map)

        Information about the Capacity Reservation targeting option.

        • CapacityReservationPreference — (String)

          Indicates the instance's Capacity Reservation preferences. Possible preferences include:

          • open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

          • none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

          Possible values include:
          • "open"
          • "none"
        • CapacityReservationTarget — (map)

          Information about the target Capacity Reservation.

          • CapacityReservationId — (String)

            The ID of the Capacity Reservation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LaunchTemplate — (map)

        Information about the launch template.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • CreateTime — (Date)

          The time launch template was created.

        • CreatedBy — (String)

          The principal that created the launch template.

        • DefaultVersionNumber — (Integer)

          The version number of the default version of the launch template.

        • LatestVersionNumber — (Integer)

          The version number of the latest version of the launch template.

        • Tags — (Array<map>)

          The tags for the launch template.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createLaunchTemplateVersion(params = {}, callback) ⇒ AWS.Request

Creates a new version for a launch template. You can specify an existing version of launch template from which to base the new version.

Launch template versions are numbered in the order in which they are created. You cannot specify, change, or replace the numbering of launch template versions.

Service Reference:

Examples:

To create a launch template version


/* This example creates a new launch template version based on version 1 of the specified launch template and specifies a different AMI ID. */

 var params = {
  LaunchTemplateData: {
   ImageId: "ami-c998b6b2"
  }, 
  LaunchTemplateId: "lt-0abcd290751193123", 
  SourceVersion: "1", 
  VersionDescription: "WebVersion2"
 };
 ec2.createLaunchTemplateVersion(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LaunchTemplateVersion: {
     CreateTime: <Date Representation>, 
     CreatedBy: "arn:aws:iam::123456789012:root", 
     DefaultVersion: false, 
     LaunchTemplateData: {
      ImageId: "ami-c998b6b2", 
      InstanceType: "t2.micro", 
      NetworkInterfaces: [
         {
        AssociatePublicIpAddress: true, 
        DeviceIndex: 0, 
        Ipv6Addresses: [
           {
          Ipv6Address: "2001:db8:1234:1a00::123"
         }
        ], 
        SubnetId: "subnet-7b16de0c"
       }
      ]
     }, 
     LaunchTemplateId: "lt-0abcd290751193123", 
     LaunchTemplateName: "my-template", 
     VersionDescription: "WebVersion2", 
     VersionNumber: 2
    }
   }
   */
 });

Calling the createLaunchTemplateVersion operation

var params = {
  LaunchTemplateData: { /* required */
    BlockDeviceMappings: [
      {
        DeviceName: 'STRING_VALUE',
        Ebs: {
          DeleteOnTermination: true || false,
          Encrypted: true || false,
          Iops: 0,
          KmsKeyId: 'STRING_VALUE',
          SnapshotId: 'STRING_VALUE',
          VolumeSize: 0,
          VolumeType: standard | io1 | gp2 | sc1 | st1
        },
        NoDevice: 'STRING_VALUE',
        VirtualName: 'STRING_VALUE'
      },
      /* more items */
    ],
    CapacityReservationSpecification: {
      CapacityReservationPreference: open | none,
      CapacityReservationTarget: {
        CapacityReservationId: 'STRING_VALUE'
      }
    },
    CpuOptions: {
      CoreCount: 0,
      ThreadsPerCore: 0
    },
    CreditSpecification: {
      CpuCredits: 'STRING_VALUE' /* required */
    },
    DisableApiTermination: true || false,
    EbsOptimized: true || false,
    ElasticGpuSpecifications: [
      {
        Type: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    IamInstanceProfile: {
      Arn: 'STRING_VALUE',
      Name: 'STRING_VALUE'
    },
    ImageId: 'STRING_VALUE',
    InstanceInitiatedShutdownBehavior: stop | terminate,
    InstanceMarketOptions: {
      MarketType: spot,
      SpotOptions: {
        BlockDurationMinutes: 0,
        InstanceInterruptionBehavior: hibernate | stop | terminate,
        MaxPrice: 'STRING_VALUE',
        SpotInstanceType: one-time | persistent,
        ValidUntil: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
      }
    },
    InstanceType: t1.micro | t2.nano | t2.micro | t2.small | t2.medium | t2.large | t2.xlarge | t2.2xlarge | t3.nano | t3.micro | t3.small | t3.medium | t3.large | t3.xlarge | t3.2xlarge | m1.small | m1.medium | m1.large | m1.xlarge | m3.medium | m3.large | m3.xlarge | m3.2xlarge | m4.large | m4.xlarge | m4.2xlarge | m4.4xlarge | m4.10xlarge | m4.16xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cr1.8xlarge | r3.large | r3.xlarge | r3.2xlarge | r3.4xlarge | r3.8xlarge | r4.large | r4.xlarge | r4.2xlarge | r4.4xlarge | r4.8xlarge | r4.16xlarge | r5.large | r5.xlarge | r5.2xlarge | r5.4xlarge | r5.8xlarge | r5.12xlarge | r5.16xlarge | r5.24xlarge | r5.metal | r5a.large | r5a.xlarge | r5a.2xlarge | r5a.4xlarge | r5a.12xlarge | r5a.24xlarge | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | x1.16xlarge | x1.32xlarge | x1e.xlarge | x1e.2xlarge | x1e.4xlarge | x1e.8xlarge | x1e.16xlarge | x1e.32xlarge | i2.xlarge | i2.2xlarge | i2.4xlarge | i2.8xlarge | i3.large | i3.xlarge | i3.2xlarge | i3.4xlarge | i3.8xlarge | i3.16xlarge | i3.metal | hi1.4xlarge | hs1.8xlarge | c1.medium | c1.xlarge | c3.large | c3.xlarge | c3.2xlarge | c3.4xlarge | c3.8xlarge | c4.large | c4.xlarge | c4.2xlarge | c4.4xlarge | c4.8xlarge | c5.large | c5.xlarge | c5.2xlarge | c5.4xlarge | c5.9xlarge | c5.18xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.18xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4xlarge | g3.8xlarge | g3.16xlarge | g3s.xlarge | cg1.4xlarge | p2.xlarge | p2.8xlarge | p2.16xlarge | p3.2xlarge | p3.8xlarge | p3.16xlarge | d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge | f1.2xlarge | f1.4xlarge | f1.16xlarge | m5.large | m5.xlarge | m5.2xlarge | m5.4xlarge | m5.12xlarge | m5.24xlarge | m5a.large | m5a.xlarge | m5a.2xlarge | m5a.4xlarge | m5a.12xlarge | m5a.24xlarge | m5d.large | m5d.xlarge | m5d.2xlarge | m5d.4xlarge | m5d.12xlarge | m5d.24xlarge | h1.2xlarge | h1.4xlarge | h1.8xlarge | h1.16xlarge | z1d.large | z1d.xlarge | z1d.2xlarge | z1d.3xlarge | z1d.6xlarge | z1d.12xlarge | u-6tb1.metal | u-9tb1.metal | u-12tb1.metal,
    KernelId: 'STRING_VALUE',
    KeyName: 'STRING_VALUE',
    Monitoring: {
      Enabled: true || false
    },
    NetworkInterfaces: [
      {
        AssociatePublicIpAddress: true || false,
        DeleteOnTermination: true || false,
        Description: 'STRING_VALUE',
        DeviceIndex: 0,
        Groups: [
          'STRING_VALUE',
          /* more items */
        ],
        Ipv6AddressCount: 0,
        Ipv6Addresses: [
          {
            Ipv6Address: 'STRING_VALUE'
          },
          /* more items */
        ],
        NetworkInterfaceId: 'STRING_VALUE',
        PrivateIpAddress: 'STRING_VALUE',
        PrivateIpAddresses: [
          {
            Primary: true || false,
            PrivateIpAddress: 'STRING_VALUE'
          },
          /* more items */
        ],
        SecondaryPrivateIpAddressCount: 0,
        SubnetId: 'STRING_VALUE'
      },
      /* more items */
    ],
    Placement: {
      Affinity: 'STRING_VALUE',
      AvailabilityZone: 'STRING_VALUE',
      GroupName: 'STRING_VALUE',
      HostId: 'STRING_VALUE',
      SpreadDomain: 'STRING_VALUE',
      Tenancy: default | dedicated | host
    },
    RamDiskId: 'STRING_VALUE',
    SecurityGroupIds: [
      'STRING_VALUE',
      /* more items */
    ],
    SecurityGroups: [
      'STRING_VALUE',
      /* more items */
    ],
    TagSpecifications: [
      {
        ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
        Tags: [
          {
            Key: 'STRING_VALUE',
            Value: 'STRING_VALUE'
          },
          /* more items */
        ]
      },
      /* more items */
    ],
    UserData: 'STRING_VALUE'
  },
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  LaunchTemplateId: 'STRING_VALUE',
  LaunchTemplateName: 'STRING_VALUE',
  SourceVersion: 'STRING_VALUE',
  VersionDescription: 'STRING_VALUE'
};
ec2.createLaunchTemplateVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

    • LaunchTemplateId — (String)

      The ID of the launch template. You must specify either the launch template ID or launch template name in the request.

    • LaunchTemplateName — (String)

      The name of the launch template. You must specify either the launch template ID or launch template name in the request.

    • SourceVersion — (String)

      The version number of the launch template version on which to base the new version. The new version inherits the same launch parameters as the source version, except for parameters that you specify in LaunchTemplateData.

    • VersionDescription — (String)

      A description for the version of the launch template.

    • LaunchTemplateData — (map)

      The information for the launch template.

      • KernelId — (String)

        The ID of the kernel.

        We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide.

      • EbsOptimized — (Boolean)

        Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

      • IamInstanceProfile — (map)

        The IAM instance profile.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the instance profile.

        • Name — (String)

          The name of the instance profile.

      • BlockDeviceMappings — (Array<map>)

        The block device mapping.

        Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error. This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed using this action.

        • DeviceName — (String)

          The device name (for example, /dev/sdh or xvdh).

        • VirtualName — (String)

          The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

        • Ebs — (map)

          Parameters used to automatically set up EBS volumes when the instance is launched.

          • Encrypted — (Boolean)

            Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value.

          • DeleteOnTermination — (Boolean)

            Indicates whether the EBS volume is deleted on instance termination.

          • Iops — (Integer)

            The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

            Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.

          • KmsKeyId — (String)

            The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.

          • SnapshotId — (String)

            The ID of the snapshot.

          • VolumeSize — (Integer)

            The size of the volume, in GiB.

            Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

          • VolumeType — (String)

            The volume type.

            Possible values include:
            • "standard"
            • "io1"
            • "gp2"
            • "sc1"
            • "st1"
        • NoDevice — (String)

          Suppresses the specified device included in the block device mapping of the AMI.

      • NetworkInterfaces — (Array<map>)

        One or more network interfaces.

        • AssociatePublicIpAddress — (Boolean)

          Associates a public IPv4 address with eth0 for a new network interface.

        • DeleteOnTermination — (Boolean)

          Indicates whether the network interface is deleted when the instance is terminated.

        • Description — (String)

          A description for the network interface.

        • DeviceIndex — (Integer)

          The device index for the network interface attachment.

        • Groups — (Array<String>)

          The IDs of one or more security groups.

        • Ipv6AddressCount — (Integer)

          The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.

        • Ipv6Addresses — (Array<map>)

          One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.

          • Ipv6Address — (String)

            The IPv6 address.

        • NetworkInterfaceId — (String)

          The ID of the network interface.

        • PrivateIpAddress — (String)

          The primary private IPv4 address of the network interface.

        • PrivateIpAddresses — (Array<map>)

          One or more private IPv4 addresses.

          • Primary — (Boolean)

            Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

          • PrivateIpAddress — (String)

            The private IPv4 addresses.

        • SecondaryPrivateIpAddressCount — (Integer)

          The number of secondary private IPv4 addresses to assign to a network interface.

        • SubnetId — (String)

          The ID of the subnet for the network interface.

      • ImageId — (String)

        The ID of the AMI, which you can get by using DescribeImages.

      • InstanceType — (String)

        The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

        Possible values include:
        • "t1.micro"
        • "t2.nano"
        • "t2.micro"
        • "t2.small"
        • "t2.medium"
        • "t2.large"
        • "t2.xlarge"
        • "t2.2xlarge"
        • "t3.nano"
        • "t3.micro"
        • "t3.small"
        • "t3.medium"
        • "t3.large"
        • "t3.xlarge"
        • "t3.2xlarge"
        • "m1.small"
        • "m1.medium"
        • "m1.large"
        • "m1.xlarge"
        • "m3.medium"
        • "m3.large"
        • "m3.xlarge"
        • "m3.2xlarge"
        • "m4.large"
        • "m4.xlarge"
        • "m4.2xlarge"
        • "m4.4xlarge"
        • "m4.10xlarge"
        • "m4.16xlarge"
        • "m2.xlarge"
        • "m2.2xlarge"
        • "m2.4xlarge"
        • "cr1.8xlarge"
        • "r3.large"
        • "r3.xlarge"
        • "r3.2xlarge"
        • "r3.4xlarge"
        • "r3.8xlarge"
        • "r4.large"
        • "r4.xlarge"
        • "r4.2xlarge"
        • "r4.4xlarge"
        • "r4.8xlarge"
        • "r4.16xlarge"
        • "r5.large"
        • "r5.xlarge"
        • "r5.2xlarge"
        • "r5.4xlarge"
        • "r5.8xlarge"
        • "r5.12xlarge"
        • "r5.16xlarge"
        • "r5.24xlarge"
        • "r5.metal"
        • "r5a.large"
        • "r5a.xlarge"
        • "r5a.2xlarge"
        • "r5a.4xlarge"
        • "r5a.12xlarge"
        • "r5a.24xlarge"
        • "r5d.large"
        • "r5d.xlarge"
        • "r5d.2xlarge"
        • "r5d.4xlarge"
        • "r5d.8xlarge"
        • "r5d.12xlarge"
        • "r5d.16xlarge"
        • "r5d.24xlarge"
        • "r5d.metal"
        • "x1.16xlarge"
        • "x1.32xlarge"
        • "x1e.xlarge"
        • "x1e.2xlarge"
        • "x1e.4xlarge"
        • "x1e.8xlarge"
        • "x1e.16xlarge"
        • "x1e.32xlarge"
        • "i2.xlarge"
        • "i2.2xlarge"
        • "i2.4xlarge"
        • "i2.8xlarge"
        • "i3.large"
        • "i3.xlarge"
        • "i3.2xlarge"
        • "i3.4xlarge"
        • "i3.8xlarge"
        • "i3.16xlarge"
        • "i3.metal"
        • "hi1.4xlarge"
        • "hs1.8xlarge"
        • "c1.medium"
        • "c1.xlarge"
        • "c3.large"
        • "c3.xlarge"
        • "c3.2xlarge"
        • "c3.4xlarge"
        • "c3.8xlarge"
        • "c4.large"
        • "c4.xlarge"
        • "c4.2xlarge"
        • "c4.4xlarge"
        • "c4.8xlarge"
        • "c5.large"
        • "c5.xlarge"
        • "c5.2xlarge"
        • "c5.4xlarge"
        • "c5.9xlarge"
        • "c5.18xlarge"
        • "c5d.large"
        • "c5d.xlarge"
        • "c5d.2xlarge"
        • "c5d.4xlarge"
        • "c5d.9xlarge"
        • "c5d.18xlarge"
        • "cc1.4xlarge"
        • "cc2.8xlarge"
        • "g2.2xlarge"
        • "g2.8xlarge"
        • "g3.4xlarge"
        • "g3.8xlarge"
        • "g3.16xlarge"
        • "g3s.xlarge"
        • "cg1.4xlarge"
        • "p2.xlarge"
        • "p2.8xlarge"
        • "p2.16xlarge"
        • "p3.2xlarge"
        • "p3.8xlarge"
        • "p3.16xlarge"
        • "d2.xlarge"
        • "d2.2xlarge"
        • "d2.4xlarge"
        • "d2.8xlarge"
        • "f1.2xlarge"
        • "f1.4xlarge"
        • "f1.16xlarge"
        • "m5.large"
        • "m5.xlarge"
        • "m5.2xlarge"
        • "m5.4xlarge"
        • "m5.12xlarge"
        • "m5.24xlarge"
        • "m5a.large"
        • "m5a.xlarge"
        • "m5a.2xlarge"
        • "m5a.4xlarge"
        • "m5a.12xlarge"
        • "m5a.24xlarge"
        • "m5d.large"
        • "m5d.xlarge"
        • "m5d.2xlarge"
        • "m5d.4xlarge"
        • "m5d.12xlarge"
        • "m5d.24xlarge"
        • "h1.2xlarge"
        • "h1.4xlarge"
        • "h1.8xlarge"
        • "h1.16xlarge"
        • "z1d.large"
        • "z1d.xlarge"
        • "z1d.2xlarge"
        • "z1d.3xlarge"
        • "z1d.6xlarge"
        • "z1d.12xlarge"
        • "u-6tb1.metal"
        • "u-9tb1.metal"
        • "u-12tb1.metal"
      • KeyName — (String)

        The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.

        If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

      • Monitoring — (map)

        The monitoring for the instance.

        • Enabled — (Boolean)

          Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled.

      • Placement — (map)

        The placement for the instance.

        • AvailabilityZone — (String)

          The Availability Zone for the instance.

        • Affinity — (String)

          The affinity setting for an instance on a Dedicated Host.

        • GroupName — (String)

          The name of the placement group for the instance.

        • HostId — (String)

          The ID of the Dedicated Host for the instance.

        • Tenancy — (String)

          The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.

          Possible values include:
          • "default"
          • "dedicated"
          • "host"
        • SpreadDomain — (String)

          Reserved for future use.

      • RamDiskId — (String)

        The ID of the RAM disk.

        We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide.

      • DisableApiTermination — (Boolean)

        If set to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API. To change this attribute to false after launch, use ModifyInstanceAttribute.

      • InstanceInitiatedShutdownBehavior — (String)

        Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

        Default: stop

        Possible values include:
        • "stop"
        • "terminate"
      • UserData — (String)

        The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows).

      • TagSpecifications — (Array<map>)

        The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.

        • ResourceType — (String)

          The type of resource to tag. Currently, the resource types that support tagging on creation are instance and volume. To tag a resource after it has been created, see CreateTags.

          Possible values include:
          • "customer-gateway"
          • "dedicated-host"
          • "dhcp-options"
          • "image"
          • "instance"
          • "internet-gateway"
          • "network-acl"
          • "network-interface"
          • "reserved-instances"
          • "route-table"
          • "snapshot"
          • "spot-instances-request"
          • "subnet"
          • "security-group"
          • "volume"
          • "vpc"
          • "vpn-connection"
          • "vpn-gateway"
        • Tags — (Array<map>)

          The tags to apply to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      • ElasticGpuSpecifications — (Array<map>)

        An elastic GPU to associate with the instance.

        • Typerequired — (String)

          The type of Elastic GPU.

      • SecurityGroupIds — (Array<String>)

        One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.

      • SecurityGroups — (Array<String>)

        [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

      • InstanceMarketOptions — (map)

        The market (purchasing) option for the instances.

        • MarketType — (String)

          The market type.

          Possible values include:
          • "spot"
        • SpotOptions — (map)

          The options for Spot Instances.

          • MaxPrice — (String)

            The maximum hourly price you're willing to pay for the Spot Instances.

          • SpotInstanceType — (String)

            The Spot Instance request type.

            Possible values include:
            • "one-time"
            • "persistent"
          • BlockDurationMinutes — (Integer)

            The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

          • ValidUntil — (Date)

            The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.

          • InstanceInterruptionBehavior — (String)

            The behavior when a Spot Instance is interrupted. The default is terminate.

            Possible values include:
            • "hibernate"
            • "stop"
            • "terminate"
      • CreditSpecification — (map)

        The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.

        • CpuCreditsrequired — (String)

          The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited.

      • CpuOptions — (map)

        The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.

        • CoreCount — (Integer)

          The number of CPU cores for the instance.

        • ThreadsPerCore — (Integer)

          The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1. Otherwise, specify the default value of 2.

      • CapacityReservationSpecification — (map)

        Information about the Capacity Reservation targeting option.

        • CapacityReservationPreference — (String)

          Indicates the instance's Capacity Reservation preferences. Possible preferences include:

          • open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

          • none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

          Possible values include:
          • "open"
          • "none"
        • CapacityReservationTarget — (map)

          Information about the target Capacity Reservation.

          • CapacityReservationId — (String)

            The ID of the Capacity Reservation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LaunchTemplateVersion — (map)

        Information about the launch template version.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • VersionNumber — (Integer)

          The version number.

        • VersionDescription — (String)

          The description for the version.

        • CreateTime — (Date)

          The time the version was created.

        • CreatedBy — (String)

          The principal that created the version.

        • DefaultVersion — (Boolean)

          Indicates whether the version is the default version.

        • LaunchTemplateData — (map)

          Information about the launch template.

          • KernelId — (String)

            The ID of the kernel, if applicable.

          • EbsOptimized — (Boolean)

            Indicates whether the instance is optimized for Amazon EBS I/O.

          • IamInstanceProfile — (map)

            The IAM instance profile.

            • Arn — (String)

              The Amazon Resource Name (ARN) of the instance profile.

            • Name — (String)

              The name of the instance profile.

          • BlockDeviceMappings — (Array<map>)

            The block device mappings.

            • DeviceName — (String)

              The device name.

            • VirtualName — (String)

              The virtual device name (ephemeralN).

            • Ebs — (map)

              Information about the block device for an EBS volume.

              • Encrypted — (Boolean)

                Indicates whether the EBS volume is encrypted.

              • DeleteOnTermination — (Boolean)

                Indicates whether the EBS volume is deleted on instance termination.

              • Iops — (Integer)

                The number of I/O operations per second (IOPS) that the volume supports.

              • KmsKeyId — (String)

                The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.

              • SnapshotId — (String)

                The ID of the snapshot.

              • VolumeSize — (Integer)

                The size of the volume, in GiB.

              • VolumeType — (String)

                The volume type.

                Possible values include:
                • "standard"
                • "io1"
                • "gp2"
                • "sc1"
                • "st1"
            • NoDevice — (String)

              Suppresses the specified device included in the block device mapping of the AMI.

          • NetworkInterfaces — (Array<map>)

            The network interfaces.

            • AssociatePublicIpAddress — (Boolean)

              Indicates whether to associate a public IPv4 address with eth0 for a new network interface.

            • DeleteOnTermination — (Boolean)

              Indicates whether the network interface is deleted when the instance is terminated.

            • Description — (String)

              A description for the network interface.

            • DeviceIndex — (Integer)

              The device index for the network interface attachment.

            • Groups — (Array<String>)

              The IDs of one or more security groups.

            • Ipv6AddressCount — (Integer)

              The number of IPv6 addresses for the network interface.

            • Ipv6Addresses — (Array<map>)

              The IPv6 addresses for the network interface.

              • Ipv6Address — (String)

                The IPv6 address.

            • NetworkInterfaceId — (String)

              The ID of the network interface.

            • PrivateIpAddress — (String)

              The primary private IPv4 address of the network interface.

            • PrivateIpAddresses — (Array<map>)

              One or more private IPv4 addresses.

              • Primary — (Boolean)

                Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

              • PrivateIpAddress — (String)

                The private IPv4 addresses.

            • SecondaryPrivateIpAddressCount — (Integer)

              The number of secondary private IPv4 addresses for the network interface.

            • SubnetId — (String)

              The ID of the subnet for the network interface.

          • ImageId — (String)

            The ID of the AMI that was used to launch the instance.

          • InstanceType — (String)

            The instance type.

            Possible values include:
            • "t1.micro"
            • "t2.nano"
            • "t2.micro"
            • "t2.small"
            • "t2.medium"
            • "t2.large"
            • "t2.xlarge"
            • "t2.2xlarge"
            • "t3.nano"
            • "t3.micro"
            • "t3.small"
            • "t3.medium"
            • "t3.large"
            • "t3.xlarge"
            • "t3.2xlarge"
            • "m1.small"
            • "m1.medium"
            • "m1.large"
            • "m1.xlarge"
            • "m3.medium"
            • "m3.large"
            • "m3.xlarge"
            • "m3.2xlarge"
            • "m4.large"
            • "m4.xlarge"
            • "m4.2xlarge"
            • "m4.4xlarge"
            • "m4.10xlarge"
            • "m4.16xlarge"
            • "m2.xlarge"
            • "m2.2xlarge"
            • "m2.4xlarge"
            • "cr1.8xlarge"
            • "r3.large"
            • "r3.xlarge"
            • "r3.2xlarge"
            • "r3.4xlarge"
            • "r3.8xlarge"
            • "r4.large"
            • "r4.xlarge"
            • "r4.2xlarge"
            • "r4.4xlarge"
            • "r4.8xlarge"
            • "r4.16xlarge"
            • "r5.large"
            • "r5.xlarge"
            • "r5.2xlarge"
            • "r5.4xlarge"
            • "r5.8xlarge"
            • "r5.12xlarge"
            • "r5.16xlarge"
            • "r5.24xlarge"
            • "r5.metal"
            • "r5a.large"
            • "r5a.xlarge"
            • "r5a.2xlarge"
            • "r5a.4xlarge"
            • "r5a.12xlarge"
            • "r5a.24xlarge"
            • "r5d.large"
            • "r5d.xlarge"
            • "r5d.2xlarge"
            • "r5d.4xlarge"
            • "r5d.8xlarge"
            • "r5d.12xlarge"
            • "r5d.16xlarge"
            • "r5d.24xlarge"
            • "r5d.metal"
            • "x1.16xlarge"
            • "x1.32xlarge"
            • "x1e.xlarge"
            • "x1e.2xlarge"
            • "x1e.4xlarge"
            • "x1e.8xlarge"
            • "x1e.16xlarge"
            • "x1e.32xlarge"
            • "i2.xlarge"
            • "i2.2xlarge"
            • "i2.4xlarge"
            • "i2.8xlarge"
            • "i3.large"
            • "i3.xlarge"
            • "i3.2xlarge"
            • "i3.4xlarge"
            • "i3.8xlarge"
            • "i3.16xlarge"
            • "i3.metal"
            • "hi1.4xlarge"
            • "hs1.8xlarge"
            • "c1.medium"
            • "c1.xlarge"
            • "c3.large"
            • "c3.xlarge"
            • "c3.2xlarge"
            • "c3.4xlarge"
            • "c3.8xlarge"
            • "c4.large"
            • "c4.xlarge"
            • "c4.2xlarge"
            • "c4.4xlarge"
            • "c4.8xlarge"
            • "c5.large"
            • "c5.xlarge"
            • "c5.2xlarge"
            • "c5.4xlarge"
            • "c5.9xlarge"
            • "c5.18xlarge"
            • "c5d.large"
            • "c5d.xlarge"
            • "c5d.2xlarge"
            • "c5d.4xlarge"
            • "c5d.9xlarge"
            • "c5d.18xlarge"
            • "cc1.4xlarge"
            • "cc2.8xlarge"
            • "g2.2xlarge"
            • "g2.8xlarge"
            • "g3.4xlarge"
            • "g3.8xlarge"
            • "g3.16xlarge"
            • "g3s.xlarge"
            • "cg1.4xlarge"
            • "p2.xlarge"
            • "p2.8xlarge"
            • "p2.16xlarge"
            • "p3.2xlarge"
            • "p3.8xlarge"
            • "p3.16xlarge"
            • "d2.xlarge"
            • "d2.2xlarge"
            • "d2.4xlarge"
            • "d2.8xlarge"
            • "f1.2xlarge"
            • "f1.4xlarge"
            • "f1.16xlarge"
            • "m5.large"
            • "m5.xlarge"
            • "m5.2xlarge"
            • "m5.4xlarge"
            • "m5.12xlarge"
            • "m5.24xlarge"
            • "m5a.large"
            • "m5a.xlarge"
            • "m5a.2xlarge"
            • "m5a.4xlarge"
            • "m5a.12xlarge"
            • "m5a.24xlarge"
            • "m5d.large"
            • "m5d.xlarge"
            • "m5d.2xlarge"
            • "m5d.4xlarge"
            • "m5d.12xlarge"
            • "m5d.24xlarge"
            • "h1.2xlarge"
            • "h1.4xlarge"
            • "h1.8xlarge"
            • "h1.16xlarge"
            • "z1d.large"
            • "z1d.xlarge"
            • "z1d.2xlarge"
            • "z1d.3xlarge"
            • "z1d.6xlarge"
            • "z1d.12xlarge"
            • "u-6tb1.metal"
            • "u-9tb1.metal"
            • "u-12tb1.metal"
          • KeyName — (String)

            The name of the key pair.

          • Monitoring — (map)

            The monitoring for the instance.

            • Enabled — (Boolean)

              Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

          • Placement — (map)

            The placement of the instance.

            • AvailabilityZone — (String)

              The Availability Zone of the instance.

            • Affinity — (String)

              The affinity setting for the instance on the Dedicated Host.

            • GroupName — (String)

              The name of the placement group for the instance.

            • HostId — (String)

              The ID of the Dedicated Host for the instance.

            • Tenancy — (String)

              The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.

              Possible values include:
              • "default"
              • "dedicated"
              • "host"
            • SpreadDomain — (String)

              Reserved for future use.

          • RamDiskId — (String)

            The ID of the RAM disk, if applicable.

          • DisableApiTermination — (Boolean)

            If set to true, indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.

          • InstanceInitiatedShutdownBehavior — (String)

            Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

            Possible values include:
            • "stop"
            • "terminate"
          • UserData — (String)

            The user data for the instance.

          • TagSpecifications — (Array<map>)

            The tags.

            • ResourceType — (String)

              The type of resource.

              Possible values include:
              • "customer-gateway"
              • "dedicated-host"
              • "dhcp-options"
              • "image"
              • "instance"
              • "internet-gateway"
              • "network-acl"
              • "network-interface"
              • "reserved-instances"
              • "route-table"
              • "snapshot"
              • "spot-instances-request"
              • "subnet"
              • "security-group"
              • "volume"
              • "vpc"
              • "vpn-connection"
              • "vpn-gateway"
            • Tags — (Array<map>)

              The tags for the resource.

              • Key — (String)

                The key of the tag.

                Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

              • Value — (String)

                The value of the tag.

                Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

          • ElasticGpuSpecifications — (Array<map>)

            The elastic GPU specification.

            • Type — (String)

              The elastic GPU type.

          • SecurityGroupIds — (Array<String>)

            The security group IDs.

          • SecurityGroups — (Array<String>)

            The security group names.

          • InstanceMarketOptions — (map)

            The market (purchasing) option for the instances.

            • MarketType — (String)

              The market type.

              Possible values include:
              • "spot"
            • SpotOptions — (map)

              The options for Spot Instances.

              • MaxPrice — (String)

                The maximum hourly price you're willing to pay for the Spot Instances.

              • SpotInstanceType — (String)

                The Spot Instance request type.

                Possible values include:
                • "one-time"
                • "persistent"
              • BlockDurationMinutes — (Integer)

                The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

              • ValidUntil — (Date)

                The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

              • InstanceInterruptionBehavior — (String)

                The behavior when a Spot Instance is interrupted.

                Possible values include:
                • "hibernate"
                • "stop"
                • "terminate"
          • CreditSpecification — (map)

            The credit option for CPU usage of the instance.

            • CpuCredits — (String)

              The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited.

          • CpuOptions — (map)

            The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.

            • CoreCount — (Integer)

              The number of CPU cores for the instance.

            • ThreadsPerCore — (Integer)

              The number of threads per CPU core.

          • CapacityReservationSpecification — (map)

            Information about the Capacity Reservation targeting option.

            • CapacityReservationPreference — (String)

              Indicates the instance's Capacity Reservation preferences. Possible preferences include:

              • open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

              • none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

              Possible values include:
              • "open"
              • "none"
            • CapacityReservationTarget — (map)

              Information about the target Capacity Reservation.

              • CapacityReservationId — (String)

                The ID of the Capacity Reservation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNatGateway(params = {}, callback) ⇒ AWS.Request

Creates a NAT gateway in the specified public subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. Internet-bound traffic from a private subnet can be routed to the NAT gateway, therefore enabling instances in the private subnet to connect to the internet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a NAT gateway


/* This example creates a NAT gateway in subnet subnet-1a2b3c4d and associates an Elastic IP address with the allocation ID eipalloc-37fc1a52 with the NAT gateway. */

 var params = {
  AllocationId: "eipalloc-37fc1a52", 
  SubnetId: "subnet-1a2b3c4d"
 };
 ec2.createNatGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NatGateway: {
     CreateTime: <Date Representation>, 
     NatGatewayAddresses: [
        {
       AllocationId: "eipalloc-37fc1a52"
      }
     ], 
     NatGatewayId: "nat-08d48af2a8e83edfd", 
     State: "pending", 
     SubnetId: "subnet-1a2b3c4d", 
     VpcId: "vpc-1122aabb"
    }
   }
   */
 });

Calling the createNatGateway operation

var params = {
  AllocationId: 'STRING_VALUE', /* required */
  SubnetId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE'
};
ec2.createNatGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AllocationId — (String)

      The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

    • ClientToken — (String)

      Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

      Constraint: Maximum 64 ASCII characters.

    • SubnetId — (String)

      The subnet in which to create the NAT gateway.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ClientToken — (String)

        Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

      • NatGateway — (map)

        Information about the NAT gateway.

        • CreateTime — (Date)

          The date and time the NAT gateway was created.

        • DeleteTime — (Date)

          The date and time the NAT gateway was deleted, if applicable.

        • FailureCode — (String)

          If the NAT gateway could not be created, specifies the error code for the failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound)

        • FailureMessage — (String)

          If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

          • For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway"

          • For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached"

          • For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway"

          • For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated"

          • For InternalError: "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again."

          • For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found."

        • NatGatewayAddresses — (Array<map>)

          Information about the IP addresses and network interface associated with the NAT gateway.

          • AllocationId — (String)

            The allocation ID of the Elastic IP address that's associated with the NAT gateway.

          • NetworkInterfaceId — (String)

            The ID of the network interface associated with the NAT gateway.

          • PrivateIp — (String)

            The private IP address associated with the Elastic IP address.

          • PublicIp — (String)

            The Elastic IP address associated with the NAT gateway.

        • NatGatewayId — (String)

          The ID of the NAT gateway.

        • ProvisionedBandwidth — (map)

          Reserved. If you need to sustain traffic greater than the documented limits, contact us through the Support Center.

        • State — (String)

          The state of the NAT gateway.

          • pending: The NAT gateway is being created and is not ready to process traffic.

          • failed: The NAT gateway could not be created. Check the failureCode and failureMessage fields for the reason.

          • available: The NAT gateway is able to process traffic. This status remains until you delete the NAT gateway, and does not indicate the health of the NAT gateway.

          • deleting: The NAT gateway is in the process of being terminated and may still be processing traffic.

          • deleted: The NAT gateway has been terminated and is no longer processing traffic.

          Possible values include:
          • "pending"
          • "failed"
          • "available"
          • "deleting"
          • "deleted"
        • SubnetId — (String)

          The ID of the subnet in which the NAT gateway is located.

        • VpcId — (String)

          The ID of the VPC in which the NAT gateway is located.

        • Tags — (Array<map>)

          The tags for the NAT gateway.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNetworkAcl(params = {}, callback) ⇒ AWS.Request

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a network ACL


/* This example creates a network ACL for the specified VPC. */

 var params = {
  VpcId: "vpc-a01106c2"
 };
 ec2.createNetworkAcl(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NetworkAcl: {
     Associations: [
     ], 
     Entries: [
        {
       CidrBlock: "0.0.0.0/0", 
       Egress: true, 
       Protocol: "-1", 
       RuleAction: "deny", 
       RuleNumber: 32767
      }, 
        {
       CidrBlock: "0.0.0.0/0", 
       Egress: false, 
       Protocol: "-1", 
       RuleAction: "deny", 
       RuleNumber: 32767
      }
     ], 
     IsDefault: false, 
     NetworkAclId: "acl-5fb85d36", 
     Tags: [
     ], 
     VpcId: "vpc-a01106c2"
    }
   }
   */
 });

Calling the createNetworkAcl operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.createNetworkAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcId — (String)

      The ID of the VPC.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NetworkAcl — (map)

        Information about the network ACL.

        • Associations — (Array<map>)

          Any associations between the network ACL and one or more subnets

          • NetworkAclAssociationId — (String)

            The ID of the association between a network ACL and a subnet.

          • NetworkAclId — (String)

            The ID of the network ACL.

          • SubnetId — (String)

            The ID of the subnet.

        • Entries — (Array<map>)

          One or more entries (rules) in the network ACL.

          • CidrBlock — (String)

            The IPv4 network range to allow or deny, in CIDR notation.

          • Egress — (Boolean)

            Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).

          • IcmpTypeCode — (map)

            ICMP protocol: The ICMP type and code.

            • Code — (Integer)

              The ICMP code. A value of -1 means all codes for the specified ICMP type.

            • Type — (Integer)

              The ICMP type. A value of -1 means all types.

          • Ipv6CidrBlock — (String)

            The IPv6 network range to allow or deny, in CIDR notation.

          • PortRange — (map)

            TCP or UDP protocols: The range of ports the rule applies to.

            • From — (Integer)

              The first port in the range.

            • To — (Integer)

              The last port in the range.

          • Protocol — (String)

            The protocol number. A value of "-1" means all protocols.

          • RuleAction — (String)

            Indicates whether to allow or deny the traffic that matches the rule.

            Possible values include:
            • "allow"
            • "deny"
          • RuleNumber — (Integer)

            The rule number for the entry. ACL entries are processed in ascending order by rule number.

        • IsDefault — (Boolean)

          Indicates whether this is the default network ACL for the VPC.

        • NetworkAclId — (String)

          The ID of the network ACL.

        • Tags — (Array<map>)

          Any tags assigned to the network ACL.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VpcId — (String)

          The ID of the VPC for the network ACL.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNetworkAclEntry(params = {}, callback) ⇒ AWS.Request

Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.

We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.

After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.

For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a network ACL entry


/* This example creates an entry for the specified network ACL. The rule allows ingress traffic from anywhere (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet. */

 var params = {
  CidrBlock: "0.0.0.0/0", 
  Egress: false, 
  NetworkAclId: "acl-5fb85d36", 
  PortRange: {
   From: 53, 
   To: 53
  }, 
  Protocol: "17", 
  RuleAction: "allow", 
  RuleNumber: 100
 };
 ec2.createNetworkAclEntry(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createNetworkAclEntry operation

var params = {
  Egress: true || false, /* required */
  NetworkAclId: 'STRING_VALUE', /* required */
  Protocol: 'STRING_VALUE', /* required */
  RuleAction: allow | deny, /* required */
  RuleNumber: 0, /* required */
  CidrBlock: 'STRING_VALUE',
  DryRun: true || false,
  IcmpTypeCode: {
    Code: 0,
    Type: 0
  },
  Ipv6CidrBlock: 'STRING_VALUE',
  PortRange: {
    From: 0,
    To: 0
  }
};
ec2.createNetworkAclEntry(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CidrBlock — (String)

      The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24).

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Egress — (Boolean)

      Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet).

    • IcmpTypeCode — (map)

      ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.

      • Code — (Integer)

        The ICMP code. A value of -1 means all codes for the specified ICMP type.

      • Type — (Integer)

        The ICMP type. A value of -1 means all types.

    • Ipv6CidrBlock — (String)

      The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64).

    • NetworkAclId — (String)

      The ID of the network ACL.

    • PortRange — (map)

      TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).

      • From — (Integer)

        The first port in the range.

      • To — (Integer)

        The last port in the range.

    • Protocol — (String)

      The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.

    • RuleAction — (String)

      Indicates whether to allow or deny the traffic that matches the rule.

      Possible values include:
      • "allow"
      • "deny"
    • RuleNumber — (Integer)

      The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.

      Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is reserved for internal use.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNetworkInterface(params = {}, callback) ⇒ AWS.Request

Creates a network interface in the specified subnet.

For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a network interface


/* This example creates a network interface for the specified subnet. */

 var params = {
  Description: "my network interface", 
  Groups: [
     "sg-903004f8"
  ], 
  PrivateIpAddress: "10.0.2.17", 
  SubnetId: "subnet-9d4a7b6c"
 };
 ec2.createNetworkInterface(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NetworkInterface: {
     AvailabilityZone: "us-east-1d", 
     Description: "my network interface", 
     Groups: [
        {
       GroupId: "sg-903004f8", 
       GroupName: "default"
      }
     ], 
     MacAddress: "02:1a:80:41:52:9c", 
     NetworkInterfaceId: "eni-e5aa89a3", 
     OwnerId: "123456789012", 
     PrivateIpAddress: "10.0.2.17", 
     PrivateIpAddresses: [
        {
       Primary: true, 
       PrivateIpAddress: "10.0.2.17"
      }
     ], 
     RequesterManaged: false, 
     SourceDestCheck: true, 
     Status: "pending", 
     SubnetId: "subnet-9d4a7b6c", 
     TagSet: [
     ], 
     VpcId: "vpc-a01106c2"
    }
   }
   */
 });

Calling the createNetworkInterface operation

var params = {
  SubnetId: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE',
  DryRun: true || false,
  Groups: [
    'STRING_VALUE',
    /* more items */
  ],
  Ipv6AddressCount: 0,
  Ipv6Addresses: [
    {
      Ipv6Address: 'STRING_VALUE'
    },
    /* more items */
  ],
  PrivateIpAddress: 'STRING_VALUE',
  PrivateIpAddresses: [
    {
      Primary: true || false,
      PrivateIpAddress: 'STRING_VALUE'
    },
    /* more items */
  ],
  SecondaryPrivateIpAddressCount: 0
};
ec2.createNetworkInterface(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Description — (String)

      A description for the network interface.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Groups — (Array<String>)

      The IDs of one or more security groups.

    • Ipv6AddressCount — (Integer)

      The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.

    • Ipv6Addresses — (Array<map>)

      One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.

      • Ipv6Address — (String)

        The IPv6 address.

    • PrivateIpAddress — (String)

      The primary private IPv4 address of the network interface. If you don't specify an IPv4 address, Amazon EC2 selects one for you from the subnet's IPv4 CIDR range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

    • PrivateIpAddresses — (Array<map>)

      One or more private IPv4 addresses.

      • Primary — (Boolean)

        Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

      • PrivateIpAddress — (String)

        The private IPv4 addresses.

    • SecondaryPrivateIpAddressCount — (Integer)

      The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

      The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide.

    • SubnetId — (String)

      The ID of the subnet to associate with the network interface.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NetworkInterface — (map)

        Information about the network interface.

        • Association — (map)

          The association information for an Elastic IP address (IPv4) associated with the network interface.

          • AllocationId — (String)

            The allocation ID.

          • AssociationId — (String)

            The association ID.

          • IpOwnerId — (String)

            The ID of the Elastic IP address owner.

          • PublicDnsName — (String)

            The public DNS name.

          • PublicIp — (String)

            The address of the Elastic IP address bound to the network interface.

        • Attachment — (map)

          The network interface attachment.

          • AttachTime — (Date)

            The timestamp indicating when the attachment initiated.

          • AttachmentId — (String)

            The ID of the network interface attachment.

          • DeleteOnTermination — (Boolean)

            Indicates whether the network interface is deleted when the instance is terminated.

          • DeviceIndex — (Integer)

            The device index of the network interface attachment on the instance.

          • InstanceId — (String)

            The ID of the instance.

          • InstanceOwnerId — (String)

            The AWS account ID of the owner of the instance.

          • Status — (String)

            The attachment state.

            Possible values include:
            • "attaching"
            • "attached"
            • "detaching"
            • "detached"
        • AvailabilityZone — (String)

          The Availability Zone.

        • Description — (String)

          A description.

        • Groups — (Array<map>)

          Any security groups for the network interface.

          • GroupName — (String)

            The name of the security group.

          • GroupId — (String)

            The ID of the security group.

        • InterfaceType — (String)

          The type of interface.

          Possible values include:
          • "interface"
          • "natGateway"
        • Ipv6Addresses — (Array<map>)

          The IPv6 addresses associated with the network interface.

          • Ipv6Address — (String)

            The IPv6 address.

        • MacAddress — (String)

          The MAC address.

        • NetworkInterfaceId — (String)

          The ID of the network interface.

        • OwnerId — (String)

          The AWS account ID of the owner of the network interface.

        • PrivateDnsName — (String)

          The private DNS name.

        • PrivateIpAddress — (String)

          The IPv4 address of the network interface within the subnet.

        • PrivateIpAddresses — (Array<map>)

          The private IPv4 addresses associated with the network interface.

          • Association — (map)

            The association information for an Elastic IP address (IPv4) associated with the network interface.

            • AllocationId — (String)

              The allocation ID.

            • AssociationId — (String)

              The association ID.

            • IpOwnerId — (String)

              The ID of the Elastic IP address owner.

            • PublicDnsName — (String)

              The public DNS name.

            • PublicIp — (String)

              The address of the Elastic IP address bound to the network interface.

          • Primary — (Boolean)

            Indicates whether this IPv4 address is the primary private IPv4 address of the network interface.

          • PrivateDnsName — (String)

            The private DNS name.

          • PrivateIpAddress — (String)

            The private IPv4 address.

        • RequesterId — (String)

          The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).

        • RequesterManaged — (Boolean)

          Indicates whether the network interface is being managed by AWS.

        • SourceDestCheck — (Boolean)

          Indicates whether traffic to or from the instance is validated.

        • Status — (String)

          The status of the network interface.

          Possible values include:
          • "available"
          • "associated"
          • "attaching"
          • "in-use"
          • "detaching"
        • SubnetId — (String)

          The ID of the subnet.

        • TagSet — (Array<map>)

          Any tags assigned to the network interface.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VpcId — (String)

          The ID of the VPC.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNetworkInterfacePermission(params = {}, callback) ⇒ AWS.Request

Grants an AWS-authorized account permission to attach the specified network interface to an instance in their account.

You can grant permission to a single AWS account only, and only one account at a time.

Examples:

Calling the createNetworkInterfacePermission operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  Permission: INSTANCE-ATTACH | EIP-ASSOCIATE, /* required */
  AwsAccountId: 'STRING_VALUE',
  AwsService: 'STRING_VALUE',
  DryRun: true || false
};
ec2.createNetworkInterfacePermission(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NetworkInterfaceId — (String)

      The ID of the network interface.

    • AwsAccountId — (String)

      The AWS account ID.

    • AwsService — (String)

      The AWS service. Currently not supported.

    • Permission — (String)

      The type of permission to grant.

      Possible values include:
      • "INSTANCE-ATTACH"
      • "EIP-ASSOCIATE"
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • InterfacePermission — (map)

        Information about the permission for the network interface.

        • NetworkInterfacePermissionId — (String)

          The ID of the network interface permission.

        • NetworkInterfaceId — (String)

          The ID of the network interface.

        • AwsAccountId — (String)

          The AWS account ID.

        • AwsService — (String)

          The AWS service.

        • Permission — (String)

          The type of permission.

          Possible values include:
          • "INSTANCE-ATTACH"
          • "EIP-ASSOCIATE"
        • PermissionState — (map)

          Information about the state of the permission.

          • State — (String)

            The state of the permission.

            Possible values include:
            • "pending"
            • "granted"
            • "revoking"
            • "revoked"
          • StatusMessage — (String)

            A status message, if applicable.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPlacementGroup(params = {}, callback) ⇒ AWS.Request

Creates a placement group in which to launch instances. The strategy of the placement group determines how the instances are organized within the group.

A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput. A spread placement group places instances on distinct hardware.

For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To create a placement group


/* This example creates a placement group with the specified name. */

 var params = {
  GroupName: "my-cluster", 
  Strategy: "cluster"
 };
 ec2.createPlacementGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createPlacementGroup operation

var params = {
  GroupName: 'STRING_VALUE', /* required */
  Strategy: cluster | spread, /* required */
  DryRun: true || false
};
ec2.createPlacementGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • GroupName — (String)

      A name for the placement group. Must be unique within the scope of your account for the region.

      Constraints: Up to 255 ASCII characters

    • Strategy — (String)

      The placement strategy.

      Possible values include:
      • "cluster"
      • "spread"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createReservedInstancesListing(params = {}, callback) ⇒ AWS.Request

Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Standard Reserved Instance listing at a time. To get a list of your Standard Reserved Instances, you can use the DescribeReservedInstances operation.

Note: Only Standard Reserved Instances with a capacity reservation can be sold in the Reserved Instance Marketplace. Convertible Reserved Instances and Standard Reserved Instances with a regional benefit cannot be sold.

The Reserved Instance Marketplace matches sellers who want to resell Standard Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.

To sell your Standard Reserved Instances, you must first register as a seller in the Reserved Instance Marketplace. After completing the registration process, you can create a Reserved Instance Marketplace listing of some or all of your Standard Reserved Instances, and specify the upfront price to receive for them. Your Standard Reserved Instance listings then become available for purchase. To view the details of your Standard Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the createReservedInstancesListing operation

var params = {
  ClientToken: 'STRING_VALUE', /* required */
  InstanceCount: 0, /* required */
  PriceSchedules: [ /* required */
    {
      CurrencyCode: USD,
      Price: 0.0,
      Term: 0
    },
    /* more items */
  ],
  ReservedInstancesId: 'STRING_VALUE' /* required */
};
ec2.createReservedInstancesListing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

    • InstanceCount — (Integer)

      The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.

    • PriceSchedules — (Array<map>)

      A list specifying the price of the Standard Reserved Instance for each month remaining in the Reserved Instance term.

      • CurrencyCode — (String)

        The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

        Possible values include:
        • "USD"
      • Price — (Float)

        The fixed price for the term.

      • Term — (Integer)

        The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.

    • ReservedInstancesId — (String)

      The ID of the active Standard Reserved Instance.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ReservedInstancesListings — (Array<map>)

        Information about the Standard Reserved Instance listing.

        • ClientToken — (String)

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

        • CreateDate — (Date)

          The time the listing was created.

        • InstanceCounts — (Array<map>)

          The number of instances in this state.

          • InstanceCount — (Integer)

            The number of listed Reserved Instances in the state specified by the state.

          • State — (String)

            The states of the listed Reserved Instances.

            Possible values include:
            • "available"
            • "sold"
            • "cancelled"
            • "pending"
        • PriceSchedules — (Array<map>)

          The price of the Reserved Instance listing.

          • Active — (Boolean)

            The current price schedule, as determined by the term remaining for the Reserved Instance in the listing.

            A specific price schedule is always in effect, but only one price schedule can be active at any time. Take, for example, a Reserved Instance listing that has five months remaining in its term. When you specify price schedules for five months and two months, this means that schedule 1, covering the first three months of the remaining term, will be active during months 5, 4, and 3. Then schedule 2, covering the last two months of the term, will be active for months 2 and 1.

          • CurrencyCode — (String)

            The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

            Possible values include:
            • "USD"
          • Price — (Float)

            The fixed price for the term.

          • Term — (Integer)

            The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.

        • ReservedInstancesId — (String)

          The ID of the Reserved Instance.

        • ReservedInstancesListingId — (String)

          The ID of the Reserved Instance listing.

        • Status — (String)

          The status of the Reserved Instance listing.

          Possible values include:
          • "active"
          • "pending"
          • "cancelled"
          • "closed"
        • StatusMessage — (String)

          The reason for the current status of the Reserved Instance listing. The response can be blank.

        • Tags — (Array<map>)

          Any tags assigned to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • UpdateDate — (Date)

          The last modified timestamp of the listing.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRoute(params = {}, callback) ⇒ AWS.Request

Creates a route in a route table within a VPC.

You must specify one of the following targets: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.

When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3, and the route table includes the following two IPv4 routes:

  • 192.0.2.0/24 (goes to some target A)

  • 192.0.2.0/28 (goes to some target B)

Both routes apply to the traffic destined for 192.0.2.3. However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a route


/* This example creates a route for the specified route table. The route matches all traffic (0.0.0.0/0) and routes it to the specified Internet gateway. */

 var params = {
  DestinationCidrBlock: "0.0.0.0/0", 
  GatewayId: "igw-c0a643a9", 
  RouteTableId: "rtb-22574640"
 };
 ec2.createRoute(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the createRoute operation

var params = {
  RouteTableId: 'STRING_VALUE', /* required */
  DestinationCidrBlock: 'STRING_VALUE',
  DestinationIpv6CidrBlock: 'STRING_VALUE',
  DryRun: true || false,
  EgressOnlyInternetGatewayId: 'STRING_VALUE',
  GatewayId: 'STRING_VALUE',
  InstanceId: 'STRING_VALUE',
  NatGatewayId: 'STRING_VALUE',
  NetworkInterfaceId: 'STRING_VALUE',
  VpcPeeringConnectionId: 'STRING_VALUE'
};
ec2.createRoute(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DestinationCidrBlock — (String)

      The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match.

    • DestinationIpv6CidrBlock — (String)

      The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • EgressOnlyInternetGatewayId — (String)

      [IPv6 traffic only] The ID of an egress-only internet gateway.

    • GatewayId — (String)

      The ID of an internet gateway or virtual private gateway attached to your VPC.

    • InstanceId — (String)

      The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

    • NatGatewayId — (String)

      [IPv4 traffic only] The ID of a NAT gateway.

    • NetworkInterfaceId — (String)

      The ID of a network interface.

    • RouteTableId — (String)

      The ID of the route table for the route.

    • VpcPeeringConnectionId — (String)

      The ID of a VPC peering connection.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Returns true if the request succeeds; otherwise, it returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRouteTable(params = {}, callback) ⇒ AWS.Request

Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a route table


/* This example creates a route table for the specified VPC. */

 var params = {
  VpcId: "vpc-a01106c2"
 };
 ec2.createRouteTable(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    RouteTable: {
     Associations: [
     ], 
     PropagatingVgws: [
     ], 
     RouteTableId: "rtb-22574640", 
     Routes: [
        {
       DestinationCidrBlock: "10.0.0.0/16", 
       GatewayId: "local", 
       State: "active"
      }
     ], 
     Tags: [
     ], 
     VpcId: "vpc-a01106c2"
    }
   }
   */
 });

Calling the createRouteTable operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.createRouteTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcId — (String)

      The ID of the VPC.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • RouteTable — (map)

        Information about the route table.

        • Associations — (Array<map>)

          The associations between the route table and one or more subnets.

          • Main — (Boolean)

            Indicates whether this is the main route table.

          • RouteTableAssociationId — (String)

            The ID of the association between a route table and a subnet.

          • RouteTableId — (String)

            The ID of the route table.

          • SubnetId — (String)

            The ID of the subnet. A subnet ID is not returned for an implicit association.

        • PropagatingVgws — (Array<map>)

          Any virtual private gateway (VGW) propagating routes.

          • GatewayId — (String)

            The ID of the virtual private gateway.

        • RouteTableId — (String)

          The ID of the route table.

        • Routes — (Array<map>)

          The routes in the route table.

          • DestinationCidrBlock — (String)

            The IPv4 CIDR block used for the destination match.

          • DestinationIpv6CidrBlock — (String)

            The IPv6 CIDR block used for the destination match.

          • DestinationPrefixListId — (String)

            The prefix of the AWS service.

          • EgressOnlyInternetGatewayId — (String)

            The ID of the egress-only internet gateway.

          • GatewayId — (String)

            The ID of a gateway attached to your VPC.

          • InstanceId — (String)

            The ID of a NAT instance in your VPC.

          • InstanceOwnerId — (String)

            The AWS account ID of the owner of the instance.

          • NatGatewayId — (String)

            The ID of a NAT gateway.

          • NetworkInterfaceId — (String)

            The ID of the network interface.

          • Origin — (String)

            Describes how the route was created.

            • CreateRouteTable - The route was automatically created when the route table was created.

            • CreateRoute - The route was manually added to the route table.

            • EnableVgwRoutePropagation - The route was propagated by route propagation.

            Possible values include:
            • "CreateRouteTable"
            • "CreateRoute"
            • "EnableVgwRoutePropagation"
          • State — (String)

            The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

            Possible values include:
            • "active"
            • "blackhole"
          • VpcPeeringConnectionId — (String)

            The ID of the VPC peering connection.

        • Tags — (Array<map>)

          Any tags assigned to the route table.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VpcId — (String)

          The ID of the VPC.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createSecurityGroup(params = {}, callback) ⇒ AWS.Request

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 and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

EC2-Classic: You can have up to 500 security groups.

EC2-VPC: You can create up to 500 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.

Service Reference:

Examples:

To create a security group for a VPC


/* This example creates a security group for the specified VPC. */

 var params = {
  Description: "My security group", 
  GroupName: "my-security-group", 
  VpcId: "vpc-1a2b3c4d"
 };
 ec2.createSecurityGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    GroupId: "sg-903004f8"
   }
   */
 });

Calling the createSecurityGroup operation

var params = {
  Description: 'STRING_VALUE', /* required */
  GroupName: 'STRING_VALUE', /* required */
  DryRun: true || false,
  VpcId: 'STRING_VALUE'
};
ec2.createSecurityGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Description — (String)

      A description for the security group. This is informational only.

      Constraints: Up to 255 characters in length

      Constraints for EC2-Classic: ASCII characters

      Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

    • GroupName — (String)

      The name of the security group.

      Constraints: Up to 255 characters in length. Cannot start with sg-.

      Constraints for EC2-Classic: ASCII characters

      Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

    • VpcId — (String)

      [EC2-VPC] The ID of the VPC. Required for EC2-VPC.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • GroupId — (String)

        The ID of the security group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createSnapshot(params = {}, callback) ⇒ AWS.Request

Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.

When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending.

To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.

You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide.

For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To create a snapshot


/* This example creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot. */

 var params = {
  Description: "This is my root volume snapshot.", 
  VolumeId: "vol-1234567890abcdef0"
 };
 ec2.createSnapshot(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Description: "This is my root volume snapshot.", 
    OwnerId: "012345678910", 
    SnapshotId: "snap-066877671789bd71b", 
    StartTime: <Date Representation>, 
    State: "pending", 
    Tags: [
    ], 
    VolumeId: "vol-1234567890abcdef0", 
    VolumeSize: 8
   }
   */
 });

Calling the createSnapshot operation

var params = {
  VolumeId: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE',
  DryRun: true || false,
  TagSpecifications: [
    {
      ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
ec2.createSnapshot(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Description — (String)

      A description for the snapshot.

    • VolumeId — (String)

      The ID of the EBS volume.

    • TagSpecifications — (Array<map>)

      The tags to apply to the snapshot during creation.

      • ResourceType — (String)

        The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

        Possible values include:
        • "customer-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "image"
        • "instance"
        • "internet-gateway"
        • "network-acl"
        • "network-interface"
        • "reserved-instances"
        • "route-table"
        • "snapshot"
        • "spot-instances-request"
        • "subnet"
        • "security-group"
        • "volume"
        • "vpc"
        • "vpn-connection"
        • "vpn-gateway"
      • Tags — (Array<map>)

        The tags to apply to the resource.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DataEncryptionKeyId — (String)

        The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by the DescribeSnapshots API operation.

      • Description — (String)

        The description for the snapshot.

      • Encrypted — (Boolean)

        Indicates whether the snapshot is encrypted.

      • KmsKeyId — (String)

        The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.

      • OwnerId — (String)

        The AWS account ID of the EBS snapshot owner.

      • Progress — (String)

        The progress of the snapshot, as a percentage.

      • SnapshotId — (String)

        The ID of the snapshot. Each snapshot receives a unique identifier when it is created.

      • StartTime — (Date)

        The time stamp when the snapshot was initiated.

      • State — (String)

        The snapshot state.

        Possible values include:
        • "pending"
        • "completed"
        • "error"
      • StateMessage — (String)

        Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by the DescribeSnapshots API operation.

      • VolumeId — (String)

        The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.

      • VolumeSize — (Integer)

        The size of the volume, in GiB.

      • OwnerAlias — (String)

        Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.

      • Tags — (Array<map>)

        Any tags assigned to the snapshot.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createSpotDatafeedSubscription(params = {}, callback) ⇒ AWS.Request

Creates a data feed for Spot Instances, enabling you to view Spot Instance usage logs. You can create one data feed per AWS account. For more information, see Spot Instance Data Feed in the Amazon EC2 User Guide for Linux Instances.

Service Reference:

Examples:

To create a Spot Instance datafeed


/* This example creates a Spot Instance data feed for your AWS account. */

 var params = {
  Bucket: "my-s3-bucket", 
  Prefix: "spotdata"
 };
 ec2.createSpotDatafeedSubscription(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SpotDatafeedSubscription: {
     Bucket: "my-s3-bucket", 
     OwnerId: "123456789012", 
     Prefix: "spotdata", 
     State: "Active"
    }
   }
   */
 });

Calling the createSpotDatafeedSubscription operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  DryRun: true || false,
  Prefix: 'STRING_VALUE'
};
ec2.createSpotDatafeedSubscription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

      The Amazon S3 bucket in which to store the Spot Instance data feed.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Prefix — (String)

      A prefix for the data feed file names.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SpotDatafeedSubscription — (map)

        The Spot Instance data feed subscription.

        • Bucket — (String)

          The Amazon S3 bucket where the Spot Instance data feed is located.

        • Fault — (map)

          The fault codes for the Spot Instance request, if any.

          • Code — (String)

            The reason code for the Spot Instance state change.

          • Message — (String)

            The message for the Spot Instance state change.

        • OwnerId — (String)

          The AWS account ID of the account.

        • Prefix — (String)

          The prefix that is prepended to data feed files.

        • State — (String)

          The state of the Spot Instance data feed subscription.

          Possible values include:
          • "Active"
          • "Inactive"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createSubnet(params = {}, callback) ⇒ AWS.Request

Creates a subnet in an existing VPC.

When you create each subnet, you provide the VPC ID and IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).

If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.

AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.

If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.

If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.

For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

To create a subnet


/* This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you. */

 var params = {
  CidrBlock: "10.0.1.0/24", 
  VpcId: "vpc-a01106c2"
 };
 ec2.createSubnet(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Subnet: {
     AvailabilityZone: "us-west-2c", 
     AvailableIpAddressCount: 251, 
     CidrBlock: "10.0.1.0/24", 
     State: "pending", 
     SubnetId: "subnet-9d4a7b6c", 
     VpcId: "vpc-a01106c2"
    }
   }
   */
 });

Calling the createSubnet operation

var params = {
  CidrBlock: 'STRING_VALUE', /* required */
  VpcId: 'STRING_VALUE', /* required */
  AvailabilityZone: 'STRING_VALUE',
  DryRun: true || false,
  Ipv6CidrBlock: 'STRING_VALUE'
};
ec2.createSubnet(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AvailabilityZone — (String)

      The Availability Zone for the subnet.

      Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.

    • CidrBlock — (String)

      The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24.

    • Ipv6CidrBlock — (String)

      The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.

    • VpcId — (String)

      The ID of the VPC.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Subnet — (map)

        Information about the subnet.

        • AvailabilityZone — (String)

          The Availability Zone of the subnet.

        • AvailableIpAddressCount — (Integer)

          The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.

        • CidrBlock — (String)

          The IPv4 CIDR block assigned to the subnet.

        • DefaultForAz — (Boolean)

          Indicates whether this is the default subnet for the Availability Zone.

        • MapPublicIpOnLaunch — (Boolean)

          Indicates whether instances launched in this subnet receive a public IPv4 address.

        • State — (String)

          The current state of the subnet.

          Possible values include:
          • "pending"
          • "available"
        • SubnetId — (String)

          The ID of the subnet.

        • VpcId — (String)

          The ID of the VPC the subnet is in.

        • AssignIpv6AddressOnCreation — (Boolean)

          Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives an IPv6 address.

        • Ipv6CidrBlockAssociationSet — (Array<map>)

          Information about the IPv6 CIDR blocks associated with the subnet.

          • AssociationId — (String)

            The association ID for the CIDR block.

          • Ipv6CidrBlock — (String)

            The IPv6 CIDR block.

          • Ipv6CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of a CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • Tags — (Array<map>)

          Any tags assigned to the subnet.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTags(params = {}, callback) ⇒ AWS.Request

Adds or overwrites one or more tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To add a tag to a resource


/* This example adds the tag Stack=production to the specified image, or overwrites an existing tag for the AMI where the tag key is Stack. */

 var params = {
  Resources: [
     "ami-78a54011"
  ], 
  Tags: [
     {
    Key: "Stack", 
    Value: "production"
   }
  ]
 };
 ec2.createTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the createTags operation

var params = {
  Resources: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  DryRun: true || false
};
ec2.createTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Resources — (Array<String>)

      The IDs of one or more resources, separated by spaces.

    • Tags — (Array<map>)

      One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

      • Key — (String)

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

      • Value — (String)

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVolume(params = {}, callback) ⇒ AWS.Request

Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints.

You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes with the Encrypted parameter. Encrypted volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

You can tag your volumes during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide.

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

Service Reference:

Examples:

To create a new volume


/* This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``. */

 var params = {
  AvailabilityZone: "us-east-1a", 
  Size: 80, 
  VolumeType: "gp2"
 };
 ec2.createVolume(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AvailabilityZone: "us-east-1a", 
    CreateTime: <Date Representation>, 
    Encrypted: false, 
    Iops: 240, 
    Size: 80, 
    SnapshotId: "", 
    State: "creating", 
    VolumeId: "vol-6b60b7c7", 
    VolumeType: "gp2"
   }
   */
 });

To create a new Provisioned IOPS (SSD) volume from a snapshot


/* This example creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone ``us-east-1a``. */

 var params = {
  AvailabilityZone: "us-east-1a", 
  Iops: 1000, 
  SnapshotId: "snap-066877671789bd71b", 
  VolumeType: "io1"
 };
 ec2.createVolume(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attachments: [
    ], 
    AvailabilityZone: "us-east-1a", 
    CreateTime: <Date Representation>, 
    Iops: 1000, 
    Size: 500, 
    SnapshotId: "snap-066877671789bd71b", 
    State: "creating", 
    Tags: [
    ], 
    VolumeId: "vol-1234567890abcdef0", 
    VolumeType: "io1"
   }
   */
 });

Calling the createVolume operation

var params = {
  AvailabilityZone: 'STRING_VALUE', /* required */
  DryRun: true || false,
  Encrypted: true || false,
  Iops: 0,
  KmsKeyId: 'STRING_VALUE',
  Size: 0,
  SnapshotId: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: customer-gateway | dedicated-host | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | snapshot | spot-instances-request | subnet | security-group | volume | vpc | vpn-connection | vpn-gateway,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  VolumeType: standard | io1 | gp2 | sc1 | st1
};
ec2.createVolume(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AvailabilityZone — (String)

      The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

    • Encrypted — (Boolean)

      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

    • Iops — (Integer)

      The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB. Range is 100 to 32000 IOPS for volumes in most regions. For exceptions, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

      This parameter is valid only for Provisioned IOPS SSD (io1) volumes.

    • KmsKeyId — (String)

      An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.

      The CMK identifier may be provided in any of the following formats:

      • Key ID

      • Key alias

      • ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

      • ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

      AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. The action will eventually fail.

    • Size — (Integer)

      The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

    • SnapshotId — (String)

      The snapshot from which to create the volume.

    • VolumeType — (String)

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Defaults: If no volume type is specified, the default is standard in us-east-1, eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1, and cn-north-1. In all other regions, EBS defaults to gp2.

      Possible values include:
      • "standard"
      • "io1"
      • "gp2"
      • "sc1"
      • "st1"
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • TagSpecifications — (Array<map>)

      The tags to apply to the volume during creation.

      • ResourceType — (String)

        The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

        Possible values include:
        • "customer-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "image"
        • "instance"
        • "internet-gateway"
        • "network-acl"
        • "network-interface"
        • "reserved-instances"
        • "route-table"
        • "snapshot"
        • "spot-instances-request"
        • "subnet"
        • "security-group"
        • "volume"
        • "vpc"
        • "vpn-connection"
        • "vpn-gateway"
      • Tags — (Array<map>)

        The tags to apply to the resource.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attachments — (Array<map>)

        Information about the volume attachments.

        • AttachTime — (Date)

          The time stamp when the attachment initiated.

        • Device — (String)

          The device name.

        • InstanceId — (String)

          The ID of the instance.

        • State — (String)

          The attachment state of the volume.

          Possible values include:
          • "attaching"
          • "attached"
          • "detaching"
          • "detached"
          • "busy"
        • VolumeId — (String)

          The ID of the volume.

        • DeleteOnTermination — (Boolean)

          Indicates whether the EBS volume is deleted on instance termination.

      • AvailabilityZone — (String)

        The Availability Zone for the volume.

      • CreateTime — (Date)

        The time stamp when volume creation was initiated.

      • Encrypted — (Boolean)

        Indicates whether the volume will be encrypted.

      • KmsKeyId — (String)

        The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the volume.

      • Size — (Integer)

        The size of the volume, in GiBs.

      • SnapshotId — (String)

        The snapshot from which the volume was created, if applicable.

      • State — (String)

        The volume state.

        Possible values include:
        • "creating"
        • "available"
        • "in-use"
        • "deleting"
        • "deleted"
        • "error"
      • VolumeId — (String)

        The ID of the volume.

      • Iops — (Integer)

        The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide.

        Constraint: Range is 100-32000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.

      • Tags — (Array<map>)

        Any tags assigned to the volume.

        • Key — (String)

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value — (String)

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      • VolumeType — (String)

        The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

        Possible values include:
        • "standard"
        • "io1"
        • "gp2"
        • "sc1"
        • "st1"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpc(params = {}, callback) ⇒ AWS.Request

Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.

By default, each instance you launch in the VPC has the default DHCP options, which include only a default DNS server that we provide (AmazonProvidedDNS). For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see Dedicated Instances in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To create a VPC


/* This example creates a VPC with the specified CIDR block. */

 var params = {
  CidrBlock: "10.0.0.0/16"
 };
 ec2.createVpc(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Vpc: {
     CidrBlock: "10.0.0.0/16", 
     DhcpOptionsId: "dopt-7a8b9c2d", 
     InstanceTenancy: "default", 
     State: "pending", 
     VpcId: "vpc-a01106c2"
    }
   }
   */
 });

Calling the createVpc operation

var params = {
  CidrBlock: 'STRING_VALUE', /* required */
  AmazonProvidedIpv6CidrBlock: true || false,
  DryRun: true || false,
  InstanceTenancy: default | dedicated | host
};
ec2.createVpc(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CidrBlock — (String)

      The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16.

    • AmazonProvidedIpv6CidrBlock — (Boolean)

      Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InstanceTenancy — (String)

      The tenancy options for instances launched into the VPC. For default, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For dedicated, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC.

      Important: The host value cannot be used with this parameter. Use the default or dedicated values only.

      Default: default

      Possible values include:
      • "default"
      • "dedicated"
      • "host"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Vpc — (map)

        Information about the VPC.

        • CidrBlock — (String)

          The primary IPv4 CIDR block for the VPC.

        • DhcpOptionsId — (String)

          The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).

        • State — (String)

          The current state of the VPC.

          Possible values include:
          • "pending"
          • "available"
        • VpcId — (String)

          The ID of the VPC.

        • InstanceTenancy — (String)

          The allowed tenancy of instances launched into the VPC.

          Possible values include:
          • "default"
          • "dedicated"
          • "host"
        • Ipv6CidrBlockAssociationSet — (Array<map>)

          Information about the IPv6 CIDR blocks associated with the VPC.

          • AssociationId — (String)

            The association ID for the IPv6 CIDR block.

          • Ipv6CidrBlock — (String)

            The IPv6 CIDR block.

          • Ipv6CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of the CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • CidrBlockAssociationSet — (Array<map>)

          Information about the IPv4 CIDR blocks associated with the VPC.

          • AssociationId — (String)

            The association ID for the IPv4 CIDR block.

          • CidrBlock — (String)

            The IPv4 CIDR block.

          • CidrBlockState — (map)

            Information about the state of the CIDR block.

            • State — (String)

              The state of the CIDR block.

              Possible values include:
              • "associating"
              • "associated"
              • "disassociating"
              • "disassociated"
              • "failing"
              • "failed"
            • StatusMessage — (String)

              A message about the status of the CIDR block, if applicable.

        • IsDefault — (Boolean)

          Indicates whether the VPC is the default VPC.

        • Tags — (Array<map>)

          Any tags assigned to the VPC.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpcEndpoint(params = {}, callback) ⇒ AWS.Request

Creates a VPC endpoint for a specified service. An endpoint enables you to create a private connection between your VPC and the service. The service may be provided by AWS, an AWS Marketplace partner, or another AWS account. For more information, see VPC Endpoints in the Amazon Virtual Private Cloud User Guide.

A gateway endpoint serves as a target for a route in your route table for traffic destined for the AWS service. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.

An interface endpoint is a network interface in your subnet that serves as an endpoint for communicating with the specified service. You can specify the subnets in which to create an endpoint, and the security groups to associate with the endpoint network interface.

Use DescribeVpcEndpointServices to get a list of supported services.

Service Reference:

Examples:

Calling the createVpcEndpoint operation

var params = {
  ServiceName: 'STRING_VALUE', /* required */
  VpcId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  PolicyDocument: 'STRING_VALUE',
  PrivateDnsEnabled: true || false,
  RouteTableIds: [
    'STRING_VALUE',
    /* more items */
  ],
  SecurityGroupIds: [
    'STRING_VALUE',
    /* more items */
  ],
  SubnetIds: [
    'STRING_VALUE',
    /* more items */
  ],
  VpcEndpointType: Interface | Gateway
};
ec2.createVpcEndpoint(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcEndpointType — (String)

      The type of endpoint.

      Default: Gateway

      Possible values include:
      • "Interface"
      • "Gateway"
    • VpcId — (String)

      The ID of the VPC in which the endpoint will be used.

    • ServiceName — (String)

      The service name. To get a list of available services, use the DescribeVpcEndpointServices request, or get the name from the service provider.

    • PolicyDocument — (String)

      (Gateway endpoint) A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

    • RouteTableIds — (Array<String>)

      (Gateway endpoint) One or more route table IDs.

    • SubnetIds — (Array<String>)

      (Interface endpoint) The ID of one or more subnets in which to create an endpoint network interface.

    • SecurityGroupIds — (Array<String>)

      (Interface endpoint) The ID of one or more security groups to associate with the endpoint network interface.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

    • PrivateDnsEnabled — (Boolean)

      (Interface endpoint) Indicate whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the region (for example, kinesis.us-east-1.amazonaws.com) which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.

      To use a private hosted zone, you must set the following VPC attributes to true: enableDnsHostnames and enableDnsSupport. Use ModifyVpcAttribute to set the VPC attributes.

      Default: false

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpcEndpoint — (map)

        Information about the endpoint.

        • VpcEndpointId — (String)

          The ID of the VPC endpoint.

        • VpcEndpointType — (String)

          The type of endpoint.

          Possible values include:
          • "Interface"
          • "Gateway"
        • VpcId — (String)

          The ID of the VPC to which the endpoint is associated.

        • ServiceName — (String)

          The name of the service to which the endpoint is associated.

        • State — (String)

          The state of the VPC endpoint.

          Possible values include:
          • "PendingAcceptance"
          • "Pending"
          • "Available"
          • "Deleting"
          • "Deleted"
          • "Rejected"
          • "Failed"
          • "Expired"
        • PolicyDocument — (String)

          The policy document associated with the endpoint, if applicable.

        • RouteTableIds — (Array<String>)

          (Gateway endpoint) One or more route tables associated with the endpoint.

        • SubnetIds — (Array<String>)

          (Interface endpoint) One or more subnets in which the endpoint is located.

        • Groups — (Array<map>)

          (Interface endpoint) Information about the security groups associated with the network interface.

          • GroupId — (String)

            The ID of the security group.

          • GroupName — (String)

            The name of the security group.

        • PrivateDnsEnabled — (Boolean)

          (Interface endpoint) Indicates whether the VPC is associated with a private hosted zone.

        • NetworkInterfaceIds — (Array<String>)

          (Interface endpoint) One or more network interfaces for the endpoint.

        • DnsEntries — (Array<map>)

          (Interface endpoint) The DNS entries for the endpoint.

          • DnsName — (String)

            The DNS name.

          • HostedZoneId — (String)

            The ID of the private hosted zone.

        • CreationTimestamp — (Date)

          The date and time the VPC endpoint was created.

      • ClientToken — (String)

        Unique, case-sensitive identifier you provide to ensure the idempotency of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpcEndpointConnectionNotification(params = {}, callback) ⇒ AWS.Request

Creates a connection notification for a specified VPC endpoint or VPC endpoint service. A connection notification notifies you of specific endpoint events. You must create an SNS topic to receive notifications. For more information, see Create a Topic in the Amazon Simple Notification Service Developer Guide.

You can create a connection notification for interface endpoints only.

Examples:

Calling the createVpcEndpointConnectionNotification operation

var params = {
  ConnectionEvents: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  ConnectionNotificationArn: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  ServiceId: 'STRING_VALUE',
  VpcEndpointId: 'STRING_VALUE'
};
ec2.createVpcEndpointConnectionNotification(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ServiceId — (String)

      The ID of the endpoint service.

    • VpcEndpointId — (String)

      The ID of the endpoint.

    • ConnectionNotificationArn — (String)

      The ARN of the SNS topic for the notifications.

    • ConnectionEvents — (Array<String>)

      One or more endpoint events for which to receive notifications. Valid values are Accept, Connect, Delete, and Reject.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ConnectionNotification — (map)

        Information about the notification.

        • ConnectionNotificationId — (String)

          The ID of the notification.

        • ServiceId — (String)

          The ID of the endpoint service.

        • VpcEndpointId — (String)

          The ID of the VPC endpoint.

        • ConnectionNotificationType — (String)

          The type of notification.

          Possible values include:
          • "Topic"
        • ConnectionNotificationArn — (String)

          The ARN of the SNS topic for the notification.

        • ConnectionEvents — (Array<String>)

          The events for the notification. Valid values are Accept, Connect, Delete, and Reject.

        • ConnectionNotificationState — (String)

          The state of the notification.

          Possible values include:
          • "Enabled"
          • "Disabled"
      • ClientToken — (String)

        Unique, case-sensitive identifier you provide to ensure the idempotency of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpcEndpointServiceConfiguration(params = {}, callback) ⇒ AWS.Request

Creates a VPC endpoint service configuration to which service consumers (AWS accounts, IAM users, and IAM roles) can connect. Service consumers can create an interface VPC endpoint to connect to your service.

To create an endpoint service configuration, you must first create a Network Load Balancer for your service. For more information, see VPC Endpoint Services in the Amazon Virtual Private Cloud User Guide.

Examples:

Calling the createVpcEndpointServiceConfiguration operation

var params = {
  NetworkLoadBalancerArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  AcceptanceRequired: true || false,
  ClientToken: 'STRING_VALUE',
  DryRun: true || false
};
ec2.createVpcEndpointServiceConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • AcceptanceRequired — (Boolean)

      Indicate whether requests from service consumers to create an endpoint to your service must be accepted. To accept a request, use AcceptVpcEndpointConnections.

    • NetworkLoadBalancerArns — (Array<String>)

      The Amazon Resource Names (ARNs) of one or more Network Load Balancers for your service.

    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ServiceConfiguration — (map)

        Information about the service configuration.

        • ServiceType — (Array<map>)

          The type of service.

          • ServiceType — (String)

            The type of service.

            Possible values include:
            • "Interface"
            • "Gateway"
        • ServiceId — (String)

          The ID of the service.

        • ServiceName — (String)

          The name of the service.

        • ServiceState — (String)

          The service state.

          Possible values include:
          • "Pending"
          • "Available"
          • "Deleting"
          • "Deleted"
          • "Failed"
        • AvailabilityZones — (Array<String>)

          In the Availability Zones in which the service is available.

        • AcceptanceRequired — (Boolean)

          Indicates whether requests from other AWS accounts to create an endpoint to the service must first be accepted.

        • NetworkLoadBalancerArns — (Array<String>)

          The Amazon Resource Names (ARNs) of the Network Load Balancers for the service.

        • BaseEndpointDnsNames — (Array<String>)

          The DNS names for the service.

        • PrivateDnsName — (String)

          The private DNS name for the service.

      • ClientToken — (String)

        Unique, case-sensitive identifier you provide to ensure the idempotency of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpcPeeringConnection(params = {}, callback) ⇒ AWS.Request

Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.

Note: Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide.

The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.

If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.

Service Reference:

Examples:

Calling the createVpcPeeringConnection operation

var params = {
  DryRun: true || false,
  PeerOwnerId: 'STRING_VALUE',
  PeerRegion: 'STRING_VALUE',
  PeerVpcId: 'STRING_VALUE',
  VpcId: 'STRING_VALUE'
};
ec2.createVpcPeeringConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • PeerOwnerId — (String)

      The AWS account ID of the owner of the accepter VPC.

      Default: Your AWS account ID

    • PeerVpcId — (String)

      The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.

    • VpcId — (String)

      The ID of the requester VPC. You must specify this parameter in the request.

    • PeerRegion — (String)

      The region code for the accepter VPC, if the accepter VPC is located in a region other than the region in which you make the request.

      Default: The region in which you make the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpcPeeringConnection — (map)

        Information about the VPC peering connection.

        • AccepterVpcInfo — (map)

          Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.

          • CidrBlock — (String)

            The IPv4 CIDR block for the VPC.

          • Ipv6CidrBlockSet — (Array<map>)

            The IPv6 CIDR block for the VPC.

            • Ipv6CidrBlock — (String)

              The IPv6 CIDR block.

          • CidrBlockSet — (Array<map>)

            Information about the IPv4 CIDR blocks for the VPC.

            • CidrBlock — (String)

              The IPv4 CIDR block.

          • OwnerId — (String)

            The AWS account ID of the VPC owner.

          • PeeringOptions — (map)

            Information about the VPC peering connection options for the accepter or requester VPC.

            • AllowDnsResolutionFromRemoteVpc — (Boolean)

              Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.

            • AllowEgressFromLocalClassicLinkToRemoteVpc — (Boolean)

              Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.

            • AllowEgressFromLocalVpcToRemoteClassicLink — (Boolean)

              Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.

          • VpcId — (String)

            The ID of the VPC.

          • Region — (String)

            The region in which the VPC is located.

        • ExpirationTime — (Date)

          The time that an unaccepted VPC peering connection will expire.

        • RequesterVpcInfo — (map)

          Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.

          • CidrBlock — (String)

            The IPv4 CIDR block for the VPC.

          • Ipv6CidrBlockSet — (Array<map>)

            The IPv6 CIDR block for the VPC.

            • Ipv6CidrBlock — (String)

              The IPv6 CIDR block.

          • CidrBlockSet — (Array<map>)

            Information about the IPv4 CIDR blocks for the VPC.

            • CidrBlock — (String)

              The IPv4 CIDR block.

          • OwnerId — (String)

            The AWS account ID of the VPC owner.

          • PeeringOptions — (map)

            Information about the VPC peering connection options for the accepter or requester VPC.

            • AllowDnsResolutionFromRemoteVpc — (Boolean)

              Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.

            • AllowEgressFromLocalClassicLinkToRemoteVpc — (Boolean)

              Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.

            • AllowEgressFromLocalVpcToRemoteClassicLink — (Boolean)

              Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.

          • VpcId — (String)

            The ID of the VPC.

          • Region — (String)

            The region in which the VPC is located.

        • Status — (map)

          The status of the VPC peering connection.

          • Code — (String)

            The status of the VPC peering connection.

            Possible values include:
            • "initiating-request"
            • "pending-acceptance"
            • "active"
            • "deleted"
            • "rejected"
            • "failed"
            • "expired"
            • "provisioning"
            • "deleting"
          • Message — (String)

            A message that provides more information about the status, if applicable.

        • Tags — (Array<map>)

          Any tags assigned to the resource.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VpcPeeringConnectionId — (String)

          The ID of the VPC peering connection.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpnConnection(params = {}, callback) ⇒ AWS.Request

Creates a VPN connection between an existing virtual private gateway and a VPN customer gateway. The only supported connection type is ipsec.1.

The response includes information that you need to give to your network administrator to configure your customer gateway.

We strongly recommend that you use HTTPS when calling this operation because the response contains sensitive cryptographic information for configuring your customer gateway.

If you decide to shut down your VPN connection for any reason and later create a new VPN connection, you must reconfigure your customer gateway with the new information returned from this call.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

For more information, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the createVpnConnection operation

var params = {
  CustomerGatewayId: 'STRING_VALUE', /* required */
  Type: 'STRING_VALUE', /* required */
  VpnGatewayId: 'STRING_VALUE', /* required */
  DryRun: true || false,
  Options: {
    StaticRoutesOnly: true || false,
    TunnelOptions: [
      {
        PreSharedKey: 'STRING_VALUE',
        TunnelInsideCidr: 'STRING_VALUE'
      },
      /* more items */
    ]
  }
};
ec2.createVpnConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CustomerGatewayId — (String)

      The ID of the customer gateway.

    • Type — (String)

      The type of VPN connection (ipsec.1).

    • VpnGatewayId — (String)

      The ID of the virtual private gateway.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Options — (map)

      The options for the VPN connection.

      • StaticRoutesOnly — (Boolean)

        Indicate whether the VPN connection uses static routes only. If you are creating a VPN connection for a device that does not support BGP, you must specify true. Use CreateVpnConnectionRoute to create a static route.

        Default: false

      • TunnelOptions — (Array<map>)

        The tunnel options for the VPN connection.

        • TunnelInsideCidr — (String)

          The range of inside IP addresses for the tunnel. Any specified CIDR blocks must be unique across all VPN connections that use the same virtual private gateway.

          Constraints: A size /30 CIDR block from the 169.254.0.0/16 range. The following CIDR blocks are reserved and cannot be used:

          • 169.254.0.0/30

          • 169.254.1.0/30

          • 169.254.2.0/30

          • 169.254.3.0/30

          • 169.254.4.0/30

          • 169.254.5.0/30

          • 169.254.169.252/30

        • PreSharedKey — (String)

          The pre-shared key (PSK) to establish initial authentication between the virtual private gateway and customer gateway.

          Constraints: Allowed characters are alphanumeric characters and ._. Must be between 8 and 64 characters in length and cannot start with zero (0).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpnConnection — (map)

        Information about the VPN connection.

        • CustomerGatewayConfiguration — (String)

          The configuration information for the VPN connection's customer gateway (in the native XML format). This element is always present in the CreateVpnConnection response; however, it's present in the DescribeVpnConnections response only if the VPN connection is in the pending or available state.

        • CustomerGatewayId — (String)

          The ID of the customer gateway at your end of the VPN connection.

        • Category — (String)

          The category of the VPN connection. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection. For more information, see AWS Managed VPN Categories in the Amazon Virtual Private Cloud User Guide.

        • State — (String)

          The current state of the VPN connection.

          Possible values include:
          • "pending"
          • "available"
          • "deleting"
          • "deleted"
        • Type — (String)

          The type of VPN connection.

          Possible values include:
          • "ipsec.1"
        • VpnConnectionId — (String)

          The ID of the VPN connection.

        • VpnGatewayId — (String)

          The ID of the virtual private gateway at the AWS side of the VPN connection.

        • Options — (map)

          The VPN connection options.

          • StaticRoutesOnly — (Boolean)

            Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.

        • Routes — (Array<map>)

          The static routes associated with the VPN connection.

          • DestinationCidrBlock — (String)

            The CIDR block associated with the local subnet of the customer data center.

          • Source — (String)

            Indicates how the routes were provided.

            Possible values include:
            • "Static"
          • State — (String)

            The current state of the static route.

            Possible values include:
            • "pending"
            • "available"
            • "deleting"
            • "deleted"
        • Tags — (Array<map>)

          Any tags assigned to the VPN connection.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • VgwTelemetry — (Array<map>)

          Information about the VPN tunnel.

          • AcceptedRouteCount — (Integer)

            The number of accepted routes.

          • LastStatusChange — (Date)

            The date and time of the last change in status.

          • OutsideIpAddress — (String)

            The Internet-routable IP address of the virtual private gateway's outside interface.

          • Status — (String)

            The status of the VPN tunnel.

            Possible values include:
            • "UP"
            • "DOWN"
          • StatusMessage — (String)

            If an error occurs, a description of the error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpnConnectionRoute(params = {}, callback) ⇒ AWS.Request

Creates a static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

For more information about VPN connections, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the createVpnConnectionRoute operation

var params = {
  DestinationCidrBlock: 'STRING_VALUE', /* required */
  VpnConnectionId: 'STRING_VALUE' /* required */
};
ec2.createVpnConnectionRoute(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DestinationCidrBlock — (String)

      The CIDR block associated with the local subnet of the customer network.

    • VpnConnectionId — (String)

      The ID of the VPN connection.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createVpnGateway(params = {}, callback) ⇒ AWS.Request

Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself.

For more information about virtual private gateways, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Service Reference:

Examples:

Calling the createVpnGateway operation

var params = {
  Type: ipsec.1, /* required */
  AmazonSideAsn: 0,
  AvailabilityZone: 'STRING_VALUE',
  DryRun: true || false
};
ec2.createVpnGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AvailabilityZone — (String)

      The Availability Zone for the virtual private gateway.

    • Type — (String)

      The type of VPN connection this virtual private gateway supports.

      Possible values include:
      • "ipsec.1"
    • AmazonSideAsn — (Integer)

      A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range.

      Default: 64512

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • VpnGateway — (map)

        Information about the virtual private gateway.

        • AvailabilityZone — (String)

          The Availability Zone where the virtual private gateway was created, if applicable. This field may be empty or not returned.

        • State — (String)

          The current state of the virtual private gateway.

          Possible values include:
          • "pending"
          • "available"
          • "deleting"
          • "deleted"
        • Type — (String)

          The type of VPN connection the virtual private gateway supports.

          Possible values include:
          • "ipsec.1"
        • VpcAttachments — (Array<map>)

          Any VPCs attached to the virtual private gateway.

          • State — (String)

            The current state of the attachment.

            Possible values include:
            • "attaching"
            • "attached"
            • "detaching"
            • "detached"
          • VpcId — (String)

            The ID of the VPC.

        • VpnGatewayId — (String)

          The ID of the virtual private gateway.

        • AmazonSideAsn — (Integer)

          The private Autonomous System Number (ASN) for the Amazon side of a BGP session.

        • Tags — (Array<map>)

          Any tags assigned to the virtual private gateway.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteCustomerGateway(params = {}, callback) ⇒ AWS.Request

Deletes the specified customer gateway. You must delete the VPN connection before you can delete the customer gateway.

Service Reference:

Examples:

To delete a customer gateway


/* This example deletes the specified customer gateway. */

 var params = {
  CustomerGatewayId: "cgw-0e11f167"
 };
 ec2.deleteCustomerGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteCustomerGateway operation

var params = {
  CustomerGatewayId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteCustomerGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • CustomerGatewayId — (String)

      The ID of the customer gateway.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDhcpOptions(params = {}, callback) ⇒ AWS.Request

Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

Service Reference:

Examples:

To delete a DHCP options set


/* This example deletes the specified DHCP options set. */

 var params = {
  DhcpOptionsId: "dopt-d9070ebb"
 };
 ec2.deleteDhcpOptions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteDhcpOptions operation

var params = {
  DhcpOptionsId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteDhcpOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DhcpOptionsId — (String)

      The ID of the DHCP options set.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteEgressOnlyInternetGateway(params = {}, callback) ⇒ AWS.Request

Deletes an egress-only internet gateway.

Service Reference:

Examples:

Calling the deleteEgressOnlyInternetGateway operation

var params = {
  EgressOnlyInternetGatewayId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteEgressOnlyInternetGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • EgressOnlyInternetGatewayId — (String)

      The ID of the egress-only internet gateway.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ReturnCode — (Boolean)

        Returns true if the request succeeds; otherwise, it returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFleets(params = {}, callback) ⇒ AWS.Request

Deletes the specified EC2 Fleet.

After you delete an EC2 Fleet, it launches no new instances. You must specify whether an EC2 Fleet should also terminate its instances. If you terminate the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise, the EC2 Fleet enters the deleted_running state, and the instances continue to run until they are interrupted or you terminate them manually.

Service Reference:

Examples:

Calling the deleteFleets operation

var params = {
  FleetIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  TerminateInstances: true || false, /* required */
  DryRun: true || false
};
ec2.deleteFleets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • FleetIds — (Array<String>)

      The IDs of the EC2 Fleets.

    • TerminateInstances — (Boolean)

      Indicates whether to terminate instances for an EC2 Fleet if it is deleted successfully.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SuccessfulFleetDeletions — (Array<map>)

        Information about the EC2 Fleets that are successfully deleted.

        • CurrentFleetState — (String)

          The current state of the EC2 Fleet.

          Possible values include:
          • "submitted"
          • "active"
          • "deleted"
          • "failed"
          • "deleted-running"
          • "deleted-terminating"
          • "modifying"
        • PreviousFleetState — (String)

          The previous state of the EC2 Fleet.

          Possible values include:
          • "submitted"
          • "active"
          • "deleted"
          • "failed"
          • "deleted-running"
          • "deleted-terminating"
          • "modifying"
        • FleetId — (String)

          The ID of the EC2 Fleet.

      • UnsuccessfulFleetDeletions — (Array<map>)

        Information about the EC2 Fleets that are not successfully deleted.

        • Error — (map)

          The error.

          • Code — (String)

            The error code.

            Possible values include:
            • "fleetIdDoesNotExist"
            • "fleetIdMalformed"
            • "fleetNotInDeletableState"
            • "unexpectedError"
          • Message — (String)

            The description for the error code.

        • FleetId — (String)

          The ID of the EC2 Fleet.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFlowLogs(params = {}, callback) ⇒ AWS.Request

Deletes one or more flow logs.

Service Reference:

Examples:

Calling the deleteFlowLogs operation

var params = {
  FlowLogIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.deleteFlowLogs(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • FlowLogIds — (Array<String>)

      One or more flow log IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Unsuccessful — (Array<map>)

        Information about the flow logs that could not be deleted successfully.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFpgaImage(params = {}, callback) ⇒ AWS.Request

Deletes the specified Amazon FPGA Image (AFI).

Service Reference:

Examples:

Calling the deleteFpgaImage operation

var params = {
  FpgaImageId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteFpgaImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • FpgaImageId — (String)

      The ID of the AFI.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Is true if the request succeeds, and an error otherwise.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteInternetGateway(params = {}, callback) ⇒ AWS.Request

Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.

Service Reference:

Examples:

To delete an Internet gateway


/* This example deletes the specified Internet gateway. */

 var params = {
  InternetGatewayId: "igw-c0a643a9"
 };
 ec2.deleteInternetGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteInternetGateway operation

var params = {
  InternetGatewayId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteInternetGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • InternetGatewayId — (String)

      The ID of the internet gateway.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteKeyPair(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

To delete a key pair


/* This example deletes the specified key pair. */

 var params = {
  KeyName: "my-key-pair"
 };
 ec2.deleteKeyPair(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteKeyPair operation

var params = {
  KeyName: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteKeyPair(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • KeyName — (String)

      The name of the key pair.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLaunchTemplate(params = {}, callback) ⇒ AWS.Request

Deletes a launch template. Deleting a launch template deletes all of its versions.

Service Reference:

Examples:

To delete a launch template


/* This example deletes the specified launch template. */

 var params = {
  LaunchTemplateId: "lt-0abcd290751193123"
 };
 ec2.deleteLaunchTemplate(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LaunchTemplate: {
     CreateTime: <Date Representation>, 
     CreatedBy: "arn:aws:iam::123456789012:root", 
     DefaultVersionNumber: 2, 
     LatestVersionNumber: 2, 
     LaunchTemplateId: "lt-0abcd290751193123", 
     LaunchTemplateName: "my-template"
    }
   }
   */
 });

Calling the deleteLaunchTemplate operation

var params = {
  DryRun: true || false,
  LaunchTemplateId: 'STRING_VALUE',
  LaunchTemplateName: 'STRING_VALUE'
};
ec2.deleteLaunchTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • LaunchTemplateId — (String)

      The ID of the launch template. You must specify either the launch template ID or launch template name in the request.

    • LaunchTemplateName — (String)

      The name of the launch template. You must specify either the launch template ID or launch template name in the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LaunchTemplate — (map)

        Information about the launch template.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • CreateTime — (Date)

          The time launch template was created.

        • CreatedBy — (String)

          The principal that created the launch template.

        • DefaultVersionNumber — (Integer)

          The version number of the default version of the launch template.

        • LatestVersionNumber — (Integer)

          The version number of the latest version of the launch template.

        • Tags — (Array<map>)

          The tags for the launch template.

          • Key — (String)

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value — (String)

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLaunchTemplateVersions(params = {}, callback) ⇒ AWS.Request

Deletes one or more versions of a launch template. You cannot delete the default version of a launch template; you must first assign a different version as the default. If the default version is the only version for the launch template, you must delete the entire launch template using DeleteLaunchTemplate.

Service Reference:

Examples:

To delete a launch template version


/* This example deletes the specified launch template version. */

 var params = {
  LaunchTemplateId: "lt-0abcd290751193123", 
  Versions: [
     "1"
  ]
 };
 ec2.deleteLaunchTemplateVersions(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SuccessfullyDeletedLaunchTemplateVersions: [
       {
      LaunchTemplateId: "lt-0abcd290751193123", 
      LaunchTemplateName: "my-template", 
      VersionNumber: 1
     }
    ], 
    UnsuccessfullyDeletedLaunchTemplateVersions: [
    ]
   }
   */
 });

Calling the deleteLaunchTemplateVersions operation

var params = {
  Versions: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false,
  LaunchTemplateId: 'STRING_VALUE',
  LaunchTemplateName: 'STRING_VALUE'
};
ec2.deleteLaunchTemplateVersions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • LaunchTemplateId — (String)

      The ID of the launch template. You must specify either the launch template ID or launch template name in the request.

    • LaunchTemplateName — (String)

      The name of the launch template. You must specify either the launch template ID or launch template name in the request.

    • Versions — (Array<String>)

      The version numbers of one or more launch template versions to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SuccessfullyDeletedLaunchTemplateVersions — (Array<map>)

        Information about the launch template versions that were successfully deleted.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • VersionNumber — (Integer)

          The version number of the launch template.

      • UnsuccessfullyDeletedLaunchTemplateVersions — (Array<map>)

        Information about the launch template versions that could not be deleted.

        • LaunchTemplateId — (String)

          The ID of the launch template.

        • LaunchTemplateName — (String)

          The name of the launch template.

        • VersionNumber — (Integer)

          The version number of the launch template.

        • ResponseError — (map)

          Information about the error.

          • Code — (String)

            The error code.

            Possible values include:
            • "launchTemplateIdDoesNotExist"
            • "launchTemplateIdMalformed"
            • "launchTemplateNameDoesNotExist"
            • "launchTemplateNameMalformed"
            • "launchTemplateVersionDoesNotExist"
            • "unexpectedError"
          • Message — (String)

            The error message, if applicable.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNatGateway(params = {}, callback) ⇒ AWS.Request

Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway routes in your route tables.

Service Reference:

Examples:

To delete a NAT gateway


/* This example deletes the specified NAT gateway. */

 var params = {
  NatGatewayId: "nat-04ae55e711cec5680"
 };
 ec2.deleteNatGateway(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NatGatewayId: "nat-04ae55e711cec5680"
   }
   */
 });

Calling the deleteNatGateway operation

var params = {
  NatGatewayId: 'STRING_VALUE' /* required */
};
ec2.deleteNatGateway(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NatGatewayId — (String)

      The ID of the NAT gateway.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NatGatewayId — (String)

        The ID of the NAT gateway.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNetworkAcl(params = {}, callback) ⇒ AWS.Request

Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.

Service Reference:

Examples:

To delete a network ACL


/* This example deletes the specified network ACL. */

 var params = {
  NetworkAclId: "acl-5fb85d36"
 };
 ec2.deleteNetworkAcl(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteNetworkAcl operation

var params = {
  NetworkAclId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteNetworkAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • NetworkAclId — (String)

      The ID of the network ACL.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNetworkAclEntry(params = {}, callback) ⇒ AWS.Request

Deletes the specified ingress or egress entry (rule) from the specified network ACL.

Service Reference:

Examples:

To delete a network ACL entry


/* This example deletes ingress rule number 100 from the specified network ACL. */

 var params = {
  Egress: true, 
  NetworkAclId: "acl-5fb85d36", 
  RuleNumber: 100
 };
 ec2.deleteNetworkAclEntry(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteNetworkAclEntry operation

var params = {
  Egress: true || false, /* required */
  NetworkAclId: 'STRING_VALUE', /* required */
  RuleNumber: 0, /* required */
  DryRun: true || false
};
ec2.deleteNetworkAclEntry(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Egress — (Boolean)

      Indicates whether the rule is an egress rule.

    • NetworkAclId — (String)

      The ID of the network ACL.

    • RuleNumber — (Integer)

      The rule number of the entry to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNetworkInterface(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

To delete a network interface


/* This example deletes the specified network interface. */

 var params = {
  NetworkInterfaceId: "eni-e5aa89a3"
 };
 ec2.deleteNetworkInterface(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteNetworkInterface operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteNetworkInterface(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • NetworkInterfaceId — (String)

      The ID of the network interface.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNetworkInterfacePermission(params = {}, callback) ⇒ AWS.Request

Deletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.

Examples:

Calling the deleteNetworkInterfacePermission operation

var params = {
  NetworkInterfacePermissionId: 'STRING_VALUE', /* required */
  DryRun: true || false,
  Force: true || false
};
ec2.deleteNetworkInterfacePermission(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NetworkInterfacePermissionId — (String)

      The ID of the network interface permission.

    • Force — (Boolean)

      Specify true to remove the permission even if the network interface is attached to an instance.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Returns true if the request succeeds, otherwise returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePlacementGroup(params = {}, callback) ⇒ AWS.Request

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To delete a placement group


/* This example deletes the specified placement group.
*/

 var params = {
  GroupName: "my-cluster"
 };
 ec2.deletePlacementGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deletePlacementGroup operation

var params = {
  GroupName: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deletePlacementGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • GroupName — (String)

      The name of the placement group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRoute(params = {}, callback) ⇒ AWS.Request

Deletes the specified route from the specified route table.

Service Reference:

Examples:

To delete a route


/* This example deletes the specified route from the specified route table. */

 var params = {
  DestinationCidrBlock: "0.0.0.0/0", 
  RouteTableId: "rtb-22574640"
 };
 ec2.deleteRoute(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteRoute operation

var params = {
  RouteTableId: 'STRING_VALUE', /* required */
  DestinationCidrBlock: 'STRING_VALUE',
  DestinationIpv6CidrBlock: 'STRING_VALUE',
  DryRun: true || false
};
ec2.deleteRoute(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DestinationCidrBlock — (String)

      The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.

    • DestinationIpv6CidrBlock — (String)

      The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • RouteTableId — (String)

      The ID of the route table.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRouteTable(params = {}, callback) ⇒ AWS.Request

Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.

Service Reference:

Examples:

To delete a route table


/* This example deletes the specified route table. */

 var params = {
  RouteTableId: "rtb-22574640"
 };
 ec2.deleteRouteTable(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteRouteTable operation

var params = {
  RouteTableId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteRouteTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • RouteTableId — (String)

      The ID of the route table.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSecurityGroup(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

To delete a security group


/* This example deletes the specified security group. */

 var params = {
  GroupId: "sg-903004f8"
 };
 ec2.deleteSecurityGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteSecurityGroup operation

var params = {
  DryRun: true || false,
  GroupId: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
ec2.deleteSecurityGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupId — (String)

      The ID of the security group. Required for a nondefault VPC.

    • GroupName — (String)

      [EC2-Classic, default VPC] The name of the security group. You can specify either the security group name or the security group ID.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSnapshot(params = {}, callback) ⇒ AWS.Request

Deletes the specified snapshot.

When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the volume.

You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.

For more information, see Deleting an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To delete a snapshot


/* This example deletes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. If the command succeeds, no output is returned. */

 var params = {
  SnapshotId: "snap-1234567890abcdef0"
 };
 ec2.deleteSnapshot(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteSnapshot operation

var params = {
  SnapshotId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteSnapshot(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SnapshotId — (String)

      The ID of the EBS snapshot.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSpotDatafeedSubscription(params = {}, callback) ⇒ AWS.Request

Deletes the data feed for Spot Instances.

Service Reference:

Examples:

To cancel a Spot Instance data feed subscription


/* This example deletes a Spot data feed subscription for the account. */

 var params = {
 };
 ec2.deleteSpotDatafeedSubscription(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteSpotDatafeedSubscription operation

var params = {
  DryRun: true || false
};
ec2.deleteSpotDatafeedSubscription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSubnet(params = {}, callback) ⇒ AWS.Request

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

Service Reference:

Examples:

To delete a subnet


/* This example deletes the specified subnet. */

 var params = {
  SubnetId: "subnet-9d4a7b6c"
 };
 ec2.deleteSubnet(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteSubnet operation

var params = {
  SubnetId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteSubnet(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SubnetId — (String)

      The ID of the subnet.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTags(params = {}, callback) ⇒ AWS.Request

Deletes the specified set of tags from the specified set of resources.

To list the current tags, use DescribeTags. For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

To delete a tag from a resource


/* This example deletes the tag Stack=test from the specified image. */

 var params = {
  Resources: [
     "ami-78a54011"
  ], 
  Tags: [
     {
    Key: "Stack", 
    Value: "test"
   }
  ]
 };
 ec2.deleteTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteTags operation

var params = {
  Resources: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false,
  Tags: [
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
ec2.deleteTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • Resources — (Array<String>)

      The IDs of one or more resources, separated by spaces.

    • Tags — (Array<map>)

      One or more tags to delete. Specify a tag key and an optional tag value to delete specific tags. If you specify a tag key without a tag value, we delete any tag with this key regardless of its value. If you specify a tag key with an empty string as the tag value, we delete the tag only if its value is an empty string.

      If you omit this parameter, we delete all user-defined tags for the specified resources. We do not delete AWS-generated tags (tags that have the aws: prefix).

      • Key — (String)

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

      • Value — (String)

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVolume(params = {}, callback) ⇒ AWS.Request

Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).

The volume can remain in the deleting state for several minutes.

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

Service Reference:

Examples:

To delete a volume


/* This example deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned. */

 var params = {
  VolumeId: "vol-049df61146c4d7901"
 };
 ec2.deleteVolume(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteVolume operation

var params = {
  VolumeId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteVolume(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • VolumeId — (String)

      The ID of the volume.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpc(params = {}, callback) ⇒ AWS.Request

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

Service Reference:

Examples:

To delete a VPC


/* This example deletes the specified VPC. */

 var params = {
  VpcId: "vpc-a01106c2"
 };
 ec2.deleteVpc(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the deleteVpc operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteVpc(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • VpcId — (String)

      The ID of the VPC.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpcEndpointConnectionNotifications(params = {}, callback) ⇒ AWS.Request

Deletes one or more VPC endpoint connection notifications.

Examples:

Calling the deleteVpcEndpointConnectionNotifications operation

var params = {
  ConnectionNotificationIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.deleteVpcEndpointConnectionNotifications(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ConnectionNotificationIds — (Array<String>)

      One or more notification IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Unsuccessful — (Array<map>)

        Information about the notifications that could not be deleted successfully.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpcEndpoints(params = {}, callback) ⇒ AWS.Request

Deletes one or more specified VPC endpoints. Deleting a gateway endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint. Deleting an interface endpoint deletes the endpoint network interfaces.

Service Reference:

Examples:

Calling the deleteVpcEndpoints operation

var params = {
  VpcEndpointIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.deleteVpcEndpoints(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcEndpointIds — (Array<String>)

      One or more VPC endpoint IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Unsuccessful — (Array<map>)

        Information about the VPC endpoints that were not successfully deleted.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpcEndpointServiceConfigurations(params = {}, callback) ⇒ AWS.Request

Deletes one or more VPC endpoint service configurations in your account. Before you delete the endpoint service configuration, you must reject any Available or PendingAcceptance interface endpoint connections that are attached to the service.

Examples:

Calling the deleteVpcEndpointServiceConfigurations operation

var params = {
  ServiceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.deleteVpcEndpointServiceConfigurations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • ServiceIds — (Array<String>)

      The IDs of one or more services.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Unsuccessful — (Array<map>)

        Information about the service configurations that were not deleted, if applicable.

        • Errorrequired — (map)

          Information about the error.

          • Coderequired — (String)

            The error code.

          • Messagerequired — (String)

            The error message accompanying the error code.

        • ResourceId — (String)

          The ID of the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpcPeeringConnection(params = {}, callback) ⇒ AWS.Request

Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed state.

Service Reference:

Examples:

Calling the deleteVpcPeeringConnection operation

var params = {
  VpcPeeringConnectionId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteVpcPeeringConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

    • VpcPeeringConnectionId — (String)

      The ID of the VPC peering connection.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Return — (Boolean)

        Returns true if the request succeeds; otherwise, it returns an error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpnConnection(params = {}, callback) ⇒ AWS.Request

Deletes the specified VPN connection.

If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway using the new configuration information returned with the new VPN connection ID.

Service Reference:

Examples:

Calling the deleteVpnConnection operation

var params = {
  VpnConnectionId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.deleteVpnConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • VpnConnectionId — (String)

      The ID of the VPN connection.

    • DryRun — (Boolean)

      Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteVpnConnectionRoute(params = {}, callback) ⇒ AWS.Request

Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

Service Reference:

Examples:

Calling the deleteVpnConnectionRoute operation

var params = {
  DestinationCidrBlock: 'STRING_VALUE', /* required */
  VpnConnectionId: 'STRING_VALUE' /* required */
};
ec2.deleteVpnConnectionRoute(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred