You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

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.

Service Description

Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the AWS Cloud. Using Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy applications faster. Amazon Virtual Private Cloud (Amazon VPC) enables you to provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you've defined. Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with EC2 instances. EBS volumes are highly available and reliable storage volumes that can be attached to any running instance and used like a hard drive.

To learn more, see the following resources:

Sending a Request Using EC2

var ec2 = new AWS.EC2();
ec2.applySecurityGroupsToClientVpnTargetNetwork(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, securityGroupExists, 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|AWS.Endpoint)

    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' or an Endpoint object.

  • 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.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets 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 error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • 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.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • 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

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

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: 'NUMBER_VALUE'
    },
    /* 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 Convertible 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.

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

Accepts a request to associate subnets with a transit gateway multicast domain.

Examples:

Calling the acceptTransitGatewayMulticastDomainAssociations operation

var params = {
  DryRun: true || false,
  SubnetIds: [
    'STRING_VALUE',
    /* more items */
  ],
  TransitGatewayAttachmentId: 'STRING_VALUE',
  TransitGatewayMulticastDomainId: 'STRING_VALUE'
};
ec2.acceptTransitGatewayMulticastDomainAssociations(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: {})
    • TransitGatewayMulticastDomainId — (String)

      The ID of the transit gateway multicast domain.

    • TransitGatewayAttachmentId — (String)

      The ID of the transit gateway attachment.

    • SubnetIds — (Array<String>)

      The IDs of the subnets to associate with the transit gateway multicast domain.

    • 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:

      • Associations — (map)

        Describes the multicast domain associations.

        • TransitGatewayMulticastDomainId — (String)

          The ID of the transit gateway multicast domain.

        • TransitGatewayAttachmentId — (String)

          The ID of the transit gateway attachment.

        • ResourceId — (String)

          The ID of the resource.

        • ResourceType — (String)

          The type of resource, for example a VPC attachment.

          Possible values include:
          • "vpc"
          • "vpn"
          • "direct-connect-gateway"
          • "connect"
          • "peering"
          • "tgw-peering"
        • ResourceOwnerId — (String)

          The ID of the Amazon Web Services account that owns the resource.

        • Subnets — (Array<map>)

          The subnets associated with the multicast domain.

          • SubnetId — (String)

            The ID of the subnet.

          • State — (String)

            The state of the subnet association.

            Possible values include:
            • "pendingAcceptance"
            • "associating"
            • "associated"
            • "disassociating"
            • "disassociated"
            • "rejected"
            • "failed"

Returns:

  • (AWS.Request)

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

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

Accepts a transit gateway peering attachment request. The peering attachment must be in the pendingAcceptance state.

Examples:

Calling the acceptTransitGatewayPeeringAttachment operation

var params = {
  TransitGatewayAttachmentId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.acceptTransitGatewayPeeringAttachment(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: {})
    • TransitGatewayAttachmentId — (String)

      The ID of the transit gateway 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.

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:

      • TransitGatewayPeeringAttachment — (map)

        The transit gateway peering attachment.

        • TransitGatewayAttachmentId — (String)

          The ID of the transit gateway peering attachment.

        • RequesterTgwInfo — (map)

          Information about the requester transit gateway.

          • TransitGatewayId — (String)

            The ID of the transit gateway.

          • OwnerId — (String)

            The ID of the Amazon Web Services account that owns the transit gateway.

          • Region — (String)

            The Region of the transit gateway.

        • AccepterTgwInfo — (map)

          Information about the accepter transit gateway.

          • TransitGatewayId — (String)

            The ID of the transit gateway.

          • OwnerId — (String)

            The ID of the Amazon Web Services account that owns the transit gateway.

          • Region — (String)

            The Region of the transit gateway.

        • Status — (map)

          The status of the transit gateway peering attachment.

          • Code — (String)

            The status code.

          • Message — (String)

            The status message, if applicable.

        • State — (String)

          The state of the transit gateway peering attachment. Note that the initiating state has been deprecated.

          Possible values include:
          • "initiating"
          • "initiatingRequest"
          • "pendingAcceptance"
          • "rollingBack"
          • "pending"
          • "available"
          • "modifying"
          • "deleting"
          • "deleted"
          • "failed"
          • "rejected"
          • "rejecting"
          • "failing"
        • CreationTime — (Date)

          The time the transit gateway peering attachment was created.

        • Tags — (Array<map>)

          The tags for the transit gateway peering attachment.

          • 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.

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

Accepts a request to attach a VPC to a transit gateway.

The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use RejectTransitGatewayVpcAttachment to reject a VPC attachment request.

Examples:

Calling the acceptTransitGatewayVpcAttachment operation

var params = {
  TransitGatewayAttachmentId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.acceptTransitGatewayVpcAttachment(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: {})
    • TransitGatewayAttachmentId — (String)

      The ID of the 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.

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:

      • TransitGatewayVpcAttachment — (map)

        The VPC attachment.

        • TransitGatewayAttachmentId — (String)

          The ID of the attachment.

        • TransitGatewayId — (String)

          The ID of the transit gateway.

        • VpcId — (String)

          The ID of the VPC.

        • VpcOwnerId — (String)

          The ID of the Amazon Web Services account that owns the VPC.

        • State — (String)

          The state of the VPC attachment. Note that the initiating state has been deprecated.

          Possible values include:
          • "initiating"
          • "initiatingRequest"
          • "pendingAcceptance"
          • "rollingBack"
          • "pending"
          • "available"
          • "modifying"
          • "deleting"
          • "deleted"
          • "failed"
          • "rejected"
          • "rejecting"
          • "failing"
        • SubnetIds — (Array<String>)

          The IDs of the subnets.

        • CreationTime — (Date)

          The creation time.

        • Options — (map)

          The VPC attachment options.

          • DnsSupport — (String)

            Indicates whether DNS support is enabled.

            Possible values include:
            • "enable"
            • "disable"
          • Ipv6Support — (String)

            Indicates whether IPv6 support is disabled.

            Possible values include:
            • "enable"
            • "disable"
          • ApplianceModeSupport — (String)

            Indicates whether appliance mode support is enabled.

            Possible values include:
            • "enable"
            • "disable"
        • Tags — (Array<map>)

          The tags for the VPC attachment.

          • 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.

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 VPC 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.

        • Error — (map)

          Information about the error.

          • Code — (String)

            The error code.

          • Message — (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 ID of the Amazon Web Services account that owns the VPC.

          • 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 ID of the Amazon Web Services account that owns the VPC.

          • 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 or IPv6 address range that is provisioned for use with your Amazon Web Services 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 Amazon Web Services. To minimize down time, you can configure your Amazon Web Services 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 Amazon Web Services.

It can take a few minutes before traffic to the specified addresses starts routing to Amazon Web Services 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 address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only a portion of the provisioned range.

    • 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 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"
          • "provisioned-not-publicly-advertisable"

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 Amazon Web Services 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 Amazon Web Services account.

You can allocate an Elastic IP address from an address pool owned by Amazon Web Services or from an address pool created from a public IPv4 address range that you have brought to Amazon Web Services for use with your Amazon Web Services 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 Amazon Web Services 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.

You can allocate a carrier IP address which is a public IP address from a telecommunication carrier, to a network interface which resides in a subnet in a Wavelength Zone (for example an EC2 instance).

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',
  CustomerOwnedIpv4Pool: 'STRING_VALUE',
  Domain: vpc | standard,
  DryRun: true || false,
  NetworkBorderGroup: 'STRING_VALUE',
  PublicIpv4Pool: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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)

      Indicates whether the Elastic IP address is for use with instances in a VPC or instances in EC2-Classic.

      Default: If the Region supports EC2-Classic, the default is standard. Otherwise, the default is vpc.

      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.

    • NetworkBorderGroup — (String)

      A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.

      Use DescribeAvailabilityZones to view the network border groups.

      You cannot use a network border group with EC2 Classic. If you attempt this operation on EC2 Classic, you receive an InvalidParameterCombination error.

    • CustomerOwnedIpv4Pool — (String)

      The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.

    • 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 assign to the Elastic IP address.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • PublicIp — (String)

        The Elastic IP address.

      • AllocationId — (String)

        [EC2-VPC] The ID that Amazon Web Services 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.

      • NetworkBorderGroup — (String)

        The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.

      • Domain — (String)

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

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

        The customer-owned IP address.

      • CustomerOwnedIpv4Pool — (String)

        The ID of the customer-owned address pool.

      • CarrierIp — (String)

        The carrier IP address. This option is only available for network interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance).

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 supported instance type or instance family, the Availability Zone in which to allocate the host, and the number of hosts to allocate.

Service Reference:

Examples:

Calling the allocateHosts operation

var params = {
  AvailabilityZone: 'STRING_VALUE', /* required */
  Quantity: 'NUMBER_VALUE', /* required */
  AutoPlacement: on | off,
  ClientToken: 'STRING_VALUE',
  HostRecovery: on | off,
  InstanceFamily: 'STRING_VALUE',
  InstanceType: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      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)

      Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see Understanding auto-placement and affinity in the Amazon EC2 User Guide.

      Default: on

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

      The Availability Zone in which to allocate the Dedicated Host.

    • ClientToken — (String)

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

    • InstanceType — (String)

      Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.

      If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify InstanceFamily instead. You cannot specify InstanceType and InstanceFamily in the same request.

    • InstanceFamily — (String)

      Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.

      If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify InstanceType instead. You cannot specify InstanceFamily and InstanceType in the same request.

    • 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 on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • HostRecovery — (String)

      Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see Host recovery in the Amazon EC2 User Guide.

      Default: off

      Possible values include:
      • "on"
      • "off"

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.

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

Applies a security group to the association between the target network and the Client VPN endpoint. This action replaces the existing security groups with the specified security groups.

Examples:

Calling the applySecurityGroupsToClientVpnTargetNetwork operation

var params = {
  ClientVpnEndpointId: 'STRING_VALUE', /* required */
  SecurityGroupIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  VpcId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.applySecurityGroupsToClientVpnTargetNetwork(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: {})
    • ClientVpnEndpointId — (String)

      The ID of the Client VPN endpoint.

    • VpcId — (String)

      The ID of the VPC in which the associated target network is located.

    • SecurityGroupIds — (Array<String>)

      The IDs of the security groups to apply to the associated target network. Up to 5 security groups can be applied to an associated target network.

    • 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:

      • SecurityGroupIds — (Array<String>)

        The IDs of the applied security groups.

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.

You must specify either the IPv6 addresses or the IPv6 address count in the request.

You can optionally use Prefix Delegation on the network interface. You must specify either the IPV6 Prefix Delegation prefixes, or the IPv6 Prefix Delegation count. For information, see Assigning prefixes to Amazon EC2 network interfaces in the Amazon Elastic Compute Cloud User Guide.

Service Reference:

Examples:

Calling the assignIpv6Addresses operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  Ipv6AddressCount: 'NUMBER_VALUE',
  Ipv6Addresses: [
    'STRING_VALUE',
    /* more items */
  ],
  Ipv6PrefixCount: 'NUMBER_VALUE',
  Ipv6Prefixes: [
    '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 additional IPv6 addresses to assign to the network interface. The specified number of IPv6 addresses are assigned in addition to the existing IPv6 addresses that are already assigned 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.

    • Ipv6PrefixCount — (Integer)

      The number of IPv6 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot use this option if you use the Ipv6Prefixes option.

    • Ipv6Prefixes — (Array<String>)

      One or more IPv6 prefixes assigned to the network interface. You cannot use this option if you use the Ipv6PrefixCount option.

    • 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 new IPv6 addresses assigned to the network interface. Existing IPv6 addresses that were assigned to the network interface before the request are not included.

      • AssignedIpv6Prefixes — (Array<String>)

        The IPv6 prefixes that are 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.

You must specify either the IP addresses or the IP address count in the request.

You can optionally use Prefix Delegation on the network interface. You must specify either the IPv4 Prefix Delegation prefixes, or the IPv4 Prefix Delegation count. For information, see Assigning prefixes to Amazon EC2 network interfaces in the Amazon Elastic Compute Cloud User Guide.

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
   /*
   data = {
   }
   */
 });

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
   /*
   data = {
   }
   */
 });

Calling the assignPrivateIpAddresses operation

var params = {
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  AllowReassignment: true || false,
  Ipv4PrefixCount: 'NUMBER_VALUE',
  Ipv4Prefixes: [
    'STRING_VALUE',
    /* more items */
  ],
  PrivateIpAddresses: [
    'STRING_VALUE',
    /* more items */
  ],
  SecondaryPrivateIpAddressCount: 'NUMBER_VALUE'
};
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.

    • Ipv4Prefixes — (Array<String>)

      One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the Ipv4PrefixCount option.

    • Ipv4PrefixCount — (Integer)

      The number of IPv4 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot use this option if you use the Ipv4 Prefixes option.

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:

      • NetworkInterfaceId — (String)

        The ID of the network interface.

      • AssignedPrivateIpAddresses — (Array<map>)

        The private IP addresses assigned to the network interface.

        • PrivateIpAddress — (String)

          The private IP address assigned to the network interface.

      • AssignedIpv4Prefixes — (Array<map>)

        The IPv4 prefixes that are assigned to the network interface.

Returns:

  • (AWS.Request)

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

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

Associates an Elastic IP address, or carrier IP address (for instances that are in subnets in Wavelength Zones) 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.

[Subnets in Wavelength Zones] You can associate an IP address from the telecommunication carrier to the instance or network interface.

You cannot associate an Elastic IP address with an interface in a different network border group.

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. The instance must have exactly one attached network interface. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. For EC2-Classic, you must specify an instance ID and the instance must be in the running state.

    • PublicIp — (String)

      [EC2-Classic] The Elastic IP address to associate with the instance. 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.

      For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both.

    • 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.

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

Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy.

If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify the Client VPN endpoint (ModifyClientVpnEndpoint) and change the VPC that's associated with it.

Service Reference:

Examples:

Calling the associateClientVpnTargetNetwork operation

var params = {
  ClientVpnEndpointId: 'STRING_VALUE', /* required */
  SubnetId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false
};
ec2.associateClientVpnTargetNetwork(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: {})
    • ClientVpnEndpointId — (String)

      The ID of the Client VPN endpoint.

    • SubnetId — (String)

      The ID of the subnet to associate with the Client VPN endpoint.

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.
    • 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:

      • AssociationId — (String)

        The unique ID of the target network association.

      • Status — (map)

        The current state of the target network association.

        • Code — (String)

          The state of the target network association.

          Possible values include:
          • "associating"
          • "associated"
          • "association-failed"
          • "disassociating"
          • "disassociated"
        • Message — (String)

          A message about the status of the target network association, if applicable.

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.

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

Associates an Identity and Access Management (IAM) role with an Certificate Manager (ACM) certificate. This enables the certificate to be used by the ACM for Nitro Enclaves application inside an enclave. For more information, see Certificate Manager for Nitro Enclaves in the Amazon Web Services Nitro Enclaves User Guide.

When the IAM role is associated with the ACM certificate, the certificate, certificate chain, and encrypted private key are placed in an Amazon S3 bucket that only the associated IAM role can access. The private key of the certificate is encrypted with an Amazon Web Services managed key that has an attached attestation-based key policy.

To enable the IAM role to access the Amazon S3 object, you must grant it permission to call s3:GetObject on the Amazon S3 bucket returned by the command. To enable the IAM role to access the KMS key, you must grant it permission to call kms:Decrypt on the KMS key returned by the command. For more information, see Grant the role permission to access the certificate and encryption key in the Amazon Web Services Nitro Enclaves User Guide.

Examples:

Calling the associateEnclaveCertificateIamRole operation

var params = {
  CertificateArn: 'STRING_VALUE',
  DryRun: true || false,
  RoleArn: 'STRING_VALUE'
};
ec2.associateEnclaveCertificateIamRole(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: {})
    • CertificateArn — (String)

      The ARN of the ACM certificate with which to associate the IAM role.

    • RoleArn — (String)

      The ARN of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.

    • 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:

      • CertificateS3BucketName — (String)

        The name of the Amazon S3 bucket to which the certificate was uploaded.

      • CertificateS3ObjectKey — (String)

        The Amazon S3 object key where the certificate, certificate chain, and encrypted private key bundle are stored. The object key is formatted as follows: role_arn/certificate_arn.

      • EncryptionKmsKeyId — (String)

        The ID of the KMS key used to encrypt the private key of the certificate.

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.

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

Associates one or more targets with an event window. Only one type of target (instance IDs, Dedicated Host IDs, or tags) can be specified with an event window.

For more information, see Define event windows for scheduled events in the Amazon EC2 User Guide.

Service Reference:

Examples:

Calling the associateInstanceEventWindow operation

var params = {
  AssociationTarget: { /* required */
    DedicatedHostIds: [
      'STRING_VALUE',
      /* more items */
    ],
    InstanceIds: [
      'STRING_VALUE',
      /* more items */
    ],
    InstanceTags: [
      {
        Key: 'STRING_VALUE',
        Value: 'STRING_VALUE'
      },
      /* more items */
    ]
  },
  InstanceEventWindowId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.associateInstanceEventWindow(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.

    • InstanceEventWindowId — (String)

      The ID of the event window.

    • AssociationTarget — (map)

      One or more targets associated with the specified event window.

      • InstanceIds — (Array<String>)

        The IDs of the instances to associate with the event window. If the instance is on a Dedicated Host, you can't specify the Instance ID parameter; you must use the Dedicated Host ID parameter.

      • InstanceTags — (Array<map>)

        The instance tags to associate with the event window. Any instances associated with the tags will be associated with the event window.

        • 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.

      • DedicatedHostIds — (Array<String>)

        The IDs of the Dedicated Hosts to associate with the event window.

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:

      • InstanceEventWindow — (map)

        Information about the event window.

        • InstanceEventWindowId — (String)

          The ID of the event window.

        • TimeRanges — (Array<map>)

          One or more time ranges defined for the event window.

          • StartWeekDay — (String)

            The day on which the time range begins.

            Possible values include:
            • "sunday"
            • "monday"
            • "tuesday"
            • "wednesday"
            • "thursday"
            • "friday"
            • "saturday"
          • StartHour — (Integer)

            The hour when the time range begins.

          • EndWeekDay — (String)

            The day on which the time range ends.

            Possible values include:
            • "sunday"
            • "monday"
            • "tuesday"
            • "wednesday"
            • "thursday"
            • "friday"
            • "saturday"
          • EndHour — (Integer)

            The hour when the time range ends.

        • Name — (String)

          The name of the event window.

        • CronExpression — (String)

          The cron expression defined for the event window.

        • AssociationTarget — (map)

          One or more targets associated with the event window.

          • InstanceIds — (Array<String>)

            The IDs of the instances associated with the event window.

          • Tags — (Array<map>)

            The instance tags associated with the event window. Any instances associated with the tags will be associated with the event window.

            • 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.

          • DedicatedHostIds — (Array<String>)

            The IDs of the Dedicated Hosts associated with the event window.

        • State — (String)

          The current state of the event window.

          Possible values include:
          • "creating"
          • "deleting"
          • "active"
          • "deleted"
        • Tags — (Array<map>)

          The instance tags associated with the event window.

          • 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.

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

Associates a subnet in your VPC or an internet gateway or virtual private gateway attached to your VPC with a route table in your VPC. This association causes traffic from the subnet or gateway 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 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 */
  DryRun: true || false,
  GatewayId: 'STRING_VALUE',
  SubnetId: 'STRING_VALUE'
};
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.

    • GatewayId — (String)

      The ID of the internet gateway or virtual private 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:

      • AssociationId — (String)

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

      • AssociationState — (map)

        The state of the association.

        • State — (String)

          The state of the association.

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

          The status message, if applicable.

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.

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

Associates the specified subnets and transit gateway attachments with the specified transit gateway multicast domain.

The transit gateway attachment must be in the available state before you can add a resource. Use DescribeTransitGatewayAttachments to see the state of the attachment.

Examples:

Calling the associateTransitGatewayMulticastDomain operation

var params = {
  DryRun: true || false,
  SubnetIds: [
    'STRING_VALUE',
    /* more items */
  ],
  TransitGatewayAttachmentId: 'STRING_VALUE',
  TransitGatewayMulticastDomainId: 'STRING_VALUE'
};
ec2.associateTransitGatewayMulticastDomain(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: {})
    • TransitGatewayMulticastDomainId — (String)

      The ID of the transit gateway multicast domain.

    • TransitGatewayAttachmentId — (String)

      The ID of the transit gateway attachment to associate with the transit gateway multicast domain.

    • SubnetIds — (Array<String>)

      The IDs of the subnets to associate with the transit gateway multicast domain.

    • 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:

      • Associations — (map)

        Information about the transit gateway multicast domain associations.

        • TransitGatewayMulticastDomainId — (String)

          The ID of the transit gateway multicast domain.

        • TransitGatewayAttachmentId — (String)

          The ID of the transit gateway attachment.

        • ResourceId — (String)

          The ID of the resource.

        • ResourceType — (String)

          The type of resource, for example a VPC attachment.

          Possible values include:
          • "vpc"
          • "vpn"
          • "direct-connect-gateway"
          • "connect"
          • "peering"
          • "tgw-peering"
        • ResourceOwnerId — (String)

          The ID of the Amazon Web Services account that owns the resource.

        • Subnets — (Array<map>)

          The subnets associated with the multicast domain.

          • SubnetId — (String)

            The ID of the subnet.

          • State — (String)

            The state of the subnet association.

            Possible values include:
            • "pendingAcceptance"
            • "associating"
            • "associated"
            • "disassociating"
            • "disassociated"
            • "rejected"
            • "failed"

Returns:

  • (AWS.Request)

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

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

Associates the specified attachment with the specified transit gateway route table. You can associate only one route table with an attachment.

Examples:

Calling the associateTransitGatewayRouteTable operation

var params = {
  TransitGatewayAttachmentId: 'STRING_VALUE', /* required */
  TransitGatewayRouteTableId: 'STRING_VALUE', /* required */
  DryRun: true || false
};
ec2.associateTransitGatewayRouteTable(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: {})
    • TransitGatewayRouteTableId — (String)

      The ID of the transit gateway route table.

    • TransitGatewayAttachmentId — (String)

      The ID of the 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.

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:

      • Association — (map)

        The ID of the association.

        • TransitGatewayRouteTableId — (String)

          The ID of the transit gateway route table.

        • TransitGatewayAttachmentId — (String)

          The ID of the attachment.

        • ResourceId — (String)

          The ID of the resource.

        • ResourceType — (String)

          The resource type. Note that the tgw-peering resource type has been deprecated.

          Possible values include:
          • "vpc"
          • "vpn"
          • "direct-connect-gateway"
          • "connect"
          • "peering"
          • "tgw-peering"
        • State — (String)

          The state of the association.

          Possible values include:
          • "associating"
          • "associated"
          • "disassociating"
          • "disassociated"

Returns:

  • (AWS.Request)

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

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

Note: This API action is currently in limited preview only. If you are interested in using this feature, contact your account manager.

Associates a branch network interface with a trunk network interface.

Before you create the association, run the create-network-interface command and set --interface-type to trunk. You must also create a network interface for each branch network interface that you want to associate with the trunk network interface.

Service Reference:

Examples:

Calling the associateTrunkInterface operation

var params = {
  BranchInterfaceId: 'STRING_VALUE', /* required */
  TrunkInterfaceId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  GreKey: 'NUMBER_VALUE',
  VlanId: 'NUMBER_VALUE'
};
ec2.associateTrunkInterface(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: {})
    • BranchInterfaceId — (String)

      The ID of the branch network interface.

    • TrunkInterfaceId — (String)

      The ID of the trunk network interface.

    • VlanId — (Integer)

      The ID of the VLAN. This applies to the VLAN protocol.

    • GreKey — (Integer)

      The application key. This applies to the GRE protocol.

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.
    • 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:

      • InterfaceAssociation — (map)

        Information about the association between the trunk network interface and branch network interface.

        • AssociationId — (String)

          The ID of the association.

        • BranchInterfaceId — (String)

          The ID of the branch network interface.

        • TrunkInterfaceId — (String)

          The ID of the trunk network interface.

        • InterfaceProtocol — (String)

          The interface protocol. Valid values are VLAN and GRE.

          Possible values include:
          • "VLAN"
          • "GRE"
        • VlanId — (Integer)

          The ID of the VLAN when you use the VLAN protocol.

        • GreKey — (Integer)

          The application key when you use the GRE protocol.

        • Tags — (Array<map>)

          The tags for the trunk interface association.

          • 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.

      • ClientToken — (String)

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

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, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP addresses (BYOIP). The IPv6 CIDR block size is fixed at /56.

You must specify one of the following in the request: an IPv4 CIDR block, an IPv6 pool, or an Amazon-provided IPv6 CIDR block.

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',
  Ipv6CidrBlock: 'STRING_VALUE',
  Ipv6CidrBlockNetworkBorderGroup: 'STRING_VALUE',
  Ipv6Pool: '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.

    • Ipv6CidrBlockNetworkBorderGroup — (String)

      The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.

      You must set AmazonProvidedIpv6CidrBlock to true to use this parameter.

      You can have one IPv6 CIDR block association per network border group.

    • Ipv6Pool — (String)

      The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.

    • Ipv6CidrBlock — (String)

      An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool in the request.

      To let Amazon choose the IPv6 CIDR block for you, omit this parameter.

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.

        • NetworkBorderGroup — (String)

          The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1.

        • Ipv6Pool — (String)

          The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.

      • 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 or a virtual private 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: 'NUMBER_VALUE', /* required */
  InstanceId: 'STRING_VALUE', /* required */
  NetworkInterfaceId: 'STRING_VALUE', /* required */
  DryRun: true || false,
  NetworkCardIndex: 'NUMBER_VALUE'
};
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.

    • NetworkCardIndex — (Integer)

      The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 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:

      • AttachmentId — (String)

        The ID of the network interface attachment.

      • NetworkCardIndex — (Integer)

        The index of the network card.

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 must be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

After you attach an EBS volume, you must make it available. For more information, see Make an EBS volume available for use.

If a volume has an Amazon Web Services Marketplace product code:

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

  • Amazon Web Services 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, see Attach an Amazon EBS volume to an instance 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 Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN 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.

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

Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules that grant access to networks. You must configure ingress authorization rules to enable clients to access resources in Amazon Web Services or on-premises networks.

Service Reference:

Examples:

Calling the authorizeClientVpnIngress operation

var params = {
  ClientVpnEndpointId: 'STRING_VALUE', /* required */
  TargetNetworkCidr: 'STRING_VALUE', /* required */
  AccessGroupId: 'STRING_VALUE',
  AuthorizeAllGroups: true || false,
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DryRun: true || false
};
ec2.authorizeClientVpnIngress(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: {})
    • ClientVpnEndpointId — (String)

      The ID of the Client VPN endpoint.

    • TargetNetworkCidr — (String)

      The IPv4 address range, in CIDR notation, of the network for which access is being authorized.

    • AccessGroupId — (String)

      The ID of the group to grant access to, for example, the Active Directory group or identity provider (IdP) group. Required if AuthorizeAllGroups is false or not specified.

    • AuthorizeAllGroups — (Boolean)

      Indicates whether to grant access to all clients. Specify true to grant all clients who successfully establish a VPN connection access to the network. Must be set to true if AccessGroupId is not specified.

    • Description — (String)

      A brief description of the authorization rule.

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.
    • 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:

      • Status — (map)

        The current state of the authorization rule.

        • Code — (String)

          The state of the authorization rule.

          Possible values include:
          • "authorizing"
          • "active"
          • "failed"
          • "revoking"
        • Message — (String)

          A message about the status of the authorization rule, if applicable.

Returns:

  • (AWS.Request)

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

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

[VPC only] Adds the specified outbound (egress) rules to a security group for use with a VPC.

An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR address ranges, or to the instances that are associated with the specified destination security groups.

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

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

For information about VPC security group quotas, see Amazon VPC quotas.

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
   /*
   data = {
   }
   */
 });

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
   /*
   data = {
   }
   */
 });

Calling the authorizeSecurityGroupEgress operation

var params = {
  GroupId: 'STRING_VALUE', /* required */
  CidrIp: 'STRING_VALUE',
  DryRun: true || false,
  FromPort: 'NUMBER_VALUE',
  IpPermissions: [
    {
      FromPort: 'NUMBER_VALUE',
      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: 'NUMBER_VALUE',
      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',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  ToPort: 'NUMBER_VALUE'
};
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>)

      The 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, icmpv6) or number (see Protocol Numbers).

        [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 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 icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.

      • IpRanges — (Array<map>)

        The 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>)

        [VPC only] The 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>)

        [VPC only] The prefix list IDs.

        • 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. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • UserIdGroupPairs — (Array<map>)

        The security group and Amazon Web Services 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 Amazon Web Services 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 Amazon Web Services 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.

    • TagSpecifications — (Array<map>)

      The tags applied to the security group rule.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • 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. The data object has the following properties:

      • Return — (Boolean)

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

      • SecurityGroupRules — (Array<map>)

        Information about the outbound (egress) security group rules that were added.

        • SecurityGroupRuleId — (String)

          The ID of the security group rule.

        • GroupId — (String)

          The ID of the security group.

        • GroupOwnerId — (String)

          The ID of the Amazon Web Services account that owns the security group.

        • IsEgress — (Boolean)

          Indicates whether the security group rule is an outbound rule.

        • IpProtocol — (String)

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

          Use -1 to specify all protocols.

        • FromPort — (Integer)

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

        • 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. If you specify all ICMP/ICMPv6 types, you must specify all codes.

        • CidrIpv4 — (String)

          The IPv4 CIDR range.

        • CidrIpv6 — (String)

          The IPv6 CIDR range.

        • PrefixListId — (String)

          The ID of the prefix list.

        • ReferencedGroupInfo — (map)

          Describes the security group that is referenced in the rule.

          • GroupId — (String)

            The ID of the security group.

          • PeeringStatus — (String)

            The status of a VPC peering connection, if applicable.

          • UserId — (String)

            The Amazon Web Services account ID.

          • VpcId — (String)

            The ID of the VPC.

          • VpcPeeringConnectionId — (String)

            The ID of the VPC peering connection.

        • Description — (String)

          The security group rule description.

        • Tags — (Array<map>)

          The tags applied to the security group rule.

          • 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.

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

Adds the specified inbound (ingress) rules to a security group.

An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR address range, or from the instances that are associated with the specified destination security groups.

You specify a protocol for each rule (for example, TCP). For TCP and UDP, you must also specify the destination port or port range. For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean all types or all codes.

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

For more information about VPC security group quotas, see Amazon VPC quotas.

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
   /*
   data = {
   }
   */
 });

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
   /*
   data = {
   }
   */
 });

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
   /*
   data = {
   }
   */
 });

Calling the authorizeSecurityGroupIngress operation

var params = {
  CidrIp: 'STRING_VALUE',
  DryRun: true || false,
  FromPort: 'NUMBER_VALUE',
  GroupId: 'STRING_VALUE',
  GroupName: 'STRING_VALUE',
  IpPermissions: [
    {
      FromPort: 'NUMBER_VALUE',
      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: 'NUMBER_VALUE',
      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',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  ToPort: 'NUMBER_VALUE'
};
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 IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group. To specify an IPv6 address range, use a set of IP permissions.

      Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

    • FromPort — (Integer)

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

      Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

    • 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>)

      The sets of IP 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, icmpv6) or number (see Protocol Numbers).

        [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 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 icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.

      • IpRanges — (Array<map>)

        The 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>)

        [VPC only] The 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>)

        [VPC only] The prefix list IDs.

        • 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. If you specify all ICMP/ICMPv6 types, you must specify all codes.

      • UserIdGroupPairs — (Array<map>)

        The security group and Amazon Web Services 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 Amazon Web Services 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 Amazon Web Services 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). To specify icmpv6, use a set of IP permissions.

      [VPC only] Use -1 to specify all protocols. If you specify -1 or a protocol other than tcp, udp, or icmp, traffic on all ports is allowed, regardless of any ports you specify.

      Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

    • 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)

      [nondefault VPC] The Amazon Web Services 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 code number. For the ICMP code number, use -1 to specify all codes. If you specify all ICMP types, you must specify all codes.

      Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

    • 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>)

      [VPC Only] The tags applied to the security group rule.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • Return — (Boolean)

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

      • SecurityGroupRules — (Array<map>)

        Information about the inbound (ingress) security group rules that were added.

        • SecurityGroupRuleId — (String)

          The ID of the security group rule.

        • GroupId — (String)

          The ID of the security group.

        • GroupOwnerId — (String)

          The ID of the Amazon Web Services account that owns the security group.

        • IsEgress — (Boolean)

          Indicates whether the security group rule is an outbound rule.

        • IpProtocol — (String)

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

          Use -1 to specify all protocols.

        • FromPort — (Integer)

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

        • 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. If you specify all ICMP/ICMPv6 types, you must specify all codes.

        • CidrIpv4 — (String)

          The IPv4 CIDR range.

        • CidrIpv6 — (String)

          The IPv6 CIDR range.

        • PrefixListId — (String)

          The ID of the prefix list.

        • ReferencedGroupInfo — (map)

          Describes the security group that is referenced in the rule.

          • GroupId — (String)

            The ID of the security group.

          • PeeringStatus — (String)

            The status of a VPC peering connection, if applicable.

          • UserId — (String)

            The Amazon Web Services account ID.

          • VpcId — (String)

            The ID of the VPC.

          • VpcPeeringConnectionId — (String)

            The ID of the VPC peering connection.

        • Description — (String)

          The security group rule description.

        • Tags — (Array<map>)

          The tags applied to the security group rule.

          • 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.

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: Buffer.from('...') || '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 Amazon Web Services 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 Amazon Web Services 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 Amazon Web Services 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.

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

Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity Reservation Fleet, the following happens:

  • The Capacity Reservation Fleet's status changes to cancelled.

  • The individual Capacity Reservations in the Fleet are cancelled. Instances running in the Capacity Reservations at the time of cancelling the Fleet continue to run in shared capacity.

  • The Fleet stops creating new Capacity Reservations.

Service Reference:

Examples:

Calling the cancelCapacityReservationFleets operation

var params = {
  CapacityReservationFleetIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false
};
ec2.cancelCapacityReservationFleets(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.

    • CapacityReservationFleetIds — (Array<String>)

      The IDs of the Capacity Reservation Fleets to cancel.

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:

      • SuccessfulFleetCancellations — (Array<map>)

        Information about the Capacity Reservation Fleets that were successfully cancelled.

        • CurrentFleetState — (String)

          The current state of the Capacity Reservation Fleet.

          Possible values include:
          • "submitted"
          • "modifying"
          • "active"
          • "partially_fulfilled"
          • "expiring"
          • "expired"
          • "cancelling"
          • "cancelled"
          • "failed"
        • PreviousFleetState — (String)

          The previous state of the Capacity Reservation Fleet.

          Possible values include:
          • "submitted"
          • "modifying"
          • "active"
          • "partially_fulfilled"
          • "expiring"
          • "expired"
          • "cancelling"
          • "cancelled"
          • "failed"
        • CapacityReservationFleetId — (String)

          The ID of the Capacity Reservation Fleet that was successfully cancelled.

      • FailedFleetCancellations — (Array<map>)

        Information about the Capacity Reservation Fleets that could not be cancelled.

        • CapacityReservationFleetId — (String)

          The ID of the Capacity Reservation Fleet that could not be cancelled.

        • CancelCapacityReservationFleetError — (map)

          Information about the Capacity Reservation Fleet cancellation error.

          • Code — (String)

            The error code.

          • Message — (String)

            The error message.

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 EC2 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.

        • CurrentSpotFleetRequestState — (String)

          The current state of the Spot Fleet request.

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

          The previous state of the Spot Fleet request.

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

          The ID of the Spot Fleet request.

      • UnsuccessfulFleetRequests — (Array<map>)

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

        • Error — (map)

          The error.

          • Code — (String)

            The error code.

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

            The description for the error code.

        • SpotFleetRequestId — (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 Amazon Web Services 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. You can copy an AMI from one Region to another, or from a Region to an Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost. To copy an AMI to another partition, see CreateStoreImageTask.

To copy an AMI from one Region to another, specify the source Region using the SourceRegion parameter, and specify the destination Region using its endpoint. 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.

To copy an AMI from a Region to an Outpost, specify the source Region using the SourceRegion parameter, and specify the ARN of the destination Outpost using DestinationOutpostArn. Backing snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region, or a different key that you specify in the request using KmsKeyId. Outposts do not support unencrypted snapshots. For more information, Amazon EBS local snapshots on Outposts in the Amazon Elastic Compute Cloud User Guide.

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',
  DestinationOutpostArn: '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 Ensuring idempotency in the Amazon EC2 API Reference.

    • 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 KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

    • KmsKeyId — (String)

      The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to true.

      You can specify a KMS key using any of the following:

      • Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.

      • Key alias. For example, alias/ExampleAlias.

      • Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.

      • Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

      Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.

      The specified KMS key must exist in the destination Region.

      Amazon EBS does not support asymmetric KMS keys.

    • 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.

    • DestinationOutpostArn — (String)

      The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.

      For more information, see Copying AMIs from an Amazon Web Services Region to an Outpost in the Amazon Elastic Compute Cloud User Guide.

    • 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 a snapshot within the same Region, from one Region to another, or from a Region to an Outpost. You can't copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.

You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).

When copying snapshots to a Region, copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless you enable encryption for the snapshot copy operation. By default, encrypted snapshot copies use the default Key Management Service (KMS) KMS key; however, you can specify a different KMS key. To copy an encrypted snapshot that has been shared from another account, you must have permissions for the KMS key used to encrypt the snapshot.

Snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region, or a different key that you specify in the request using KmsKeyId. Outposts do not support unencrypted snapshots. For more information, Amazon EBS local snapshots on Outposts in the Amazon Elastic Compute Cloud User Guide.

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

For more information, see Copy 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',
  DestinationOutpostArn: 'STRING_VALUE',
  DestinationRegion: 'STRING_VALUE',
  DryRun: true || false,
  Encrypted: true || false,
  KmsKeyId: 'STRING_VALUE',
  PresignedUrl: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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.

    • DestinationOutpostArn — (String)

      The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.

      For more information, see Copy snapshots from an Amazon Web Services Region to an Outpost in the Amazon Elastic Compute Cloud User Guide.

    • 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 CLI, this is specified using the --region parameter or the default Region in your Amazon Web Services configuration file.

    • Encrypted — (Boolean)

      To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

    • KmsKeyId — (String)

      The identifier of the Key Management Service (KMS) KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is specified, the encrypted state must be true.

      You can specify the KMS key using any of the following:

      • Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.

      • Key alias. For example, alias/ExampleAlias.

      • Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.

      • Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

      Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.

    • 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 Amazon Web Services 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: Using Query Parameters (Amazon Web Services 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.

    • TagSpecifications — (Array<map>)

      The tags to apply to the new snapshot.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • SnapshotId — (String)

        The ID of the new snapshot.

      • Tags — (Array<map>)

        Any tags applied to the new 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.

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 EC2 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 Quotas in the Amazon EC2 User Guide.

Service Reference:

Examples:

Calling the createCapacityReservation operation

var params = {
  InstanceCount: 'NUMBER_VALUE', /* 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 | Linux with SQL Server Standard | Linux with SQL Server Web | Linux with SQL Server Enterprise, /* required */
  InstanceType: 'STRING_VALUE', /* required */
  AvailabilityZone: 'STRING_VALUE',
  AvailabilityZoneId: 'STRING_VALUE',
  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,
  OutpostArn: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      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 Ensure Idempotency.

    • InstanceType — (String)

      The instance type for which to reserve capacity. For more information, see Instance types in the Amazon EC2 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"
      • "Linux with SQL Server Standard"
      • "Linux with SQL Server Web"
      • "Linux with SQL Server Enterprise"
    • AvailabilityZone — (String)

      The Availability Zone in which to create the Capacity Reservation.

    • AvailabilityZoneId — (String)

      The ID of 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 Amazon Web Services accounts.

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

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

      The number of instances for which to reserve capacity.

      Valid range: 1 - 1000

    • 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 on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • OutpostArn — (String)

      The Amazon Resource Name (ARN) of the Outpost on which to create 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:

      • CapacityReservation — (map)

        Information about the Capacity Reservation.

        • CapacityReservationId — (String)

          The ID of the Capacity Reservation.

        • OwnerId — (String)

          The ID of the Amazon Web Services account that owns the Capacity Reservation.

        • CapacityReservationArn — (String)

          The Amazon Resource Name (ARN) of the Capacity Reservation.

        • AvailabilityZoneId — (String)

          The Availability Zone 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"
          • "Linux with SQL Server Standard"
          • "Linux with SQL Server Web"
          • "Linux with SQL Server Enterprise"
        • 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 Amazon Web Services accounts.

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

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

          The total 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.

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

          • cancelled - The Capacity Reservation was 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"
        • StartDate — (Date)

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

        • 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.

        • OutpostArn — (String)

          The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.

        • CapacityReservationFleetId — (String)

          The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity Reservations that were created by a Capacity Reservation Fleet.

Returns:

  • (AWS.Request)

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

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

Creates a Capacity Reservation Fleet. For more information, see Create a Capacity Reservation Fleet in the Amazon EC2 User Guide.

Service Reference:

Examples:

Calling the createCapacityReservationFleet operation

var params = {
  InstanceTypeSpecifications: [ /* required */
    {
      AvailabilityZone: 'STRING_VALUE',
      AvailabilityZoneId: 'STRING_VALUE',
      EbsOptimized: true || false,
      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 | Linux with SQL Server Standard | Linux with SQL Server Web | Linux with SQL Server Enterprise,
      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 | t3a.nano | t3a.micro | t3a.small | t3a.medium | t3a.large | t3a.xlarge | t3a.2xlarge | t4g.nano | t4g.micro | t4g.small | t4g.medium | t4g.large | t4g.xlarge | t4g.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.8xlarge | r5a.12xlarge | r5a.16xlarge | r5a.24xlarge | r5b.large | r5b.xlarge | r5b.2xlarge | r5b.4xlarge | r5b.8xlarge | r5b.12xlarge | r5b.16xlarge | r5b.24xlarge | r5b.metal | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | r5ad.large | r5ad.xlarge | r5ad.2xlarge | r5ad.4xlarge | r5ad.8xlarge | r5ad.12xlarge | r5ad.16xlarge | r5ad.24xlarge | r6g.metal | r6g.medium | r6g.large | r6g.xlarge | r6g.2xlarge | r6g.4xlarge | r6g.8xlarge | r6g.12xlarge | r6g.16xlarge | r6gd.metal | r6gd.medium | r6gd.large | r6gd.xlarge | r6gd.2xlarge | r6gd.4xlarge | r6gd.8xlarge | r6gd.12xlarge | r6gd.16xlarge | 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 | i3en.large | i3en.xlarge | i3en.2xlarge | i3en.3xlarge | i3en.6xlarge | i3en.12xlarge | i3en.24xlarge | i3en.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.12xlarge | c5.18xlarge | c5.24xlarge | c5.metal | c5a.large | c5a.xlarge | c5a.2xlarge | c5a.4xlarge | c5a.8xlarge | c5a.12xlarge | c5a.16xlarge | c5a.24xlarge | c5ad.large | c5ad.xlarge | c5ad.2xlarge | c5ad.4xlarge | c5ad.8xlarge | c5ad.12xlarge | c5ad.16xlarge | c5ad.24xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.12xlarge | c5d.18xlarge | c5d.24xlarge | c5d.metal | c5n.large | c5n.xlarge | c5n.2xlarge | c5n.4xlarge | c5n.9xlarge | c5n.18xlarge | c5n.metal | c6g.metal | c6g.medium | c6g.large | c6g.xlarge | c6g.2xlarge | c6g.4xlarge | c6g.8xlarge | c6g.12xlarge | c6g.16xlarge | c6gd.metal | c6gd.medium | c6gd.large | c6gd.xlarge | c6gd.2xlarge | c6gd.4xlarge | c6gd.8xlarge | c6gd.12xlarge | c6gd.16xlarge | c6gn.medium | c6gn.large | c6gn.xlarge | c6gn.2xlarge | c6gn.4xlarge | c6gn.8xlarge | c6gn.12xlarge | c6gn.16xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4xlarge | g3.8xlarge | g3.16xlarge | g3s.xlarge | g4ad.xlarge | g4ad.2xlarge | g4ad.4xlarge | g4ad.8xlarge | g4ad.16xlarge | g4dn.xlarge | g4dn.2xlarge | g4dn.4xlarge | g4dn.8xlarge | g4dn.12xlarge | g4dn.16xlarge | g4dn.metal | cg1.4xlarge | p2.xlarge | p2.8xlarge | p2.16xlarge | p3.2xlarge | p3.8xlarge | p3.16xlarge | p3dn.24xlarge | p4d.24xlarge | d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge | d3.xlarge | d3.2xlarge | d3.4xlarge | d3.8xlarge | d3en.xlarge | d3en.2xlarge | d3en.4xlarge | d3en.6xlarge | d3en.8xlarge | d3en.12xlarge | f1.2xlarge | f1.4xlarge | f1.16xlarge | m5.large | m5.xlarge | m5.2xlarge | m5.4xlarge | m5.8xlarge | m5.12xlarge | m5.16xlarge | m5.24xlarge | m5.metal | m5a.large | m5a.xlarge | m5a.2xlarge | m5a.4xlarge | m5a.8xlarge | m5a.12xlarge | m5a.16xlarge | m5a.24xlarge | m5d.large | m5d.xlarge | m5d.2xlarge | m5d.4xlarge | m5d.8xlarge | m5d.12xlarge | m5d.16xlarge | m5d.24xlarge | m5d.metal | m5ad.large | m5ad.xlarge | m5ad.2xlarge | m5ad.4xlarge | m5ad.8xlarge | m5ad.12xlarge | m5ad.16xlarge | m5ad.24xlarge | m5zn.large | m5zn.xlarge | m5zn.2xlarge | m5zn.3xlarge | m5zn.6xlarge | m5zn.12xlarge | m5zn.metal | h1.2xlarge | h1.4xlarge | h1.8xlarge | h1.16xlarge | z1d.large | z1d.xlarge | z1d.2xlarge | z1d.3xlarge | z1d.6xlarge | z1d.12xlarge | z1d.metal | u-6tb1.56xlarge | u-6tb1.112xlarge | u-9tb1.112xlarge | u-12tb1.112xlarge | u-6tb1.metal | u-9tb1.metal | u-12tb1.metal | u-18tb1.metal | u-24tb1.metal | a1.medium | a1.large | a1.xlarge | a1.2xlarge | a1.4xlarge | a1.metal | m5dn.large | m5dn.xlarge | m5dn.2xlarge | m5dn.4xlarge | m5dn.8xlarge | m5dn.12xlarge | m5dn.16xlarge | m5dn.24xlarge | m5dn.metal | m5n.large | m5n.xlarge | m5n.2xlarge | m5n.4xlarge | m5n.8xlarge | m5n.12xlarge | m5n.16xlarge | m5n.24xlarge | m5n.metal | r5dn.large | r5dn.xlarge | r5dn.2xlarge | r5dn.4xlarge | r5dn.8xlarge | r5dn.12xlarge | r5dn.16xlarge | r5dn.24xlarge | r5dn.metal | r5n.large | r5n.xlarge | r5n.2xlarge | r5n.4xlarge | r5n.8xlarge | r5n.12xlarge | r5n.16xlarge | r5n.24xlarge | r5n.metal | inf1.xlarge | inf1.2xlarge | inf1.6xlarge | inf1.24xlarge | m6g.metal | m6g.medium | m6g.large | m6g.xlarge | m6g.2xlarge | m6g.4xlarge | m6g.8xlarge | m6g.12xlarge | m6g.16xlarge | m6gd.metal | m6gd.medium | m6gd.large | m6gd.xlarge | m6gd.2xlarge | m6gd.4xlarge | m6gd.8xlarge | m6gd.12xlarge | m6gd.16xlarge | m6i.large | m6i.xlarge | m6i.2xlarge | m6i.4xlarge | m6i.8xlarge | m6i.12xlarge | m6i.16xlarge | m6i.24xlarge | m6i.32xlarge | mac1.metal | x2gd.medium | x2gd.large | x2gd.xlarge | x2gd.2xlarge | x2gd.4xlarge | x2gd.8xlarge | x2gd.12xlarge | x2gd.16xlarge | x2gd.metal | vt1.3xlarge | vt1.6xlarge | vt1.24xlarge,
      Priority: 'NUMBER_VALUE',
      Weight: 'NUMBER_VALUE'
    },
    /* more items */
  ],
  TotalTargetCapacity: 'NUMBER_VALUE', /* required */
  AllocationStrategy: 'STRING_VALUE',
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  EndDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  InstanceMatchCriteria: open,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  Tenancy: default
};
ec2.createCapacityReservationFleet(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: {})
    • AllocationStrategy — (String)

      The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the prioritized allocation strategy is supported. For more information, see Allocation strategy in the Amazon EC2 User Guide.

      Valid values: prioritized

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.
    • InstanceTypeSpecifications — (Array<map>)

      Information about the instance types for which to reserve the capacity.

      • InstanceType — (String)

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

        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"
        • "t3a.nano"
        • "t3a.micro"
        • "t3a.small"
        • "t3a.medium"
        • "t3a.large"
        • "t3a.xlarge"
        • "t3a.2xlarge"
        • "t4g.nano"
        • "t4g.micro"
        • "t4g.small"
        • "t4g.medium"
        • "t4g.large"
        • "t4g.xlarge"
        • "t4g.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.8xlarge"
        • "r5a.12xlarge"
        • "r5a.16xlarge"
        • "r5a.24xlarge"
        • "r5b.large"
        • "r5b.xlarge"
        • "r5b.2xlarge"
        • "r5b.4xlarge"
        • "r5b.8xlarge"
        • "r5b.12xlarge"
        • "r5b.16xlarge"
        • "r5b.24xlarge"
        • "r5b.metal"
        • "r5d.large"
        • "r5d.xlarge"
        • "r5d.2xlarge"
        • "r5d.4xlarge"
        • "r5d.8xlarge"
        • "r5d.12xlarge"
        • "r5d.16xlarge"
        • "r5d.24xlarge"
        • "r5d.metal"
        • "r5ad.large"
        • "r5ad.xlarge"
        • "r5ad.2xlarge"
        • "r5ad.4xlarge"
        • "r5ad.8xlarge"
        • "r5ad.12xlarge"
        • "r5ad.16xlarge"
        • "r5ad.24xlarge"
        • "r6g.metal"
        • "r6g.medium"
        • "r6g.large"
        • "r6g.xlarge"
        • "r6g.2xlarge"
        • "r6g.4xlarge"
        • "r6g.8xlarge"
        • "r6g.12xlarge"
        • "r6g.16xlarge"
        • "r6gd.metal"
        • "r6gd.medium"
        • "r6gd.large"
        • "r6gd.xlarge"
        • "r6gd.2xlarge"
        • "r6gd.4xlarge"
        • "r6gd.8xlarge"
        • "r6gd.12xlarge"
        • "r6gd.16xlarge"
        • "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"
        • "i3en.large"
        • "i3en.xlarge"
        • "i3en.2xlarge"
        • "i3en.3xlarge"
        • "i3en.6xlarge"
        • "i3en.12xlarge"
        • "i3en.24xlarge"
        • "i3en.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.12xlarge"
        • "c5.18xlarge"
        • "c5.24xlarge"
        • "c5.metal"
        • "c5a.large"
        • "c5a.xlarge"
        • "c5a.2xlarge"
        • "c5a.4xlarge"
        • "c5a.8xlarge"
        • "c5a.12xlarge"
        • "c5a.16xlarge"
        • "c5a.24xlarge"
        • "c5ad.large"
        • "c5ad.xlarge"
        • "c5ad.2xlarge"
        • "c5ad.4xlarge"
        • "c5ad.8xlarge"
        • "c5ad.12xlarge"
        • "c5ad.16xlarge"
        • "c5ad.24xlarge"
        • "c5d.large"
        • "c5d.xlarge"
        • "c5d.2xlarge"
        • "c5d.4xlarge"
        • "c5d.9xlarge"
        • "c5d.12xlarge"
        • "c5d.18xlarge"
        • "c5d.24xlarge"
        • "c5d.metal"
        • "c5n.large"
        • "c5n.xlarge"
        • "c5n.2xlarge"
        • "c5n.4xlarge"
        • "c5n.9xlarge"
        • "c5n.18xlarge"
        • "c5n.metal"
        • "c6g.metal"
        • "c6g.medium"
        • "c6g.large"
        • "c6g.xlarge"
        • "c6g.2xlarge"
        • "c6g.4xlarge"
        • "c6g.8xlarge"
        • "c6g.12xlarge"
        • "c6g.16xlarge"
        • "c6gd.metal"
        • "c6gd.medium"
        • "c6gd.large"
        • "c6gd.xlarge"
        • "c6gd.2xlarge"
        • "c6gd.4xlarge"
        • "c6gd.8xlarge"
        • "c6gd.12xlarge"
        • "c6gd.16xlarge"
        • "c6gn.medium"
        • "c6gn.large"
        • "c6gn.xlarge"
        • "c6gn.2xlarge"
        • "c6gn.4xlarge"
        • "c6gn.8xlarge"
        • "c6gn.12xlarge"
        • "c6gn.16xlarge"
        • "cc1.4xlarge"
        • "cc2.8xlarge"
        • "g2.2xlarge"
        • "g2.8xlarge"
        • "g3.4xlarge"
        • "g3.8xlarge"
        • "g3.16xlarge"
        • "g3s.xlarge"
        • "g4ad.xlarge"
        • "g4ad.2xlarge"
        • "g4ad.4xlarge"
        • "g4ad.8xlarge"
        • "g4ad.16xlarge"
        • "g4dn.xlarge"
        • "g4dn.2xlarge"
        • "g4dn.4xlarge"
        • "g4dn.8xlarge"
        • "g4dn.12xlarge"
        • "g4dn.16xlarge"
        • "g4dn.metal"
        • "cg1.4xlarge"
        • "p2.xlarge"
        • "p2.8xlarge"
        • "p2.16xlarge"
        • "p3.2xlarge"
        • "p3.8xlarge"
        • "p3.16xlarge"
        • "p3dn.24xlarge"
        • "p4d.24xlarge"
        • "d2.xlarge"
        • "d2.2xlarge"
        • "d2.4xlarge"
        • "d2.8xlarge"
        • "d3.xlarge"
        • "d3.2xlarge"
        • "d3.4xlarge"
        • "d3.8xlarge"
        • "d3en.xlarge"
        • "d3en.2xlarge"
        • "d3en.4xlarge"
        • "d3en.6xlarge"
        • "d3en.8xlarge"
        • "d3en.12xlarge"
        • "f1.2xlarge"
        • "f1.4xlarge"
        • "f1.16xlarge"
        • "m5.large"
        • "m5.xlarge"
        • "m5.2xlarge"
        • "m5.4xlarge"
        • "m5.8xlarge"
        • "m5.12xlarge"
        • "m5.16xlarge"
        • "m5.24xlarge"
        • "m5.metal"
        • "m5a.large"
        • "m5a.xlarge"
        • "m5a.2xlarge"
        • "m5a.4xlarge"
        • "m5a.8xlarge"
        • "m5a.12xlarge"
        • "m5a.16xlarge"
        • "m5a.24xlarge"
        • "m5d.large"
        • "m5d.xlarge"
        • "m5d.2xlarge"
        • "m5d.4xlarge"
        • "m5d.8xlarge"
        • "m5d.12xlarge"
        • "m5d.16xlarge"
        • "m5d.24xlarge"
        • "m5d.metal"
        • "m5ad.large"
        • "m5ad.xlarge"
        • "m5ad.2xlarge"
        • "m5ad.4xlarge"
        • "m5ad.8xlarge"
        • "m5ad.12xlarge"
        • "m5ad.16xlarge"
        • "m5ad.24xlarge"
        • "m5zn.large"
        • "m5zn.xlarge"
        • "m5zn.2xlarge"
        • "m5zn.3xlarge"
        • "m5zn.6xlarge"
        • "m5zn.12xlarge"
        • "m5zn.metal"
        • "h1.2xlarge"
        • "h1.4xlarge"
        • "h1.8xlarge"
        • "h1.16xlarge"
        • "z1d.large"
        • "z1d.xlarge"
        • "z1d.2xlarge"
        • "z1d.3xlarge"
        • "z1d.6xlarge"
        • "z1d.12xlarge"
        • "z1d.metal"
        • "u-6tb1.56xlarge"
        • "u-6tb1.112xlarge"
        • "u-9tb1.112xlarge"
        • "u-12tb1.112xlarge"
        • "u-6tb1.metal"
        • "u-9tb1.metal"
        • "u-12tb1.metal"
        • "u-18tb1.metal"
        • "u-24tb1.metal"
        • "a1.medium"
        • "a1.large"
        • "a1.xlarge"
        • "a1.2xlarge"
        • "a1.4xlarge"
        • "a1.metal"
        • "m5dn.large"
        • "m5dn.xlarge"
        • "m5dn.2xlarge"
        • "m5dn.4xlarge"
        • "m5dn.8xlarge"
        • "m5dn.12xlarge"
        • "m5dn.16xlarge"
        • "m5dn.24xlarge"
        • "m5dn.metal"
        • "m5n.large"
        • "m5n.xlarge"
        • "m5n.2xlarge"
        • "m5n.4xlarge"
        • "m5n.8xlarge"
        • "m5n.12xlarge"
        • "m5n.16xlarge"
        • "m5n.24xlarge"
        • "m5n.metal"
        • "r5dn.large"
        • "r5dn.xlarge"
        • "r5dn.2xlarge"
        • "r5dn.4xlarge"
        • "r5dn.8xlarge"
        • "r5dn.12xlarge"
        • "r5dn.16xlarge"
        • "r5dn.24xlarge"
        • "r5dn.metal"
        • "r5n.large"
        • "r5n.xlarge"
        • "r5n.2xlarge"
        • "r5n.4xlarge"
        • "r5n.8xlarge"
        • "r5n.12xlarge"
        • "r5n.16xlarge"
        • "r5n.24xlarge"
        • "r5n.metal"
        • "inf1.xlarge"
        • "inf1.2xlarge"
        • "inf1.6xlarge"
        • "inf1.24xlarge"
        • "m6g.metal"
        • "m6g.medium"
        • "m6g.large"
        • "m6g.xlarge"
        • "m6g.2xlarge"
        • "m6g.4xlarge"
        • "m6g.8xlarge"
        • "m6g.12xlarge"
        • "m6g.16xlarge"
        • "m6gd.metal"
        • "m6gd.medium"
        • "m6gd.large"
        • "m6gd.xlarge"
        • "m6gd.2xlarge"
        • "m6gd.4xlarge"
        • "m6gd.8xlarge"
        • "m6gd.12xlarge"
        • "m6gd.16xlarge"
        • "m6i.large"
        • "m6i.xlarge"
        • "m6i.2xlarge"
        • "m6i.4xlarge"
        • "m6i.8xlarge"
        • "m6i.12xlarge"
        • "m6i.16xlarge"
        • "m6i.24xlarge"
        • "m6i.32xlarge"
        • "mac1.metal"
        • "x2gd.medium"
        • "x2gd.large"
        • "x2gd.xlarge"
        • "x2gd.2xlarge"
        • "x2gd.4xlarge"
        • "x2gd.8xlarge"
        • "x2gd.12xlarge"
        • "x2gd.16xlarge"
        • "x2gd.metal"
        • "vt1.3xlarge"
        • "vt1.6xlarge"
        • "vt1.24xlarge"
      • InstancePlatform — (String)

        The type of operating system for which the Capacity Reservation Fleet 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"
        • "Linux with SQL Server Standard"
        • "Linux with SQL Server Web"
        • "Linux with SQL Server Enterprise"
      • Weight — (Float)

        The number of capacity units provided by the specified instance type. This value, together with the total target capacity that you specify for the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see Total target capacity in the Amazon EC2 User Guide.

      • AvailabilityZone — (String)

        The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same Availability Zone.

      • AvailabilityZoneId — (String)

        The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same Availability Zone.

      • EbsOptimized — (Boolean)

        Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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 EBS-optimized instance types.

      • Priority — (Integer)

        The priority to assign to the instance type. This value is used to determine which of the instance types specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more information, see Instance type priority in the Amazon EC2 User Guide.

    • Tenancy — (String)

      Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings:

      • default - The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web Services accounts.

      • dedicated - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single Amazon Web Services account.

      Possible values include:
      • "default"
    • TotalTargetCapacity — (Integer)

      The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see Total target capacity in the Amazon EC2 User Guide.

    • EndDate — (Date)

      The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to expired and all of the Capacity Reservations in the Fleet expire.

      The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019.

    • InstanceMatchCriteria — (String)

      Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria.

      Currently, Capacity Reservation Fleets support open instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.

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

      The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • CapacityReservationFleetId — (String)

        The ID of the Capacity Reservation Fleet.

      • State — (String)

        The status of the Capacity Reservation Fleet.

        Possible values include:
        • "submitted"
        • "modifying"
        • "active"
        • "partially_fulfilled"
        • "expiring"
        • "expired"
        • "cancelling"
        • "cancelled"
        • "failed"
      • TotalTargetCapacity — (Integer)

        The total number of capacity units for which the Capacity Reservation Fleet reserves capacity.

      • TotalFulfilledCapacity — (Float)

        The requested capacity units that have been successfully reserved.

      • InstanceMatchCriteria — (String)

        The instance matching criteria for the Capacity Reservation Fleet.

        Possible values include:
        • "open"
      • AllocationStrategy — (String)

        The allocation strategy used by the Capacity Reservation Fleet.

      • CreateTime — (Date)

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

      • EndDate — (Date)

        The date and time at which the Capacity Reservation Fleet expires.

      • Tenancy — (String)

        Indicates the tenancy of Capacity Reservation Fleet.

        Possible values include:
        • "default"
      • FleetCapacityReservations — (Array<map>)

        Information about the individual Capacity Reservations in the Capacity Reservation Fleet.

        • CapacityReservationId — (String)

          The ID of the Capacity Reservation.

        • AvailabilityZoneId — (String)

          The ID of the Availability Zone in which the Capacity Reservation reserves capacity.

        • InstanceType — (String)

          The instance type for which the Capacity Reservation reserves capacity.

          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"
          • "t3a.nano"
          • "t3a.micro"
          • "t3a.small"
          • "t3a.medium"
          • "t3a.large"
          • "t3a.xlarge"
          • "t3a.2xlarge"
          • "t4g.nano"
          • "t4g.micro"
          • "t4g.small"
          • "t4g.medium"
          • "t4g.large"
          • "t4g.xlarge"
          • "t4g.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.8xlarge"
          • "r5a.12xlarge"
          • "r5a.16xlarge"
          • "r5a.24xlarge"
          • "r5b.large"
          • "r5b.xlarge"
          • "r5b.2xlarge"
          • "r5b.4xlarge"
          • "r5b.8xlarge"
          • "r5b.12xlarge"
          • "r5b.16xlarge"
          • "r5b.24xlarge"
          • "r5b.metal"
          • "r5d.large"
          • "r5d.xlarge"
          • "r5d.2xlarge"
          • "r5d.4xlarge"
          • "r5d.8xlarge"
          • "r5d.12xlarge"
          • "r5d.16xlarge"
          • "r5d.24xlarge"
          • "r5d.metal"
          • "r5ad.large"
          • "r5ad.xlarge"
          • "r5ad.2xlarge"
          • "r5ad.4xlarge"
          • "r5ad.8xlarge"
          • "r5ad.12xlarge"
          • "r5ad.16xlarge"
          • "r5ad.24xlarge"
          • "r6g.metal"
          • "r6g.medium"
          • "r6g.large"
          • "r6g.xlarge"
          • "r6g.2xlarge"
          • "r6g.4xlarge"
          • "r6g.8xlarge"
          • "r6g.12xlarge"
          • "r6g.16xlarge"
          • "r6gd.metal"
          • "r6gd.medium"
          • "r6gd.large"
          • "r6gd.xlarge"
          • "r6gd.2xlarge"
          • "r6gd.4xlarge"
          • "r6gd.8xlarge"
          • "r6gd.12xlarge"
          • "r6gd.16xlarge"
          • "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"
          • "i3en.large"
          • "i3en.xlarge"
          • "i3en.2xlarge"
          • "i3en.3xlarge"
          • "i3en.6xlarge"
          • "i3en.12xlarge"
          • "i3en.24xlarge"
          • "i3en.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.12xlarge"
          • "c5.18xlarge"
          • "c5.24xlarge"
          • "c5.metal"
          • "c5a.large"
          • "c5a.xlarge"
          • "c5a.2xlarge"
          • "c5a.4xlarge"
          • "c5a.8xlarge"
          • "c5a.12xlarge"
          • "c5a.16xlarge"
          • "c5a.24xlarge"
          • "c5ad.large"
          • "c5ad.xlarge"
          • "c5ad.2xlarge"
          • "c5ad.4xlarge"
          • "c5ad.8xlarge"
          • "c5ad.12xlarge"
          • "c5ad.16xlarge"
          • "c5ad.24xlarge"
          • "c5d.large"
          • "c5d.xlarge"
          • "c5d.2xlarge"
          • "c5d.4xlarge"
          • "c5d.9xlarge"
          • "c5d.12xlarge"
          • "c5d.18xlarge"
          • "c5d.24xlarge"
          • "c5d.metal"
          • "c5n.large"
          • "c5n.xlarge"
          • "c5n.2xlarge"
          • "c5n.4xlarge"
          • "c5n.9xlarge"
          • "c5n.18xlarge"
          • "c5n.metal"
          • "c6g.metal"
          • "c6g.medium"
          • "c6g.large"
          • "c6g.xlarge"
          • "c6g.2xlarge"
          • "c6g.4xlarge"
          • "c6g.8xlarge"
          • "c6g.12xlarge"
          • "c6g.16xlarge"
          • "c6gd.metal"
          • "c6gd.medium"
          • "c6gd.large"
          • "c6gd.xlarge"
          • "c6gd.2xlarge"
          • "c6gd.4xlarge"
          • "c6gd.8xlarge"
          • "c6gd.12xlarge"
          • "c6gd.16xlarge"
          • "c6gn.medium"
          • "c6gn.large"
          • "c6gn.xlarge"
          • "c6gn.2xlarge"
          • "c6gn.4xlarge"
          • "c6gn.8xlarge"
          • "c6gn.12xlarge"
          • "c6gn.16xlarge"
          • "cc1.4xlarge"
          • "cc2.8xlarge"
          • "g2.2xlarge"
          • "g2.8xlarge"
          • "g3.4xlarge"
          • "g3.8xlarge"
          • "g3.16xlarge"
          • "g3s.xlarge"
          • "g4ad.xlarge"
          • "g4ad.2xlarge"
          • "g4ad.4xlarge"
          • "g4ad.8xlarge"
          • "g4ad.16xlarge"
          • "g4dn.xlarge"
          • "g4dn.2xlarge"
          • "g4dn.4xlarge"
          • "g4dn.8xlarge"
          • "g4dn.12xlarge"
          • "g4dn.16xlarge"
          • "g4dn.metal"
          • "cg1.4xlarge"
          • "p2.xlarge"
          • "p2.8xlarge"
          • "p2.16xlarge"
          • "p3.2xlarge"
          • "p3.8xlarge"
          • "p3.16xlarge"
          • "p3dn.24xlarge"
          • "p4d.24xlarge"
          • "d2.xlarge"
          • "d2.2xlarge"
          • "d2.4xlarge"
          • "d2.8xlarge"
          • "d3.xlarge"
          • "d3.2xlarge"
          • "d3.4xlarge"
          • "d3.8xlarge"
          • "d3en.xlarge"
          • "d3en.2xlarge"
          • "d3en.4xlarge"
          • "d3en.6xlarge"
          • "d3en.8xlarge"
          • "d3en.12xlarge"
          • "f1.2xlarge"
          • "f1.4xlarge"
          • "f1.16xlarge"
          • "m5.large"
          • "m5.xlarge"
          • "m5.2xlarge"
          • "m5.4xlarge"
          • "m5.8xlarge"
          • "m5.12xlarge"
          • "m5.16xlarge"
          • "m5.24xlarge"
          • "m5.metal"
          • "m5a.large"
          • "m5a.xlarge"
          • "m5a.2xlarge"
          • "m5a.4xlarge"
          • "m5a.8xlarge"
          • "m5a.12xlarge"
          • "m5a.16xlarge"
          • "m5a.24xlarge"
          • "m5d.large"
          • "m5d.xlarge"
          • "m5d.2xlarge"
          • "m5d.4xlarge"
          • "m5d.8xlarge"
          • "m5d.12xlarge"
          • "m5d.16xlarge"
          • "m5d.24xlarge"
          • "m5d.metal"
          • "m5ad.large"
          • "m5ad.xlarge"
          • "m5ad.2xlarge"
          • "m5ad.4xlarge"
          • "m5ad.8xlarge"
          • "m5ad.12xlarge"
          • "m5ad.16xlarge"
          • "m5ad.24xlarge"
          • "m5zn.large"
          • "m5zn.xlarge"
          • "m5zn.2xlarge"
          • "m5zn.3xlarge"
          • "m5zn.6xlarge"
          • "m5zn.12xlarge"
          • "m5zn.metal"
          • "h1.2xlarge"
          • "h1.4xlarge"
          • "h1.8xlarge"
          • "h1.16xlarge"
          • "z1d.large"
          • "z1d.xlarge"
          • "z1d.2xlarge"
          • "z1d.3xlarge"
          • "z1d.6xlarge"
          • "z1d.12xlarge"
          • "z1d.metal"
          • "u-6tb1.56xlarge"
          • "u-6tb1.112xlarge"
          • "u-9tb1.112xlarge"
          • "u-12tb1.112xlarge"
          • "u-6tb1.metal"
          • "u-9tb1.metal"
          • "u-12tb1.metal"
          • "u-18tb1.metal"
          • "u-24tb1.metal"
          • "a1.medium"
          • "a1.large"
          • "a1.xlarge"
          • "a1.2xlarge"
          • "a1.4xlarge"
          • "a1.metal"
          • "m5dn.large"
          • "m5dn.xlarge"
          • "m5dn.2xlarge"
          • "m5dn.4xlarge"
          • "m5dn.8xlarge"
          • "m5dn.12xlarge"
          • "m5dn.16xlarge"
          • "m5dn.24xlarge"
          • "m5dn.metal"
          • "m5n.large"
          • "m5n.xlarge"
          • "m5n.2xlarge"
          • "m5n.4xlarge"
          • "m5n.8xlarge"
          • "m5n.12xlarge"
          • "m5n.16xlarge"
          • "m5n.24xlarge"
          • "m5n.metal"
          • "r5dn.large"
          • "r5dn.xlarge"
          • "r5dn.2xlarge"
          • "r5dn.4xlarge"
          • "r5dn.8xlarge"
          • "r5dn.12xlarge"
          • "r5dn.16xlarge"
          • "r5dn.24xlarge"
          • "r5dn.metal"
          • "r5n.large"
          • "r5n.xlarge"
          • "r5n.2xlarge"
          • "r5n.4xlarge"
          • "r5n.8xlarge"
          • "r5n.12xlarge"
          • "r5n.16xlarge"
          • "r5n.24xlarge"
          • "r5n.metal"
          • "inf1.xlarge"
          • "inf1.2xlarge"
          • "inf1.6xlarge"
          • "inf1.24xlarge"
          • "m6g.metal"
          • "m6g.medium"
          • "m6g.large"
          • "m6g.xlarge"
          • "m6g.2xlarge"
          • "m6g.4xlarge"
          • "m6g.8xlarge"
          • "m6g.12xlarge"
          • "m6g.16xlarge"
          • "m6gd.metal"
          • "m6gd.medium"
          • "m6gd.large"
          • "m6gd.xlarge"
          • "m6gd.2xlarge"
          • "m6gd.4xlarge"
          • "m6gd.8xlarge"
          • "m6gd.12xlarge"
          • "m6gd.16xlarge"
          • "m6i.large"
          • "m6i.xlarge"
          • "m6i.2xlarge"
          • "m6i.4xlarge"
          • "m6i.8xlarge"
          • "m6i.12xlarge"
          • "m6i.16xlarge"
          • "m6i.24xlarge"
          • "m6i.32xlarge"
          • "mac1.metal"
          • "x2gd.medium"
          • "x2gd.large"
          • "x2gd.xlarge"
          • "x2gd.2xlarge"
          • "x2gd.4xlarge"
          • "x2gd.8xlarge"
          • "x2gd.12xlarge"
          • "x2gd.16xlarge"
          • "x2gd.metal"
          • "vt1.3xlarge"
          • "vt1.6xlarge"
          • "vt1.24xlarge"
        • 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"
          • "Linux with SQL Server Standard"
          • "Linux with SQL Server Web"
          • "Linux with SQL Server Enterprise"
        • AvailabilityZone — (String)

          The Availability Zone in which the Capacity Reservation reserves capacity.

        • TotalInstanceCount — (Integer)

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

        • FulfilledCapacity — (Float)

          The number of capacity units fulfilled by the Capacity Reservation. For more information, see Total target capacity in the Amazon EC2 User Guide.

        • EbsOptimized — (Boolean)

          Indicates whether the Capacity Reservation reserves capacity for EBS-optimized instance types.

        • CreateDate — (Date)

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

        • Weight — (Float)

          The weight of the instance type in the Capacity Reservation Fleet. For more information, see Instance type weight in the Amazon EC2 User Guide.

        • Priority — (Integer)

          The priority of the instance type in the Capacity Reservation Fleet. For more information, see Instance type priority in the Amazon EC2 User Guide.

      • Tags — (Array<map>)

        The tags assigned to the Capacity Reservation Fleet.

        • 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.

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

Creates a carrier gateway. For more information about carrier gateways, see Carrier gateways in the Amazon Web Services Wavelength Developer Guide.

Service Reference:

Examples:

Calling the createCarrierGateway operation

var params = {
  VpcId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  DryRun: true || false,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
ec2.createCarrierGateway(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 to associate with the carrier gateway.

    • TagSpecifications — (Array<map>)

      The tags to associate with the carrier gateway.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.

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:

      • CarrierGateway — (map)

        Information about the carrier gateway.

        • CarrierGatewayId — (String)

          The ID of the carrier gateway.

        • VpcId — (String)

          The ID of the VPC associated with the carrier gateway.

        • State — (String)

          The state of the carrier gateway.

          Possible values include:
          • "pending"
          • "available"
          • "deleting"
          • "deleted"
        • OwnerId — (String)

          The Amazon Web Services account ID of the owner of the carrier gateway.

        • Tags — (Array<map>)

          The tags assigned to the carrier 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.

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

Creates a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.

Service Reference:

Examples:

Calling the createClientVpnEndpoint operation

var params = {
  AuthenticationOptions: [ /* required */
    {
      ActiveDirectory: {
        DirectoryId: 'STRING_VALUE'
      },
      FederatedAuthentication: {
        SAMLProviderArn: 'STRING_VALUE',
        SelfServiceSAMLProviderArn: 'STRING_VALUE'
      },
      MutualAuthentication: {
        ClientRootCertificateChainArn: 'STRING_VALUE'
      },
      Type: certificate-authentication | directory-service-authentication | federated-authentication
    },
    /* more items */
  ],
  ClientCidrBlock: 'STRING_VALUE', /* required */
  ConnectionLogOptions: { /* required */
    CloudwatchLogGroup: 'STRING_VALUE',
    CloudwatchLogStream: 'STRING_VALUE',
    Enabled: true || false
  },
  ServerCertificateArn: 'STRING_VALUE', /* required */
  ClientConnectOptions: {
    Enabled: true || false,
    LambdaFunctionArn: 'STRING_VALUE'
  },
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DnsServers: [
    'STRING_VALUE',
    /* more items */
  ],
  DryRun: true || false,
  SecurityGroupIds: [
    'STRING_VALUE',
    /* more items */
  ],
  SelfServicePortal: enabled | disabled,
  SplitTunnel: true || false,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  TransportProtocol: tcp | udp,
  VpcId: 'STRING_VALUE',
  VpnPort: 'NUMBER_VALUE'
};
ec2.createClientVpnEndpoint(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: {})
    • ClientCidrBlock — (String)

      The IPv4 address range, in CIDR notation, from which to assign client IP addresses. The address range cannot overlap with the local CIDR of the VPC in which the associated subnet is located, or the routes that you add manually. The address range cannot be changed after the Client VPN endpoint has been created. The CIDR block should be /22 or greater.

    • ServerCertificateArn — (String)

      The ARN of the server certificate. For more information, see the Certificate Manager User Guide.

    • AuthenticationOptions — (Array<map>)

      Information about the authentication method to be used to authenticate clients.

      • Type — (String)

        The type of client authentication to be used.

        Possible values include:
        • "certificate-authentication"
        • "directory-service-authentication"
        • "federated-authentication"
      • ActiveDirectory — (map)

        Information about the Active Directory to be used, if applicable. You must provide this information if Type is directory-service-authentication.

        • DirectoryId — (String)

          The ID of the Active Directory to be used for authentication.

      • MutualAuthentication — (map)

        Information about the authentication certificates to be used, if applicable. You must provide this information if Type is certificate-authentication.

        • ClientRootCertificateChainArn — (String)

          The ARN of the client certificate. The certificate must be signed by a certificate authority (CA) and it must be provisioned in Certificate Manager (ACM).

      • FederatedAuthentication — (map)

        Information about the IAM SAML identity provider to be used, if applicable. You must provide this information if Type is federated-authentication.

        • SAMLProviderArn — (String)

          The Amazon Resource Name (ARN) of the IAM SAML identity provider.

        • SelfServiceSAMLProviderArn — (String)

          The Amazon Resource Name (ARN) of the IAM SAML identity provider for the self-service portal.

    • ConnectionLogOptions — (map)

      Information about the client connection logging options.

      If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:

      • Client connection requests

      • Client connection results (successful and unsuccessful)

      • Reasons for unsuccessful client connection requests

      • Client connection termination time

      • Enabled — (Boolean)

        Indicates whether connection logging is enabled.

      • CloudwatchLogGroup — (String)

        The name of the CloudWatch Logs log group. Required if connection logging is enabled.

      • CloudwatchLogStream — (String)

        The name of the CloudWatch Logs log stream to which the connection data is published.

    • DnsServers — (Array<String>)

      Information about the DNS servers to be used for DNS resolution. A Client VPN endpoint can have up to two DNS servers. If no DNS server is specified, the DNS address configured on the device is used for the DNS server.

    • TransportProtocol — (String)

      The transport protocol to be used by the VPN session.

      Default value: udp

      Possible values include:
      • "tcp"
      • "udp"
    • VpnPort — (Integer)

      The port number to assign to the Client VPN endpoint for TCP and UDP traffic.

      Valid Values: 443 | 1194

      Default Value: 443

    • Description — (String)

      A brief description of the Client VPN endpoint.

    • SplitTunnel — (Boolean)

      Indicates whether split-tunnel is enabled on the Client VPN endpoint.

      By default, split-tunnel on a VPN endpoint is disabled.

      For information about split-tunnel VPN endpoints, see Split-tunnel Client VPN endpoint in the Client VPN Administrator Guide.

    • 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.

      If a token is not provided, the SDK will use a version 4 UUID.
    • TagSpecifications — (Array<map>)

      The tags to apply to the Client VPN endpoint during creation.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • SecurityGroupIds — (Array<String>)

      The IDs of one or more security groups to apply to the target network. You must also specify the ID of the VPC that contains the security groups.

    • VpcId — (String)

      The ID of the VPC to associate with the Client VPN endpoint. If no security group IDs are specified in the request, the default security group for the VPC is applied.

    • SelfServicePortal — (String)

      Specify whether to enable the self-service portal for the Client VPN endpoint.

      Default Value: enabled

      Possible values include:
      • "enabled"
      • "disabled"
    • ClientConnectOptions — (map)

      The options for managing connection authorization for new client connections.

      • Enabled — (Boolean)

        Indicates whether client connect options are enabled. The default is false (not enabled).

      • LambdaFunctionArn — (String)

        The Amazon Resource Name (ARN) of the Lambda function used for connection authorization.

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:

      • ClientVpnEndpointId — (String)

        The ID of the Client VPN endpoint.

      • Status — (map)

        The current state of the Client VPN endpoint.

        • Code — (String)

          The state of the Client VPN endpoint. Possible states include:

          • pending-associate - The Client VPN endpoint has been created but no target networks have been associated. The Client VPN endpoint cannot accept connections.

          • available - The Client VPN endpoint has been created and a target network has been associated. The Client VPN endpoint can accept connections.

          • deleting - The Client VPN endpoint is being deleted. The Client VPN endpoint cannot accept connections.

          • deleted - The Client VPN endpoint has been deleted. The Client VPN endpoint cannot accept connections.

          Possible values include:
          • "pending-associate"
          • "available"
          • "deleting"
          • "deleted"
        • Message — (String)

          A message about the status of the Client VPN endpoint.

      • DnsName — (String)

        The DNS name to be used by clients when establishing their VPN session.

Returns:

  • (AWS.Request)

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

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

Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the available destination network routes. Each route in the route table specifies the path for traffic to specific resources or networks.

Service Reference:

Examples:

Calling the createClientVpnRoute operation

var params = {
  ClientVpnEndpointId: 'STRING_VALUE', /* required */
  DestinationCidrBlock: 'STRING_VALUE', /* required */
  TargetVpcSubnetId: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  DryRun: true || false
};
ec2.createClientVpnRoute(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: {})
    • ClientVpnEndpointId — (String)

      The ID of the Client VPN endpoint to which to add the route.

    • DestinationCidrBlock — (String)

      The IPv4 address range, in CIDR notation, of the route destination. For example:

      • To add a route for Internet access, enter 0.0.0.0/0

      • To add a route for a peered VPC, enter the peered VPC's IPv4 CIDR range

      • To add a route for an on-premises network, enter the Amazon Web Services Site-to-Site VPN connection's IPv4 CIDR range

      • To add a route for the local network, enter the client CIDR range

    • TargetVpcSubnetId — (String)

      The ID of the subnet through which you want to route traffic. The specified subnet must be an existing target network of the Client VPN endpoint.

      Alternatively, if you're adding a route for the local network, specify local.

    • Description — (String)

      A brief description of the route.

    • ClientToken — (String)

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

      If a token is not provided, the SDK will use a version 4 UUID.
    • 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:

      • Status — (map)

        The current state of the route.

        • Code — (String)

          The state of the Client VPN endpoint route.

          Possible values include:
          • "creating"
          • "active"
          • "failed"
          • "deleting"
        • Message — (String)

          A message about the status of the Client VPN endpoint route, if applicable.

Returns:

  • (AWS.Request)

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

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

Provides information to Amazon Web Services about your VPN customer gateway device. The customer gateway is the appliance at your end of the VPN connection. (The device on the Amazon Web Services 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 can 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 4-byte ASN numbers in the range of 1 - 2147483647, with the exception of the following:
  • 7224 - reserved in the us-east-1 Region
  • 9059 - reserved in the eu-west-1 Region
  • 17943 - reserved in the ap-southeast-1 Region
  • 10124 - reserved in the ap-northeast-1 Region

For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.

To create more than one customer gateway with the same VPN type, IP address, and BGP ASN, specify a unique device name for each customer gateway. Identical requests return information about the existing customer gateway and do not create new customer gateways.

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: 'NUMBER_VALUE', /* required */
  Type: ipsec.1, /* required */
  CertificateArn: 'STRING_VALUE',
  DeviceName: 'STRING_VALUE',
  DryRun: true || false,
  PublicIp: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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.

    • CertificateArn — (String)

      The Amazon Resource Name (ARN) for the customer gateway certificate.

    • Type — (String)

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

      Possible values include:
      • "ipsec.1"
    • TagSpecifications — (Array<map>)

      The tags to apply to the customer gateway.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • DeviceName — (String)

      A name for the customer gateway device.

      Length Constraints: Up to 255 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:

      • 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.

        • CertificateArn — (String)

          The Amazon Resource Name (ARN) for the customer gateway certificate.

        • 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).

        • DeviceName — (String)

          The name of customer gateway device.

        • 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.

        • AvailabilityZoneId — (String)

          The AZ ID 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.

        • MapCustomerOwnedIpOnLaunch — (Boolean)

          Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives a customer-owned IPv4 address.

        • CustomerOwnedIpv4Pool — (String)

          The customer-owned IPv4 address pool associated with the subnet.

        • 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.

        • OwnerId — (String)

          The ID of the Amazon Web Services account that owns the subnet.

        • 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.

        • SubnetArn — (String)

          The Amazon Resource Name (ARN) of the subnet.

        • OutpostArn — (String)

          The Amazon Resource Name (ARN) of the Outpost.

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.

        • State — (String)

          The current state of the VPC.

          Possible values include:
          • "pending"
          • "available"
        • VpcId — (String)

          The ID of the VPC.

        • OwnerId — (String)

          The ID of the Amazon Web Services account that owns 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.

          • NetworkBorderGroup — (String)

            The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1.

          • Ipv6Pool — (String)

            The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.

        • 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. To have your instance 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, ExampleCompany.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,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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>)
    • TagSpecifications — (Array<map>)

      The tags to assign to the DHCP option.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • 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.

        • OwnerId — (String)

          The ID of the Amazon Web Services account that owns the DHCP options set.

        • 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,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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.

    • TagSpecifications — (Array<map>)

      The tags to assign to the egress-only internet gateway.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • 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.

        • Tags — (Array<map>)

          The tags assigned to the egress-only 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.

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 EC2 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 | t3a.nano | t3a.micro | t3a.small | t3a.medium | t3a.large | t3a.xlarge | t3a.2xlarge | t4g.nano | t4g.micro | t4g.small | t4g.medium | t4g.large | t4g.xlarge | t4g.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.8xlarge | r5a.12xlarge | r5a.16xlarge | r5a.24xlarge | r5b.large | r5b.xlarge | r5b.2xlarge | r5b.4xlarge | r5b.8xlarge | r5b.12xlarge | r5b.16xlarge | r5b.24xlarge | r5b.metal | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | r5ad.large | r5ad.xlarge | r5ad.2xlarge | r5ad.4xlarge | r5ad.8xlarge | r5ad.12xlarge | r5ad.16xlarge | r5ad.24xlarge | r6g.metal | r6g.medium | r6g.large | r6g.xlarge | r6g.2xlarge | r6g.4xlarge | r6g.8xlarge | r6g.12xlarge | r6g.16xlarge | r6gd.metal | r6gd.medium | r6gd.large | r6gd.xlarge | r6gd.2xlarge | r6gd.4xlarge | r6gd.8xlarge | r6gd.12xlarge | r6gd.16xlarge | 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 | i3en.large | i3en.xlarge | i3en.2xlarge | i3en.3xlarge | i3en.6xlarge | i3en.12xlarge | i3en.24xlarge | i3en.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.12xlarge | c5.18xlarge | c5.24xlarge | c5.metal | c5a.large | c5a.xlarge | c5a.2xlarge | c5a.4xlarge | c5a.8xlarge | c5a.12xlarge | c5a.16xlarge | c5a.24xlarge | c5ad.large | c5ad.xlarge | c5ad.2xlarge | c5ad.4xlarge | c5ad.8xlarge | c5ad.12xlarge | c5ad.16xlarge | c5ad.24xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.12xlarge | c5d.18xlarge | c5d.24xlarge | c5d.metal | c5n.large | c5n.xlarge | c5n.2xlarge | c5n.4xlarge | c5n.9xlarge | c5n.18xlarge | c5n.metal | c6g.metal | c6g.medium | c6g.large | c6g.xlarge | c6g.2xlarge | c6g.4xlarge | c6g.8xlarge | c6g.12xlarge | c6g.16xlarge | c6gd.metal | c6gd.medium | c6gd.large | c6gd.xlarge | c6gd.2xlarge | c6gd.4xlarge | c6gd.8xlarge | c6gd.12xlarge | c6gd.16xlarge | c6gn.medium | c6gn.large | c6gn.xlarge | c6gn.2xlarge | c6gn.4xlarge | c6gn.8xlarge | c6gn.12xlarge | c6gn.16xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4xlarge | g3.8xlarge | g3.16xlarge | g3s.xlarge | g4ad.xlarge | g4ad.2xlarge | g4ad.4xlarge | g4ad.8xlarge | g4ad.16xlarge | g4dn.xlarge | g4dn.2xlarge | g4dn.4xlarge | g4dn.8xlarge | g4dn.12xlarge | g4dn.16xlarge | g4dn.metal | cg1.4xlarge | p2.xlarge | p2.8xlarge | p2.16xlarge | p3.2xlarge | p3.8xlarge | p3.16xlarge | p3dn.24xlarge | p4d.24xlarge | d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge | d3.xlarge | d3.2xlarge | d3.4xlarge | d3.8xlarge | d3en.xlarge | d3en.2xlarge | d3en.4xlarge | d3en.6xlarge | d3en.8xlarge | d3en.12xlarge | f1.2xlarge | f1.4xlarge | f1.16xlarge | m5.large | m5.xlarge | m5.2xlarge | m5.4xlarge | m5.8xlarge | m5.12xlarge | m5.16xlarge | m5.24xlarge | m5.metal | m5a.large | m5a.xlarge | m5a.2xlarge | m5a.4xlarge | m5a.8xlarge | m5a.12xlarge | m5a.16xlarge | m5a.24xlarge | m5d.large | m5d.xlarge | m5d.2xlarge | m5d.4xlarge | m5d.8xlarge | m5d.12xlarge | m5d.16xlarge | m5d.24xlarge | m5d.metal | m5ad.large | m5ad.xlarge | m5ad.2xlarge | m5ad.4xlarge | m5ad.8xlarge | m5ad.12xlarge | m5ad.16xlarge | m5ad.24xlarge | m5zn.large | m5zn.xlarge | m5zn.2xlarge | m5zn.3xlarge | m5zn.6xlarge | m5zn.12xlarge | m5zn.metal | h1.2xlarge | h1.4xlarge | h1.8xlarge | h1.16xlarge | z1d.large | z1d.xlarge | z1d.2xlarge | z1d.3xlarge | z1d.6xlarge | z1d.12xlarge | z1d.metal | u-6tb1.56xlarge | u-6tb1.112xlarge | u-9tb1.112xlarge | u-12tb1.112xlarge | u-6tb1.metal | u-9tb1.metal | u-12tb1.metal | u-18tb1.metal | u-24tb1.metal | a1.medium | a1.large | a1.xlarge | a1.2xlarge | a1.4xlarge | a1.metal | m5dn.large | m5dn.xlarge | m5dn.2xlarge | m5dn.4xlarge | m5dn.8xlarge | m5dn.12xlarge | m5dn.16xlarge | m5dn.24xlarge | m5dn.metal | m5n.large | m5n.xlarge | m5n.2xlarge | m5n.4xlarge | m5n.8xlarge | m5n.12xlarge | m5n.16xlarge | m5n.24xlarge | m5n.metal | r5dn.large | r5dn.xlarge | r5dn.2xlarge | r5dn.4xlarge | r5dn.8xlarge | r5dn.12xlarge | r5dn.16xlarge | r5dn.24xlarge | r5dn.metal | r5n.large | r5n.xlarge | r5n.2xlarge | r5n.4xlarge | r5n.8xlarge | r5n.12xlarge | r5n.16xlarge | r5n.24xlarge | r5n.metal | inf1.xlarge | inf1.2xlarge | inf1.6xlarge | inf1.24xlarge | m6g.metal | m6g.medium | m6g.large | m6g.xlarge | m6g.2xlarge | m6g.4xlarge | m6g.8xlarge | m6g.12xlarge | m6g.16xlarge | m6gd.metal | m6gd.medium | m6gd.large | m6gd.xlarge | m6gd.2xlarge | m6gd.4xlarge | m6gd.8xlarge | m6gd.12xlarge | m6gd.16xlarge | m6i.large | m6i.xlarge | m6i.2xlarge | m6i.4xlarge | m6i.8xlarge | m6i.12xlarge | m6i.16xlarge | m6i.24xlarge | m6i.32xlarge | mac1.metal | x2gd.medium | x2gd.large | x2gd.xlarge | x2gd.2xlarge | x2gd.4xlarge | x2gd.8xlarge | x2gd.12xlarge | x2gd.16xlarge | x2gd.metal | vt1.3xlarge | vt1.6xlarge | vt1.24xlarge,
          MaxPrice: 'STRING_VALUE',
          Placement: {
            Affinity: 'STRING_VALUE',
            AvailabilityZone: 'STRING_VALUE',
            GroupName: 'STRING_VALUE',
            HostId: 'STRING_VALUE',
            HostResourceGroupArn: 'STRING_VALUE',
            PartitionNumber: 'NUMBER_VALUE',
            SpreadDomain: 'STRING_VALUE',
            Tenancy: default | dedicated | host
          },
          Priority: 'NUMBER_VALUE',
          SubnetId: 'STRING_VALUE',
          WeightedCapacity: 'NUMBER_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  TargetCapacitySpecification: { /* required */
    TotalTargetCapacity: 'NUMBER_VALUE', /* required */
    DefaultTargetCapacityType: spot | on-demand,
    OnDemandTargetCapacity: 'NUMBER_VALUE',
    SpotTargetCapacity: 'NUMBER_VALUE'
  },
  ClientToken: 'STRING_VALUE',
  Context: 'STRING_VALUE',
  DryRun: true || false,
  ExcessCapacityTerminationPolicy: no-termination | termination,
  OnDemandOptions: {
    AllocationStrategy: lowest-price | prioritized,
    CapacityReservationOptions: {
      UsageStrategy: use-capacity-reservations-first
    },
    MaxTotalPrice: 'STRING_VALUE',
    MinTargetCapacity: 'NUMBER_VALUE',
    SingleAvailabilityZone: true || false,
    SingleInstanceType: true || false
  },
  ReplaceUnhealthyInstances: true || false,
  SpotOptions: {
    AllocationStrategy: lowest-price | diversified | capacity-optimized | capacity-optimized-prioritized,
    InstanceInterruptionBehavior: hibernate | stop | terminate,
    InstancePoolsToUseCount: 'NUMBER_VALUE',
    MaintenanceStrategies: {
      CapacityRebalance: {
        ReplacementStrategy: launch
      }
    },
    MaxTotalPrice: 'STRING_VALUE',
    MinTargetCapacity: 'NUMBER_VALUE',
    SingleAvailabilityZone: true || false,
    SingleInstanceType: true || false
  },
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      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 that 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 Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.

        If the allocation strategy is lowest-price, EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.

        If the allocation strategy is diversified, EC2 Fleet launches instances from all of the Spot Instance pools that you specify.

        If the allocation strategy is capacity-optimized (recommended), EC2 Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching. To give certain instance types a higher chance of launching first, use capacity-optimized-prioritized. Set a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. You can assign the same priority to different LaunchTemplateOverrides. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first. capacity-optimized-prioritized is supported only if your fleet uses a launch template. Note that if the On-Demand AllocationStrategy is set to prioritized, the same priority is applied when fulfilling On-Demand capacity.

        Possible values include:
        • "lowest-price"
        • "diversified"
        • "capacity-optimized"
        • "capacity-optimized-prioritized"
      • MaintenanceStrategies — (map)

        The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.

        • CapacityRebalance — (map)

          The strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted.

          • ReplacementStrategy — (String)

            The replacement strategy to use. Only available for fleets of type maintain.

            To allow EC2 Fleet to launch a replacement Spot Instance when an instance rebalance notification is emitted for an existing Spot Instance in the fleet, specify launch. You must specify a value, otherwise you get an error.

            Note: When a replacement instance is launched, the instance marked for rebalance is not automatically terminated. You can terminate it, or you can leave it running. You are charged for all instances while they are running.
            Possible values include:
            • "launch"
      • 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.

        Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.

      • SingleInstanceType — (Boolean)

        Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet. Supported only for fleets of type instant.

      • SingleAvailabilityZone — (Boolean)

        Indicates that the fleet launches all Spot Instances into a single Availability Zone. Supported only for fleets of type instant.

      • 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.

      • MaxTotalPrice — (String)

        The maximum amount per hour for Spot Instances that you're willing to pay.

    • OnDemandOptions — (map)

      Describes the configuration 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"
      • CapacityReservationOptions — (map)

        The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. Supported only for fleets of type instant.

        • UsageStrategy — (String)

          Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.

          If you specify use-capacity-reservations-first, the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price or prioritized) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price or prioritized).

          If you do not specify a value, the fleet fulfils the On-Demand capacity according to the chosen On-Demand allocation strategy.

          Possible values include:
          • "use-capacity-reservations-first"
      • SingleInstanceType — (Boolean)

        Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet. Supported only for fleets of type instant.

      • SingleAvailabilityZone — (Boolean)

        Indicates that the fleet launches all On-Demand Instances into a single Availability Zone. Supported only for fleets of type instant.

      • 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.

      • MaxTotalPrice — (String)

        The maximum amount per hour for On-Demand Instances that you're willing to pay.

    • 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. If you specify the template ID, you can't specify the template name.

        • LaunchTemplateName — (String)

          The name of the launch template. If you specify the template name, you can't specify the template ID.

        • Version — (String)

          The launch template version number, $Latest, or $Default. You must specify a value, otherwise the request fails.

          If the value is $Latest, Amazon EC2 uses the latest version of the launch template.

          If the value is $Default, Amazon EC2 uses the default version of the launch template.

      • Overrides — (Array<map>)

        Any parameters that you specify override the same parameters in the launch template.

        For fleets of type request and maintain, a maximum of 300 items is allowed across all launch templates.

        • 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"
          • "t3a.nano"
          • "t3a.micro"
          • "t3a.small"
          • "t3a.medium"
          • "t3a.large"
          • "t3a.xlarge"
          • "t3a.2xlarge"
          • "t4g.nano"
          • "t4g.micro"
          • "t4g.small"
          • "t4g.medium"
          • "t4g.large"
          • "t4g.xlarge"
          • "t4g.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.8xlarge"
          • "r5a.12xlarge"
          • "r5a.16xlarge"
          • "r5a.24xlarge"
          • "r5b.large"
          • "r5b.xlarge"
          • "r5b.2xlarge"
          • "r5b.4xlarge"
          • "r5b.8xlarge"
          • "r5b.12xlarge"
          • "r5b.16xlarge"
          • "r5b.24xlarge"
          • "r5b.metal"
          • "r5d.large"
          • "r5d.xlarge"
          • "r5d.2xlarge"
          • "r5d.4xlarge"
          • "r5d.8xlarge"
          • "r5d.12xlarge"
          • "r5d.16xlarge"
          • "r5d.24xlarge"
          • "r5d.metal"
          • "r5ad.large"
          • "r5ad.xlarge"
          • "r5ad.2xlarge"
          • "r5ad.4xlarge"
          • "r5ad.8xlarge"
          • "r5ad.12xlarge"
          • "r5ad.16xlarge"
          • "r5ad.24xlarge"
          • "r6g.metal"
          • "r6g.medium"
          • "r6g.large"
          • "r6g.xlarge"
          • "r6g.2xlarge"
          • "r6g.4xlarge"
          • "r6g.8xlarge"
          • "r6g.12xlarge"
          • "r6g.16xlarge"
          • "r6gd.metal"
          • "r6gd.medium"
          • "r6gd.large"
          • "r6gd.xlarge"
          • "r6gd.2xlarge"
          • "r6gd.4xlarge"
          • "r6gd.8xlarge"
          • "r6gd.12xlarge"
          • "r6gd.16xlarge"
          • "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"
          • "i3en.large"
          • "i3en.xlarge"
          • "i3en.2xlarge"
          • "i3en.3xlarge"
          • "i3en.6xlarge"
          • "i3en.12xlarge"
          • "i3en.24xlarge"
          • "i3en.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.12xlarge"
          • "c5.18xlarge"
          • "c5.24xlarge"
          • "c5.metal"
          • "c5a.large"
          • "c5a.xlarge"
          • "c5a.2xlarge"
          • "c5a.4xlarge"
          • "c5a.8xlarge"
          • "c5a.12xlarge"
          • "c5a.16xlarge"
          • "c5a.24xlarge"
          • "c5ad.large"
          • "c5ad.xlarge"
          • "c5ad.2xlarge"
          • "c5ad.4xlarge"
          • "c5ad.8xlarge"
          • "c5ad.12xlarge"
          • "c5ad.16xlarge"
          • "c5ad.24xlarge"
          • "c5d.large"
          • "c5d.xlarge"
          • "c5d.2xlarge"
          • "c5d.4xlarge"
          • "c5d.9xlarge"
          • "c5d.12xlarge"
          • "c5d.18xlarge"
          • "c5d.24xlarge"
          • "c5d.metal"
          • "c5n.large"
          • "c5n.xlarge"
          • "c5n.2xlarge"
          • "c5n.4xlarge"
          • "c5n.9xlarge"
          • "c5n.18xlarge"
          • "c5n.metal"
          • "c6g.metal"
          • "c6g.medium"
          • "c6g.large"
          • "c6g.xlarge"
          • "c6g.2xlarge"
          • "c6g.4xlarge"
          • "c6g.8xlarge"
          • "c6g.12xlarge"
          • "c6g.16xlarge"
          • "c6gd.metal"
          • "c6gd.medium"
          • "c6gd.large"
          • "c6gd.xlarge"
          • "c6gd.2xlarge"
          • "c6gd.4xlarge"
          • "c6gd.8xlarge"
          • "c6gd.12xlarge"
          • "c6gd.16xlarge"
          • "c6gn.medium"
          • "c6gn.large"
          • "c6gn.xlarge"
          • "c6gn.2xlarge"
          • "c6gn.4xlarge"
          • "c6gn.8xlarge"
          • "c6gn.12xlarge"
          • "c6gn.16xlarge"
          • "cc1.4xlarge"
          • "cc2.8xlarge"
          • "g2.2xlarge"
          • "g2.8xlarge"
          • "g3.4xlarge"
          • "g3.8xlarge"
          • "g3.16xlarge"
          • "g3s.xlarge"
          • "g4ad.xlarge"
          • "g4ad.2xlarge"
          • "g4ad.4xlarge"
          • "g4ad.8xlarge"
          • "g4ad.16xlarge"
          • "g4dn.xlarge"
          • "g4dn.2xlarge"
          • "g4dn.4xlarge"
          • "g4dn.8xlarge"
          • "g4dn.12xlarge"
          • "g4dn.16xlarge"
          • "g4dn.metal"
          • "cg1.4xlarge"
          • "p2.xlarge"
          • "p2.8xlarge"
          • "p2.16xlarge"
          • "p3.2xlarge"
          • "p3.8xlarge"
          • "p3.16xlarge"
          • "p3dn.24xlarge"
          • "p4d.24xlarge"
          • "d2.xlarge"
          • "d2.2xlarge"
          • "d2.4xlarge"
          • "d2.8xlarge"
          • "d3.xlarge"
          • "d3.2xlarge"
          • "d3.4xlarge"
          • "d3.8xlarge"
          • "d3en.xlarge"
          • "d3en.2xlarge"
          • "d3en.4xlarge"
          • "d3en.6xlarge"
          • "d3en.8xlarge"
          • "d3en.12xlarge"
          • "f1.2xlarge"
          • "f1.4xlarge"
          • "f1.16xlarge"
          • "m5.large"
          • "m5.xlarge"
          • "m5.2xlarge"
          • "m5.4xlarge"
          • "m5.8xlarge"
          • "m5.12xlarge"
          • "m5.16xlarge"
          • "m5.24xlarge"
          • "m5.metal"
          • "m5a.large"
          • "m5a.xlarge"
          • "m5a.2xlarge"
          • "m5a.4xlarge"
          • "m5a.8xlarge"
          • "m5a.12xlarge"
          • "m5a.16xlarge"
          • "m5a.24xlarge"
          • "m5d.large"
          • "m5d.xlarge"
          • "m5d.2xlarge"
          • "m5d.4xlarge"
          • "m5d.8xlarge"
          • "m5d.12xlarge"
          • "m5d.16xlarge"
          • "m5d.24xlarge"
          • "m5d.metal"
          • "m5ad.large"
          • "m5ad.xlarge"
          • "m5ad.2xlarge"
          • "m5ad.4xlarge"
          • "m5ad.8xlarge"
          • "m5ad.12xlarge"
          • "m5ad.16xlarge"
          • "m5ad.24xlarge"
          • "m5zn.large"
          • "m5zn.xlarge"
          • "m5zn.2xlarge"
          • "m5zn.3xlarge"
          • "m5zn.6xlarge"
          • "m5zn.12xlarge"
          • "m5zn.metal"
          • "h1.2xlarge"
          • "h1.4xlarge"
          • "h1.8xlarge"
          • "h1.16xlarge"
          • "z1d.large"
          • "z1d.xlarge"
          • "z1d.2xlarge"
          • "z1d.3xlarge"
          • "z1d.6xlarge"
          • "z1d.12xlarge"
          • "z1d.metal"
          • "u-6tb1.56xlarge"
          • "u-6tb1.112xlarge"
          • "u-9tb1.112xlarge"
          • "u-12tb1.112xlarge"
          • "u-6tb1.metal"
          • "u-9tb1.metal"
          • "u-12tb1.metal"
          • "u-18tb1.metal"
          • "u-24tb1.metal"
          • "a1.medium"
          • "a1.large"
          • "a1.xlarge"
          • "a1.2xlarge"
          • "a1.4xlarge"
          • "a1.metal"
          • "m5dn.large"
          • "m5dn.xlarge"
          • "m5dn.2xlarge"
          • "m5dn.4xlarge"
          • "m5dn.8xlarge"
          • "m5dn.12xlarge"
          • "m5dn.16xlarge"
          • "m5dn.24xlarge"
          • "m5dn.metal"
          • "m5n.large"
          • "m5n.xlarge"
          • "m5n.2xlarge"
          • "m5n.4xlarge"
          • "m5n.8xlarge"
          • "m5n.12xlarge"
          • "m5n.16xlarge"
          • "m5n.24xlarge"
          • "m5n.metal"
          • "r5dn.large"
          • "r5dn.xlarge"
          • "r5dn.2xlarge"
          • "r5dn.4xlarge"
          • "r5dn.8xlarge"
          • "r5dn.12xlarge"
          • "r5dn.16xlarge"
          • "r5dn.24xlarge"
          • "r5dn.metal"
          • "r5n.large"
          • "r5n.xlarge"
          • "r5n.2xlarge"
          • "r5n.4xlarge"
          • "r5n.8xlarge"
          • "r5n.12xlarge"
          • "r5n.16xlarge"
          • "r5n.24xlarge"
          • "r5n.metal"
          • "inf1.xlarge"
          • "inf1.2xlarge"
          • "inf1.6xlarge"
          • "inf1.24xlarge"
          • "m6g.metal"
          • "m6g.medium"
          • "m6g.large"
          • "m6g.xlarge"
          • "m6g.2xlarge"
          • "m6g.4xlarge"
          • "m6g.8xlarge"
          • "m6g.12xlarge"
          • "m6g.16xlarge"
          • "m6gd.metal"
          • "m6gd.medium"
          • "m6gd.large"
          • "m6gd.xlarge"
          • "m6gd.2xlarge"
          • "m6gd.4xlarge"
          • "m6gd.8xlarge"
          • "m6gd.12xlarge"
          • "m6gd.16xlarge"
          • "m6i.large"
          • "m6i.xlarge"
          • "m6i.2xlarge"
          • "m6i.4xlarge"
          • "m6i.8xlarge"
          • "m6i.12xlarge"
          • "m6i.16xlarge"
          • "m6i.24xlarge"
          • "m6i.32xlarge"
          • "mac1.metal"
          • "x2gd.medium"
          • "x2gd.large"
          • "x2gd.xlarge"
          • "x2gd.2xlarge"
          • "x2gd.4xlarge"
          • "x2gd.8xlarge"
          • "x2gd.12xlarge"
          • "x2gd.16xlarge"
          • "x2gd.metal"
          • "vt1.3xlarge"
          • "vt1.6xlarge"
          • "vt1.24xlarge"
        • MaxPrice — (String)

          The maximum price per unit hour that you are willing to pay for a Spot Instance.

        • SubnetId — (String)

          The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2). A request of type instant can have only one subnet ID.

        • 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. The highest priority is launched first.

          If the On-Demand AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.

          If the Spot AllocationStrategy is set to capacity-optimized-prioritized, EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity 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. You can set the same priority for different launch template overrides.

        • Placement — (map)

          The location where the instance launched, if applicable.

          • AvailabilityZone — (String)

            The Availability Zone of the instance.

            If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.

            This parameter is not supported by CreateFleet.

          • Affinity — (String)

            The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.

            This parameter is not supported by CreateFleet.

          • GroupName — (String)

            The name of the placement group the instance is in.

          • PartitionNumber — (Integer)

            The number of the partition the instance is in. Valid only if the placement group strategy is set to partition.

            This parameter is not supported by CreateFleet.

          • HostId — (String)

            The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

            This parameter is not supported by CreateFleet.

          • 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.

            This parameter is not supported by CreateFleet.

            T3 instances that use the unlimited CPU credit option do not support host tenancy.

            Possible values include:
            • "default"
            • "dedicated"
            • "host"
          • SpreadDomain — (String)

            Reserved for future use.

            This parameter is not supported by CreateFleet.

          • HostResourceGroupArn — (String)

            The ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it to host.

            This parameter is not supported by CreateFleet.

    • TargetCapacitySpecification — (map)

      The number of units to request.

      • 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 fleet type. The default value is maintain.

      • maintain - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.

      • request - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.

      • instant - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.

      For more information, see EC2 Fleet request types in the Amazon EC2 User Guide.

      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. If no value is specified, the request remains until you cancel it.

    • ReplaceUnhealthyInstances — (Boolean)

      Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type maintain. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide.

    • TagSpecifications — (Array<map>)

      The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tagging your resources.

      If the fleet type is instant, specify a resource type of fleet to tag the fleet or instance to tag the instances at launch.

      If the fleet type is maintain or request, specify a resource type of fleet to tag the fleet. You cannot specify a resource type of instance. To tag instances at launch, specify the tags in a launch template.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • Context — (String)

      Reserved.

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. Supported only for fleets of type instant.

        • LaunchTemplateAndOverrides — (map)

          The launch templates and overrides that were used for launching the instances. The values that you specify in the Overrides replace the values in the launch template.

          • LaunchTemplateSpecification — (map)

            The launch template.

            • LaunchTemplateId — (String)

              The ID of the launch template. If you specify the template ID, you can't specify the template name.

            • LaunchTemplateName — (String)

              The name of the launch template. If you specify the template name, you can't specify the template ID.

            • Version — (String)

              The launch template version number, $Latest, or $Default. You must specify a value, otherwise the request fails.

              If the value is $Latest, Amazon EC2 uses the latest version of the launch template.

              If the value is $Default, Amazon EC2 uses the default version of the launch template.

          • 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"
              • "t3a.nano"
              • "t3a.micro"
              • "t3a.small"
              • "t3a.medium"
              • "t3a.large"
              • "t3a.xlarge"
              • "t3a.2xlarge"
              • "t4g.nano"
              • "t4g.micro"
              • "t4g.small"
              • "t4g.medium"
              • "t4g.large"
              • "t4g.xlarge"
              • "t4g.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.8xlarge"
              • "r5a.12xlarge"
              • "r5a.16xlarge"
              • "r5a.24xlarge"
              • "r5b.large"
              • "r5b.xlarge"
              • "r5b.2xlarge"
              • "r5b.4xlarge"
              • "r5b.8xlarge"
              • "r5b.12xlarge"
              • "r5b.16xlarge"
              • "r5b.24xlarge"
              • "r5b.metal"
              • "r5d.large"
              • "r5d.xlarge"
              • "r5d.2xlarge"
              • "r5d.4xlarge"
              • "r5d.8xlarge"
              • "r5d.12xlarge"
              • "r5d.16xlarge"
              • "r5d.24xlarge"
              • "r5d.metal"
              • "r5ad.large"
              • "r5ad.xlarge"
              • "r5ad.2xlarge"
              • "r5ad.4xlarge"
              • "r5ad.8xlarge"
              • "r5ad.12xlarge"
              • "r5ad.16xlarge"
              • "r5ad.24xlarge"
              • "r6g.metal"
              • "r6g.medium"
              • "r6g.large"
              • "r6g.xlarge"
              • "r6g.2xlarge"
              • "r6g.4xlarge"
              • "r6g.8xlarge"
              • "r6g.12xlarge"
              • "r6g.16xlarge"
              • "r6gd.metal"
              • "r6gd.medium"
              • "r6gd.large"
              • "r6gd.xlarge"
              • "r6gd.2xlarge"
              • "r6gd.4xlarge"
              • "r6gd.8xlarge"
              • "r6gd.12xlarge"
              • "r6gd.16xlarge"
              • "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"
              • "i3en.large"
              • "i3en.xlarge"
              • "i3en.2xlarge"
              • "i3en.3xlarge"
              • "i3en.6xlarge"
              • "i3en.12xlarge"
              • "i3en.24xlarge"
              • "i3en.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.12xlarge"
              • "c5.18xlarge"
              • "c5.24xlarge"
              • "c5.metal"
              • "c5a.large"
              • "c5a.xlarge"
              • "c5a.2xlarge"
              • "c5a.4xlarge"
              • "c5a.8xlarge"
              • "c5a.12xlarge"
              • "c5a.16xlarge"
              • "c5a.24xlarge"
              • "c5ad.large"
              • "c5ad.xlarge"
              • "c5ad.2xlarge"
              • "c5ad.4xlarge"
              • "c5ad.8xlarge"
              • "c5ad.12xlarge"
              • "c5ad.16xlarge"
              • "c5ad.24xlarge"
              • "c5d.large"
              • "c5d.xlarge"
              • "c5d.2xlarge"
              • "c5d.4xlarge"
              • "c5d.9xlarge"
              • "c5d.12xlarge"
              • "c5d.18xlarge"
              • "c5d.24xlarge"
              • "c5d.metal"
              • "c5n.large"
              • "c5n.xlarge"
              • "c5n.2xlarge"
              • "c5n.4xlarge"
              • "c5n.9xlarge"
              • "c5n.18xlarge"
              • "c5n.metal"
              • "c6g.metal"
              • "c6g.medium"
              • "c6g.large"
              • "c6g.xlarge"
              • "c6g.2xlarge"
              • "c6g.4xlarge"
              • "c6g.8xlarge"
              • "c6g.12xlarge"
              • "c6g.16xlarge"
              • "c6gd.metal"
              • "c6gd.medium"
              • "c6gd.large"
              • "c6gd.xlarge"
              • "c6gd.2xlarge"
              • "c6gd.4xlarge"
              • "c6gd.8xlarge"
              • "c6gd.12xlarge"
              • "c6gd.16xlarge"
              • "c6gn.medium"
              • "c6gn.large"
              • "c6gn.xlarge"
              • "c6gn.2xlarge"
              • "c6gn.4xlarge"
              • "c6gn.8xlarge"
              • "c6gn.12xlarge"
              • "c6gn.16xlarge"
              • "cc1.4xlarge"
              • "cc2.8xlarge"
              • "g2.2xlarge"
              • "g2.8xlarge"
              • "g3.4xlarge"
              • "g3.8xlarge"
              • "g3.16xlarge"
              • "g3s.xlarge"
              • "g4ad.xlarge"
              • "g4ad.2xlarge"
              • "g4ad.4xlarge"
              • "g4ad.8xlarge"
              • "g4ad.16xlarge"
              • "g4dn.xlarge"
              • "g4dn.2xlarge"
              • "g4dn.4xlarge"
              • "g4dn.8xlarge"
              • "g4dn.12xlarge"
              • "g4dn.16xlarge"
              • "g4dn.metal"
              • "cg1.4xlarge"
              • "p2.xlarge"
              • "p2.8xlarge"
              • "p2.16xlarge"
              • "p3.2xlarge"
              • "p3.8xlarge"
              • "p3.16xlarge"
              • "p3dn.24xlarge"
              • "p4d.24xlarge"
              • "d2.xlarge"
              • "d2.2xlarge"
              • "d2.4xlarge"
              • "d2.8xlarge"
              • "d3.xlarge"
              • "d3.2xlarge"
              • "d3.4xlarge"
              • "d3.8xlarge"
              • "d3en.xlarge"
              • "d3en.2xlarge"
              • "d3en.4xlarge"
              • "d3en.6xlarge"
              • "d3en.8xlarge"
              • "d3en.12xlarge"
              • "f1.2xlarge"
              • "f1.4xlarge"
              • "f1.16xlarge"
              • "m5.large"
              • "m5.xlarge"
              • "m5.2xlarge"
              • "m5.4xlarge"
              • "m5.8xlarge"
              • "m5.12xlarge"
              • "m5.16xlarge"
              • "m5.24xlarge"
              • "m5.metal"
              • "m5a.large"
              • "m5a.xlarge"
              • "m5a.2xlarge"
              • "m5a.4xlarge"
              • "m5a.8xlarge"
              • "m5a.12xlarge"
              • "m5a.16xlarge"
              • "m5a.24xlarge"
              • "m5d.large"
              • "m5d.xlarge"
              • "m5d.2xlarge"
              • "m5d.4xlarge"
              • "m5d.8xlarge"
              • "m5d.12xlarge"
              • "m5d.16xlarge"
              • "m5d.24xlarge"
              • "m5d.metal"
              • "m5ad.large"
              • "m5ad.xlarge"
              • "m5ad.2xlarge"
              • "m5ad.4xlarge"
              • "m5ad.8xlarge"
              • "m5ad.12xlarge"
              • "m5ad.16xlarge"
              • "m5ad.24xlarge"
              • "m5zn.large"
              • "m5zn.xlarge"
              • "m5zn.2xlarge"
              • "m5zn.3xlarge"
              • "m5zn.6xlarge"
              • "m5zn.12xlarge"
              • "m5zn.metal"
              • "h1.2xlarge"
              • "h1.4xlarge"
              • "h1.8xlarge"
              • "h1.16xlarge"
              • "z1d.large"
              • "z1d.xlarge"
              • "z1d.2xlarge"
              • "z1d.3xlarge"
              • "z1d.6xlarge"
              • "z1d.12xlarge"
              • "z1d.metal"
              • "u-6tb1.56xlarge"
              • "u-6tb1.112xlarge"
              • "u-9tb1.112xlarge"
              • "u-12tb1.112xlarge"
              • "u-6tb1.metal"
              • "u-9tb1.metal"
              • "u-12tb1.metal"
              • "u-18tb1.metal"
              • "u-24tb1.metal"
              • "a1.medium"
              • "a1.large"
              • "a1.xlarge"
              • "a1.2xlarge"
              • "a1.4xlarge"
              • "a1.metal"
              • "m5dn.large"
              • "m5dn.xlarge"
              • "m5dn.2xlarge"
              • "m5dn.4xlarge"
              • "m5dn.8xlarge"
              • "m5dn.12xlarge"
              • "m5dn.16xlarge"
              • "m5dn.24xlarge"
              • "m5dn.metal"
              • "m5n.large"
              • "m5n.xlarge"
              • "m5n.2xlarge"
              • "m5n.4xlarge"
              • "m5n.8xlarge"
              • "m5n.12xlarge"
              • "m5n.16xlarge"
              • "m5n.24xlarge"
              • "m5n.metal"
              • "r5dn.large"
              • "r5dn.xlarge"
              • "r5dn.2xlarge"
              • "r5dn.4xlarge"
              • "r5dn.8xlarge"
              • "r5dn.12xlarge"
              • "r5dn.16xlarge"
              • "r5dn.24xlarge"
              • "r5dn.metal"
              • "r5n.large"
              • "r5n.xlarge"
              • "r5n.2xlarge"
              • "r5n.4xlarge"
              • "r5n.8xlarge"
              • "r5n.12xlarge"
              • "r5n.16xlarge"
              • "r5n.24xlarge"
              • "r5n.metal"
              • "inf1.xlarge"
              • "inf1.2xlarge"
              • "inf1.6xlarge"
              • "inf1.24xlarge"
              • "m6g.metal"
              • "m6g.medium"
              • "m6g.large"
              • "m6g.xlarge"
              • "m6g.2xlarge"
              • "m6g.4xlarge"
              • "m6g.8xlarge"
              • "m6g.12xlarge"
              • "m6g.16xlarge"
              • "m6gd.metal"
              • "m6gd.medium"
              • "m6gd.large"
              • "m6gd.xlarge"
              • "m6gd.2xlarge"
              • "m6gd.4xlarge"
              • "m6gd.8xlarge"
              • "m6gd.12xlarge"
              • "m6gd.16xlarge"
              • "m6i.large"
              • "m6i.xlarge"
              • "m6i.2xlarge"
              • "m6i.4xlarge"
              • "m6i.8xlarge"
              • "m6i.12xlarge"
              • "m6i.16xlarge"
              • "m6i.24xlarge"
              • "m6i.32xlarge"
              • "mac1.metal"
              • "x2gd.medium"
              • "x2gd.large"
              • "x2gd.xlarge"
              • "x2gd.2xlarge"
              • "x2gd.4xlarge"
              • "x2gd.8xlarge"
              • "x2gd.12xlarge"
              • "x2gd.16xlarge"
              • "x2gd.metal"
              • "vt1.3xlarge"
              • "vt1.6xlarge"
              • "vt1.24xlarge"
            • 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. The highest priority is launched first.

              If the On-Demand AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.

              If the Spot AllocationStrategy is set to capacity-optimized-prioritized, EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity 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. You can set the same priority for different launch template overrides.

            • Placement — (map)

              The location where the instance launched, if applicable.

              • GroupName — (String)

                The name of the placement group that 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 Error Codes.

      • Instances — (Array<map>)

        Information about the instances that were launched by the fleet. Supported only for fleets of type instant.

        • LaunchTemplateAndOverrides — (map)

          The launch templates and overrides that were used for launching the instances. The values that you specify in the Overrides replace the values in the launch template.

          • LaunchTemplateSpecification — (map)

            The launch template.

            • LaunchTemplateId — (String)

              The ID of the launch template. If you specify the template ID, you can't specify the template name.

            • LaunchTemplateName — (String)

              The name of the launch template. If you specify the template name, you can't specify the template ID.

            • Version — (String)

              The launch template version number, $Latest, or $Default. You must specify a value, otherwise the request fails.

              If the value is $Latest, Amazon EC2 uses the latest version of the launch template.

              If the value is $Default, Amazon EC2 uses the default version of the launch template.

          • 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"
              • "t3a.nano"
              • "t3a.micro"
              • "t3a.small"
              • "t3a.medium"
              • "t3a.large"
              • "t3a.xlarge"
              • "t3a.2xlarge"
              • "t4g.nano"
              • "t4g.micro"
              • "t4g.small"
              • "t4g.medium"
              • "t4g.large"
              • "t4g.xlarge"
              • "t4g.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.8xlarge"
              • "r5a.12xlarge"
              • "r5a.16xlarge"
              • "r5a.24xlarge"
              • "r5b.large"
              • "r5b.xlarge"
              • "r5b.2xlarge"
              • "r5b.4xlarge"
              • "r5b.8xlarge"
              • "r5b.12xlarge"
              • "r5b.16xlarge"
              • "r5b.24xlarge"
              • "r5b.metal"
              • "r5d.large"
              • "r5d.xlarge"
              • "r5d.2xlarge"
              • "r5d.4xlarge"
              • "r5d.8xlarge"
              • "r5d.12xlarge"
              • "r5d.16xlarge"
              • "r5d.24xlarge"
              • "r5d.metal"
              • "r5ad.large"
              • "r5ad.xlarge"
              • "r5ad.2xlarge"
              • "r5ad.4xlarge"
              • "r5ad.8xlarge"
              • "r5ad.12xlarge"
              • "r5ad.16xlarge"
              • "r5ad.24xlarge"
              • "r6g.metal"
              • "r6g.medium"
              • "r6g.large"
              • "r6g.xlarge"
              • "r6g.2xlarge"
              • "r6g.4xlarge"
              • "r6g.8xlarge"
              • "r6g.12xlarge"
              • "r6g.16xlarge"
              • "r6gd.metal"
              • "r6gd.medium"
              • "r6gd.large"
              • "r6gd.xlarge"
              • "r6gd.2xlarge"
              • "r6gd.4xlarge"
              • "r6gd.8xlarge"
              • "r6gd.12xlarge"
              • "r6gd.16xlarge"
              • "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"
              • "i3en.large"
              • "i3en.xlarge"
              • "i3en.2xlarge"
              • "i3en.3xlarge"
              • "i3en.6xlarge"
              • "i3en.12xlarge"
              • "i3en.24xlarge"
              • "i3en.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.12xlarge"
              • "c5.18xlarge"
              • "c5.24xlarge"
              • "c5.metal"
              • "c5a.large"
              • "c5a.xlarge"
              • "c5a.2xlarge"
              • "c5a.4xlarge"
              • "c5a.8xlarge"
              • "c5a.12xlarge"
              • "c5a.16xlarge"
              • "c5a.24xlarge"
              • "c5ad.large"
              • "c5ad.xlarge"
              • "c5ad.2xlarge"
              • "c5ad.4xlarge"
              • "c5ad.8xlarge"
              • "c5ad.12xlarge"
              • "c5ad.16xlarge"
              • "c5ad.24xlarge"
              • "c5d.large"
              • "c5d.xlarge"
              • "c5d.2xlarge"
              • "c5d.4xlarge"
              • "c5d.9xlarge"
              • "c5d.12xlarge"
              • "c5d.18xlarge"
              • "c5d.24xlarge"
              • "c5d.metal"
              • "c5n.large"
              • "c5n.xlarge"
              • "c5n.2xlarge"
              • "c5n.4xlarge"
              • "c5n.9xlarge"
              • "c5n.18xlarge"
              • "c5n.metal"
              • "c6g.metal"
              • "c6g.medium"
              • "c6g.large"
              • "c6g.xlarge"
              • "c6g.2xlarge"
              • "c6g.4xlarge"
              • "c6g.8xlarge"
              • "c6g.12xlarge"
              • "c6g.16xlarge"
              • "c6gd.metal"
              • "c6gd.medium"
              • "c6gd.large"
              • "c6gd.xlarge"
              • "c6gd.2xlarge"
              • "c6gd.4xlarge"
              • "c6gd.8xlarge"
              • "c6gd.12xlarge"
              • "c6gd.16xlarge"
              • "c6gn.medium"
              • "c6gn.large"
              • "c6gn.xlarge"
              • "c6gn.2xlarge"
              • "c6gn.4xlarge"
              • "c6gn.8xlarge"
              • "c6gn.12xlarge"
              • "c6gn.16xlarge"
              • "cc1.4xlarge"
              • "cc2.8xlarge"
              • "g2.2xlarge"
              • "g2.8xlarge"
              • "g3.4xlarge"
              • "g3.8xlarge"
              • "g3.16xlarge"
              • "g3s.xlarge"
              • "g4ad.xlarge"
              • "g4ad.2xlarge"
              • "g4ad.4xlarge"
              • "g4ad.8xlarge"
              • "g4ad.16xlarge"
              • "g4dn.xlarge"
              • "g4dn.2xlarge"
              • "g4dn.4xlarge"
              • "g4dn.8xlarge"
              • "g4dn.12xlarge"
              • "g4dn.16xlarge"
              • "g4dn.metal"
              • "cg1.4xlarge"
              • "p2.xlarge"
              • "p2.8xlarge"
              • "p2.16xlarge"
              • "p3.2xlarge"
              • "p3.8xlarge"
              • "p3.16xlarge"
              • "p3dn.24xlarge"
              • "p4d.24xlarge"
              • "d2.xlarge"
              • "d2.2xlarge"
              • "d2.4xlarge"
              • "d2.8xlarge"
              • "d3.xlarge"
              • "d3.2xlarge"
              • "d3.4xlarge"
              • "d3.8xlarge"
              • "d3en.xlarge"
              • "d3en.2xlarge"
              • "d3en.4xlarge"
              • "d3en.6xlarge"
              • "d3en.8xlarge"
              • "d3en.12xlarge"
              • "f1.2xlarge"
              • "f1.4xlarge"
              • "f1.16xlarge"
              • "m5.large"
              • "m5.xlarge"
              • "m5.2xlarge"
              • "m5.4xlarge"
              • "m5.8xlarge"
              • "m5.12xlarge"
              • "m5.16xlarge"
              • "m5.24xlarge"
              • "m5.metal"
              • "m5a.large"
              • "m5a.xlarge"
              • "m5a.2xlarge"
              • "m5a.4xlarge"
              • "m5a.8xlarge"
              • "m5a.12xlarge"
              • "m5a.16xlarge"
              • "m5a.24xlarge"
              • "m5d.large"
              • "m5d.xlarge"
              • "m5d.2xlarge"
              • "m5d.4xlarge"
              • "m5d.8xlarge"
              • "m5d.12xlarge"
              • "m5d.16xlarge"
              • "m5d.24xlarge"
              • "m5d.metal"
              • "m5ad.large"
              • "m5ad.xlarge"
              • "m5ad.2xlarge"
              • "m5ad.4xlarge"
              • "m5ad.8xlarge"
              • "m5ad.12xlarge"
              • "m5ad.16xlarge"
              • "m5ad.24xlarge"
              • "m5zn.large"
              • "m5zn.xlarge"
              • "m5zn.2xlarge"
              • "m5zn.3xlarge"
              • "m5zn.6xlarge"
              • "m5zn.12xlarge"
              • "m5zn.metal"
              • "h1.2xlarge"
              • "h1.4xlarge"
              • "h1.8xlarge"
              • "h1.16xlarge"
              • "z1d.large"
              • "z1d.xlarge"
              • "z1d.2xlarge"
              • "z1d.3xlarge"
              • "z1d.6xlarge"
              • "z1d.12xlarge"
              • "z1d.metal"
              • "u-6tb1.56xlarge"
              • "u-6tb1.112xlarge"
              • "u-9tb1.112xlarge"
              • "u-12tb1.112xlarge"
              • "u-6tb1.metal"
              • "u-9tb1.metal"
              • "u-12tb1.metal"
              • "u-18tb1.metal"
              • "u-24tb1.metal"
              • "a1.medium"
              • "a1.large"
              • "a1.xlarge"
              • "a1.2xlarge"
              • "a1.4xlarge"
              • "a1.metal"
              • "m5dn.large"
              • "m5dn.xlarge"
              • "m5dn.2xlarge"
              • "m5dn.4xlarge"
              • "m5dn.8xlarge"
              • "m5dn.12xlarge"
              • "m5dn.16xlarge"
              • "m5dn.24xlarge"
              • "m5dn.metal"
              • "m5n.large"
              • "m5n.xlarge"
              • "m5n.2xlarge"
              • "m5n.4xlarge"
              • "m5n.8xlarge"
              • "m5n.12xlarge"
              • "m5n.16xlarge"
              • "m5n.24xlarge"
              • "m5n.metal"
              • "r5dn.large"
              • "r5dn.xlarge"
              • "r5dn.2xlarge"
              • "r5dn.4xlarge"
              • "r5dn.8xlarge"
              • "r5dn.12xlarge"
              • "r5dn.16xlarge"
              • "r5dn.24xlarge"
              • "r5dn.metal"
              • "r5n.large"
              • "r5n.xlarge"
              • "r5n.2xlarge"
              • "r5n.4xlarge"
              • "r5n.8xlarge"
              • "r5n.12xlarge"
              • "r5n.16xlarge"
              • "r5n.24xlarge"
              • "r5n.metal"
              • "inf1.xlarge"
              • "inf1.2xlarge"
              • "inf1.6xlarge"
              • "inf1.24xlarge"
              • "m6g.metal"
              • "m6g.medium"
              • "m6g.large"
              • "m6g.xlarge"
              • "m6g.2xlarge"
              • "m6g.4xlarge"
              • "m6g.8xlarge"
              • "m6g.12xlarge"
              • "m6g.16xlarge"
              • "m6gd.metal"
              • "m6gd.medium"
              • "m6gd.large"
              • "m6gd.xlarge"
              • "m6gd.2xlarge"
              • "m6gd.4xlarge"
              • "m6gd.8xlarge"
              • "m6gd.12xlarge"
              • "m6gd.16xlarge"
              • "m6i.large"
              • "m6i.xlarge"
              • "m6i.2xlarge"
              • "m6i.4xlarge"
              • "m6i.8xlarge"
              • "m6i.12xlarge"
              • "m6i.16xlarge"
              • "m6i.24xlarge"
              • "m6i.32xlarge"
              • "mac1.metal"
              • "x2gd.medium"
              • "x2gd.large"
              • "x2gd.xlarge"
              • "x2gd.2xlarge"
              • "x2gd.4xlarge"
              • "x2gd.8xlarge"
              • "x2gd.12xlarge"
              • "x2gd.16xlarge"
              • "x2gd.metal"
              • "vt1.3xlarge"
              • "vt1.6xlarge"
              • "vt1.24xlarge"
            • 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. The highest priority is launched first.

              If the On-Demand AllocationStrategy is set to prioritized, EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.

              If the Spot AllocationStrategy is set to capacity-optimized-prioritized, EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity 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. You can set the same priority for different launch template overrides.

            • Placement — (map)

              The location where the instance launched, if applicable.

              • GroupName — (String)

                The name of the placement group that 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"
          • "t3a.nano"
          • "t3a.micro"
          • "t3a.small"
          • "t3a.medium"
          • "t3a.large"
          • "t3a.xlarge"
          • "t3a.2xlarge"
          • "t4g.nano"
          • "t4g.micro"
          • "t4g.small"
          • "t4g.medium"
          • "t4g.large"
          • "t4g.xlarge"
          • "t4g.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.8xlarge"
          • "r5a.12xlarge"
          • "r5a.16xlarge"
          • "r5a.24xlarge"
          • "r5b.large"
          • "r5b.xlarge"
          • "r5b.2xlarge"
          • "r5b.4xlarge"
          • "r5b.8xlarge"
          • "r5b.12xlarge"
          • "r5b.16xlarge"
          • "r5b.24xlarge"
          • "r5b.metal"
          • "r5d.large"
          • "r5d.xlarge"
          • "r5d.2xlarge"
          • "r5d.4xlarge"
          • "r5d.8xlarge"
          • "r5d.12xlarge"
          • "r5d.16xlarge"
          • "r5d.24xlarge"
          • "r5d.metal"
          • "r5ad.large"
          • "r5ad.xlarge"
          • "r5ad.2xlarge"
          • "r5ad.4xlarge"
          • "r5ad.8xlarge"
          • "r5ad.12xlarge"
          • "r5ad.16xlarge"
          • "r5ad.24xlarge"
          • "r6g.metal"
          • "r6g.medium"
          • "r6g.large"
          • "r6g.xlarge"
          • "r6g.2xlarge"
          • "r6g.4xlarge"
          • "r6g.8xlarge"
          • "r6g.12xlarge"
          • "r6g.16xlarge"
          • "r6gd.metal"
          • "r6gd.medium"
          • "r6gd.large"
          • "r6gd.xlarge"
          • "r6gd.2xlarge"
          • "r6gd.4xlarge"
          • "r6gd.8xlarge"
          • "r6gd.12xlarge"
          • "r6gd.16xlarge"
          • "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"
          • "i3en.large"
          • "i3en.xlarge"
          • "i3en.2xlarge"
          • "i3en.3xlarge"
          • "i3en.6xlarge"
          • "i3en.12xlarge"
          • "i3en.24xlarge"
          • "i3en.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.12xlarge"
          • "c5.18xlarge"
          • "c5.24xlarge"
          • "c5.metal"
          • "c5a.large"
          • "c5a.xlarge"
          • "c5a.2xlarge"
          • "c5a.4xlarge"
          • "c5a.8xlarge"
          • "c5a.12xlarge"
          • "c5a.16xlarge"
          • "c5a.24xlarge"
          • "c5ad.large"
          • "c5ad.xlarge"
          • "c5ad.2xlarge"
          • "c5ad.4xlarge"
          • "c5ad.8xlarge"
          • "c5ad.12xlarge"
          • "c5ad.16xlarge"
          • "c5ad.24xlarge"
          • "c5d.large"
          • "c5d.xlarge"
          • "c5d.2xlarge"
          • "c5d.4xlarge"
          • "c5d.9xlarge"
          • "c5d.12xlarge"
          • "c5d.18xlarge"
          • "c5d.24xlarge"
          • "c5d.metal"
          • "c5n.large"
          • "c5n.xlarge"
          • "c5n.2xlarge"
          • "c5n.4xlarge"
          • "c5n.9xlarge"
          • "c5n.18xlarge"
          • "c5n.metal"
          • "c6g.metal"
          • "c6g.medium"
          • "c6g.large"
          • "c6g.xlarge"
          • "c6g.2xlarge"
          • "c6g.4xlarge"
          • "c6g.8xlarge"
          • "c6g.12xlarge"
          • "c6g.16xlarge"
          • "c6gd.metal"
          • "c6gd.medium"
          • "c6gd.large"
          • "c6gd.xlarge"
          • "c6gd.2xlarge"
          • "c6gd.4xlarge"
          • "c6gd.8xlarge"
          • "c6gd.12xlarge"
          • "c6gd.16xlarge"
          • "c6gn.medium"
          • "c6gn.large"
          • "c6gn.xlarge"
          • "c6gn.2xlarge"
          • "c6gn.4xlarge"
          • "c6gn.8xlarge"
          • "c6gn.12xlarge"
          • "c6gn.16xlarge"
          • "cc1.4xlarge"
          • "cc2.8xlarge"
          • "g2.2xlarge"
          • "g2.8xlarge"
          • "g3.4xlarge"
          • "g3.8xlarge"
          • "g3.16xlarge"
          • "g3s.xlarge"
          • "g4ad.xlarge"
          • "g4ad.2xlarge"
          • "g4ad.4xlarge"
          • "g4ad.8xlarge"
          • "g4ad.16xlarge"
          • "g4dn.xlarge"
          • "g4dn.2xlarge"
          • "g4dn.4xlarge"
          • "g4dn.8xlarge"
          • "g4dn.12xlarge"
          • "g4dn.16xlarge"
          • "g4dn.metal"
          • "cg1.4xlarge"
          • "p2.xlarge"
          • "p2.8xlarge"
          • "p2.16xlarge"
          • "p3.2xlarge"
          • "p3.8xlarge"
          • "p3.16xlarge"
          • "p3dn.24xlarge"
          • "p4d.24xlarge"
          • "d2.xlarge"
          • "d2.2xlarge"
          • "d2.4xlarge"
          • "d2.8xlarge"
          • "d3.xlarge"
          • "d3.2xlarge"
          • "d3.4xlarge"
          • "d3.8xlarge"
          • "d3en.xlarge"
          • "d3en.2xlarge"
          • "d3en.4xlarge"
          • "d3en.6xlarge"
          • "d3en.8xlarge"
          • "d3en.12xlarge"
          • "f1.2xlarge"
          • "f1.4xlarge"
          • "f1.16xlarge"
          • "m5.large"
          • "m5.xlarge"
          • "m5.2xlarge"
          • "m5.4xlarge"
          • "m5.8xlarge"
          • "m5.12xlarge"
          • "m5.16xlarge"
          • "m5.24xlarge"
          • "m5.metal"
          • "m5a.large"
          • "m5a.xlarge"
          • "m5a.2xlarge"
          • "m5a.4xlarge"
          • "m5a.8xlarge"
          • "m5a.12xlarge"
          • "m5a.16xlarge"
          • "m5a.24xlarge"
          • "m5d.large"
          • "m5d.xlarge"
          • "m5d.2xlarge"
          • "m5d.4xlarge"
          • "m5d.8xlarge"
          • "m5d.12xlarge"
          • "m5d.16xlarge"
          • "m5d.24xlarge"
          • "m5d.metal"
          • "m5ad.large"
          • "m5ad.xlarge"
          • "m5ad.2xlarge"
          • "m5ad.4xlarge"
          • "m5ad.8xlarge"
          • "m5ad.12xlarge"
          • "m5ad.16xlarge"
          • "m5ad.24xlarge"
          • "m5zn.large"
          • "m5zn.xlarge"
          • "m5zn.2xlarge"
          • "m5zn.3xlarge"
          • "m5zn.6xlarge"
          • "m5zn.12xlarge"
          • "m5zn.metal"
          • "h1.2xlarge"
          • "h1.4xlarge"
          • "h1.8xlarge"
          • "h1.16xlarge"
          • "z1d.large"
          • "z1d.xlarge"
          • "z1d.2xlarge"
          • "z1d.3xlarge"
          • "z1d.6xlarge"
          • "z1d.12xlarge"
          • "z1d.metal"
          • "u-6tb1.56xlarge"
          • "u-6tb1.112xlarge"
          • "u-9tb1.112xlarge"
          • "u-12tb1.112xlarge"
          • "u-6tb1.metal"
          • "u-9tb1.metal"
          • "u-12tb1.metal"
          • "u-18tb1.metal"
          • "u-24tb1.metal"
          • "a1.medium"
          • "a1.large"
          • "a1.xlarge"
          • "a1.2xlarge"
          • "a1.4xlarge"
          • "a1.metal"
          • "m5dn.large"
          • "m5dn.xlarge"
          • "m5dn.2xlarge"
          • "m5dn.4xlarge"
          • "m5dn.8xlarge"
          • "m5dn.12xlarge"
          • "m5dn.16xlarge"
          • "m5dn.24xlarge"
          • "m5dn.metal"
          • "m5n.large"
          • "m5n.xlarge"
          • "m5n.2xlarge"
          • "m5n.4xlarge"
          • "m5n.8xlarge"
          • "m5n.12xlarge"
          • "m5n.16xlarge"
          • "m5n.24xlarge"
          • "m5n.metal"
          • "r5dn.large"
          • "r5dn.xlarge"
          • "r5dn.2xlarge"
          • "r5dn.4xlarge"
          • "r5dn.8xlarge"
          • "r5dn.12xlarge"
          • "r5dn.16xlarge"
          • "r5dn.24xlarge"
          • "r5dn.metal"
          • "r5n.large"
          • "r5n.xlarge"
          • "r5n.2xlarge"
          • "r5n.4xlarge"
          • "r5n.8xlarge"
          • "r5n.12xlarge"
          • "r5n.16xlarge"
          • "r5n.24xlarge"
          • "r5n.metal"
          • "inf1.xlarge"
          • "inf1.2xlarge"
          • "inf1.6xlarge"
          • "inf1.24xlarge"
          • "m6g.metal"
          • "m6g.medium"
          • "m6g.large"
          • "m6g.xlarge"
          • "m6g.2xlarge"
          • "m6g.4xlarge"
          • "m6g.8xlarge"
          • "m6g.12xlarge"
          • "m6g.16xlarge"
          • "m6gd.metal"
          • "m6gd.medium"
          • "m6gd.large"
          • "m6gd.xlarge"
          • "m6gd.2xlarge"
          • "m6gd.4xlarge"
          • "m6gd.8xlarge"
          • "m6gd.12xlarge"
          • "m6gd.16xlarge"
          • "m6i.large"
          • "m6i.xlarge"
          • "m6i.2xlarge"
          • "m6i.4xlarge"
          • "m6i.8xlarge"
          • "m6i.12xlarge"
          • "m6i.16xlarge"
          • "m6i.24xlarge"
          • "m6i.32xlarge"
          • "mac1.metal"
          • "x2gd.medium"
          • "x2gd.large"
          • "x2gd.xlarge"
          • "x2gd.2xlarge"
          • "x2gd.4xlarge"
          • "x2gd.8xlarge"
          • "x2gd.12xlarge"
          • "x2gd.16xlarge"
          • "x2gd.metal"
          • "vt1.3xlarge"
          • "vt1.6xlarge"
          • "vt1.24xlarge"
        • Platform — (String)

          The value is Windows for Windows instances. Otherwise, the value is 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',
  DestinationOptions: {
    FileFormat: plain-text | parquet,
    HiveCompatiblePartitions: true || false,
    PerHourPartition: true || false
  },
  DryRun: true || false,
  LogDestination: 'STRING_VALUE',
  LogDestinationType: cloud-watch-logs | s3,
  LogFormat: 'STRING_VALUE',
  LogGroupName: 'STRING_VALUE',
  MaxAggregationInterval: 'NUMBER_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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 permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account.

      If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn or LogGroupName.

    • LogGroupName — (String)

      The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.

      If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn or LogGroupName.

    • ResourceIds — (Array<String>)

      The ID of the subnet, network interface, or VPC for which you want to create a flow log.

      Constraints: Maximum of 1000 resources

    • ResourceType — (String)

      The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.

      Possible values include:
      • "VPC"
      • "Subnet"
      • "NetworkInterface"
    • TrafficType — (String)

      The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.

      Possible values include:
      • "ACCEPT"
      • "REJECT"
      • "ALL"
    • LogDestinationType — (String)

      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.

      If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn or LogGroupName.

      Default: cloud-watch-logs

      Possible values include:
      • "cloud-watch-logs"
      • "s3"
    • LogDestination — (String)

      The destination to which the flow log data is to be published. Flow log data can be published to a 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. For example, to publish to a log group called my-logs, specify arn:aws:logs:us-east-1:123456789012:log-group:my-logs. Alternatively, use LogGroupName instead.

      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.

    • LogFormat — (String)

      The fields to include in the flow log record, in the order in which they should appear. For a list of available fields, see Flow log records. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must specify at least one field.

      Specify the fields using the ${field-id} format, separated by spaces. For the CLI, surround this parameter value with single quotes on Linux or double quotes on Windows.

    • TagSpecifications — (Array<map>)

      The tags to apply to the flow logs.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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.

    • MaxAggregationInterval — (Integer)

      The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).

      When a network interface is attached to a Nitro-based instance, the aggregation interval is always 60 seconds or less, regardless of the value that you specify.

      Default: 600

    • DestinationOptions — (map)

      The destination options.

      • FileFormat — (String)

        The format for the flow log. The default is plain-text.

        Possible values include:
        • "plain-text"
        • "parquet"
      • HiveCompatiblePartitions — (Boolean)

        Indicates whether to use Hive-compatible prefixes for flow logs stored in Amazon S3. The default is false.

      • PerHourPartition — (Boolean)

        Indicates whether to partition the flow log per hour. This reduces the cost and response time for queries. The default is 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:

      • 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.

        • Error — (map)

          Information about the error.

          • Code — (String)

            The error code.

          • Message — (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 multiple FPGA-accelerated instances. For more information, see the Amazon Web Services 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',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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.

    • TagSpecifications — (Array<map>)

      The tags to apply to the FPGA image during creation.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • 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 Amazon 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: 'NUMBER_VALUE',
        KmsKeyId: 'STRING_VALUE',
        OutpostArn: 'STRING_VALUE',
        SnapshotId: 'STRING_VALUE',
        Throughput: 'NUMBER_VALUE',
        VolumeSize: 'NUMBER_VALUE',
        VolumeType: standard | io1 | io2 | gp2 | sc1 | st1 | gp3
      },
      NoDevice: 'STRING_VALUE',
      VirtualName: 'STRING_VALUE'
    },
    /* more items */
  ],
  Description: 'STRING_VALUE',
  DryRun: true || false,
  NoReboot: true || false,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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>)

      The 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. For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide.

        • Iops — (Integer)

          The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

          The following are the supported values for each volume type:

          • gp3: 3,000-16,000 IOPS

          • io1: 100-64,000 IOPS

          • io2: 100-64,000 IOPS

          For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System. Other instance families guarantee performance up to 32,000 IOPS.

          This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS. This parameter is not supported for gp2, st1, sc1, or standard volumes.

        • SnapshotId — (String)

          The ID of the snapshot.

        • VolumeSize — (Integer)

          The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.

          The following are the supported volumes sizes for each volume type:

          • gp2 and gp3:1-16,384

          • io1 and io2: 4-16,384

          • st1 and sc1: 125-16,384

          • standard: 1-1,024

        • VolumeType — (String)

          The volume type. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide. If the volume type is io1 or io2, you must specify the IOPS that the volume supports.

          Possible values include:
          • "standard"
          • "io1"
          • "io2"
          • "gp2"
          • "sc1"
          • "st1"
          • "gp3"
        • KmsKeyId — (String)

          Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.

          This parameter is only supported on BlockDeviceMapping objects called by RunInstances, RequestSpotFleet, and RequestSpotInstances.

        • Throughput — (Integer)

          The throughput that the volume supports, in MiB/s.

          This parameter is valid only for gp3 volumes.

          Valid Range: Minimum value of 125. Maximum value of 1000.

        • OutpostArn — (String)

          The ARN of the Outpost on which the snapshot is stored.

        • Encrypted — (Boolean)

          Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS encryption in the Amazon EC2 User Guide.

          In no case can you remove encryption from an encrypted volume.

          Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types.

          This parameter is not returned by .

      • NoDevice — (String)

        To omit the device from the block device mapping, specify an empty string. When this property is specified, the device is removed from the block device mapping regardless of the assigned value.

    • 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. Without a reboot, the AMI will be crash consistent (all the volumes are snapshotted at the same time), but not application consistent (all the operating system buffers are not flushed to disk before the snapshots are created).

    • TagSpecifications — (Array<map>)

      The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.

      • To tag the AMI, the value for ResourceType must be image.

      • To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the instance, the value for ResourceType must be snapshot. The same tag is applied to all of the snapshots that are created.

      If you specify other values for ResourceType, the request fails.

      To tag an AMI or snapshot after it has been created, see CreateTags.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • ImageId — (String)

        The ID of the new AMI.

Returns:

  • (AWS.Request)

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

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

Creates an event window in which scheduled events for the associated Amazon EC2 instances can run.

You can define either a set of time ranges or a cron expression when creating the event window, but not both. All event window times are in UTC.

You can create up to 200 event windows per Amazon Web Services Region.

When you create the event window, targets (instance IDs, Dedicated Host IDs, or tags) are not yet associated with it. To ensure that the event window can be used, you must associate one or more targets with it by using the AssociateInstanceEventWindow API.

Event windows are applicable only for scheduled events that stop, reboot, or terminate instances.

Event windows are not applicable for:

  • Expedited scheduled events and network maintenance events.

  • Unscheduled maintenance such as AutoRecovery and unplanned reboots.

For more information, see Define event windows for scheduled events in the Amazon EC2 User Guide.

Service Reference:

Examples:

Calling the createInstanceEventWindow operation

var params = {
  CronExpression: 'STRING_VALUE',
  DryRun: true || false,
  Name: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  TimeRanges: [
    {
      EndHour: 'NUMBER_VALUE',
      EndWeekDay: sunday | monday | tuesday | wednesday | thursday | friday | saturday,
      StartHour: 'NUMBER_VALUE',
      StartWeekDay: sunday | monday | tuesday | wednesday | thursday | friday | saturday
    },
    /* more items */
  ]
};
ec2.createInstanceEventWindow(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.

    • Name — (String)

      The name of the event window.

    • TimeRanges — (Array<map>)

      The time range for the event window. If you specify a time range, you can't specify a cron expression.

      • StartWeekDay — (String)

        The day on which the time range begins.

        Possible values include:
        • "sunday"
        • "monday"
        • "tuesday"
        • "wednesday"
        • "thursday"
        • "friday"
        • "saturday"
      • StartHour — (Integer)

        The hour when the time range begins.

      • EndWeekDay — (String)

        The day on which the time range ends.

        Possible values include:
        • "sunday"
        • "monday"
        • "tuesday"
        • "wednesday"
        • "thursday"
        • "friday"
        • "saturday"
      • EndHour — (Integer)

        The hour when the time range ends.

    • CronExpression — (String)

      The cron expression for the event window, for example, * 0-4,20-23 * * 1,5. If you specify a cron expression, you can't specify a time range.

      Constraints:

      • Only hour and day of the week values are supported.

      • For day of the week values, you can specify either integers 0 through 6, or alternative single values SUN through SAT.

      • The minute, month, and year must be specified by *.

      • The hour value must be one or a multiple range, for example, 0-4 or 0-4,20-23.

      • Each hour range must be >= 2 hours, for example, 0-2 or 20-23.

      • The event window must be >= 4 hours. The combined total time ranges in the event window must be >= 4 hours.

      For more information about cron expressions, see cron on the Wikipedia website.

    • TagSpecifications — (Array<map>)

      The tags to apply to the event window.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • InstanceEventWindow — (map)

        Information about the event window.

        • InstanceEventWindowId — (String)

          The ID of the event window.

        • TimeRanges — (Array<map>)

          One or more time ranges defined for the event window.

          • StartWeekDay — (String)

            The day on which the time range begins.

            Possible values include:
            • "sunday"
            • "monday"
            • "tuesday"
            • "wednesday"
            • "thursday"
            • "friday"
            • "saturday"
          • StartHour — (Integer)

            The hour when the time range begins.

          • EndWeekDay — (String)

            The day on which the time range ends.

            Possible values include:
            • "sunday"
            • "monday"
            • "tuesday"
            • "wednesday"
            • "thursday"
            • "friday"
            • "saturday"
          • EndHour — (Integer)

            The hour when the time range ends.

        • Name — (String)

          The name of the event window.

        • CronExpression — (String)

          The cron expression defined for the event window.

        • AssociationTarget — (map)

          One or more targets associated with the event window.

          • InstanceIds — (Array<String>)

            The IDs of the instances associated with the event window.

          • Tags — (Array<map>)

            The instance tags associated with the event window. Any instances associated with the tags will be associated with the event window.

            • 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.

          • DedicatedHostIds — (Array<String>)

            The IDs of the Dedicated Hosts associated with the event window.

        • State — (String)

          The current state of the event window.

          Possible values include:
          • "creating"
          • "deleting"
          • "active"
          • "deleted"
        • Tags — (Array<map>)

          The instance tags associated with the event window.

          • 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.

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

Exports a running or stopped instance to an Amazon 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 = {
  ExportToS3Task: { /* required */
    ContainerFormat: ova,
    DiskImageFormat: VMDK | RAW | VHD,
    S3Bucket: 'STRING_VALUE',
    S3Prefix: 'STRING_VALUE'
  },
  InstanceId: 'STRING_VALUE', /* required */
  TargetEnvironment: citrix | vmware | microsoft, /* required */
  Description: 'STRING_VALUE',
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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 characters.

    • ExportToS3Task — (map)

      The format and location for an export instance 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 Amazon S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the Amazon Web Services account vm-import-export@amazon.com.

      • S3Prefix — (String)

        The image is written to a single object in the Amazon 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"
    • TagSpecifications — (Array<map>)

      The tags to apply to the export instance task during creation.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • ExportTask — (map)

        Information about the export instance 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 Amazon S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the Amazon Web Services 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.

        • Tags — (Array<map>)

          The tags for the export task.

          • 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.

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,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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: {})
    • TagSpecifications — (Array<map>)

      The tags to assign to the internet gateway.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • 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.

        • OwnerId — (String)

          The ID of the Amazon Web Services account that owns 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 an ED25519 or 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.

The key pair returned to you is available only in the Amazon Web Services 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.

You can have up to 5,000 key pairs per Amazon Web Services Region.

For more information, see Amazon EC2 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,
  KeyType: rsa | ed25519,
  TagSpecifications: [
    {
      ResourceType: capacity-reservation | client-vpn-endpoint | customer-gateway | carrier-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image | import-image-task | import-snapshot-task | instance | instance-event-window | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway | local-gateway-route-table | local-gateway-virtual-interface | local-gateway-virtual-interface-group | local-gateway-route-table-vpc-association | local-gateway-route-table-virtual-interface-group-association | natgateway | network-acl | network-interface | network-insights-analysis | network-insights-path | placement-group | prefix-list | replace-root-volume-task | reserved-instances | route-table | security-group | security-group-rule | snapshot | spot-fleet-request | spot-instances-request | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-connect-peer | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection | vpn-connection | vpn-gateway | vpc-flow-log,
      Tags: [
        {
          Key: 'STRING_VALUE',
          Value: 'STRING_VALUE'
        },
        /* more items */
      ]
    },
    /* more items */
  ]
};
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.

    • KeyType — (String)

      The type of key pair. Note that ED25519 keys are not supported for Windows instances, EC2 Instance Connect, and EC2 Serial Console.

      Default: rsa

      Possible values include:
      • "rsa"
      • "ed25519"
    • TagSpecifications — (Array<map>)

      The tags to apply to the new key pair.

      • ResourceType — (String)

        The type of resource to tag on creation.

        Possible values include:
        • "capacity-reservation"
        • "client-vpn-endpoint"
        • "customer-gateway"
        • "carrier-gateway"
        • "dedicated-host"
        • "dhcp-options"
        • "egress-only-internet-gateway"
        • "elastic-ip"
        • "elastic-gpu"
        • "export-image-task"
        • "export-instance-task"
        • "fleet"
        • "fpga-image"
        • "host-reservation"
        • "image"
        • "import-image-task"
        • "import-snapshot-task"
        • "instance"
        • "instance-event-window"
        • "internet-gateway"
        • "ipv4pool-ec2"
        • "ipv6pool-ec2"
        • "key-pair"
        • "launch-template"
        • "local-gateway"
        • "local-gateway-route-table"
        • "local-gateway-virtual-interface"
        • "local-gateway-virtual-interface-group"
        • "local-gateway-route-table-vpc-association"
        • "local-gateway-route-table-virtual-interface-group-association"
        • "natgateway"
        • "network-acl"
        • "network-interface"
        • "network-insights-analysis"
        • "network-insights-path"
        • "placement-group"
        • "prefix-list"
        • "replace-root-volume-task"
        • "reserved-instances"
        • "route-table"
        • "security-group"
        • "security-group-rule"
        • "snapshot"
        • "spot-fleet-request"
        • "spot-instances-request"
        • "subnet"
        • "traffic-mirror-filter"
        • "traffic-mirror-session"
        • "traffic-mirror-target"
        • "transit-gateway"
        • "transit-gateway-attachment"
        • "transit-gateway-connect-peer"
        • "transit-gateway-multicast-domain"
        • "transit-gateway-route-table"
        • "volume"
        • "vpc"
        • "vpc-endpoint"
        • "vpc-endpoint-service"
        • "vpc-peering-connection"
        • "vpn-connection"
        • "vpn-gateway"
        • "vpc-flow-log"
      • 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:

      • KeyFingerprint — (String)

        The SHA-1 digest of the DER encoded private key.

      • KeyMaterial — (String)

        An unencrypted PEM encoded RSA or ED25519 private key.

      • KeyName — (String)

        The name of the key pair.

      • KeyPairId — (String)

        The ID of the key pair.

      • Tags — (Array<map>)

        Any tags applied to the key pair.

        • 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.

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. For more information, see Launching an instance from a launch template in the Amazon Elastic Compute Cloud User Guide.

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: 'NUMBER_VALUE',
          KmsKeyId: 'STRING_VALUE',
          SnapshotId: 'STRING_VALUE',
          Throughput: 'NUMBER_VALUE',
          VolumeSize: 'NUMBER_VALUE',
          VolumeType: standard | io1 | io2 | gp2 | sc1 | st1 | gp3
        },
        NoDevice: 'STRING_VALUE',
        VirtualName: 'STRING_VALUE'
      },
      /* more items */
    ],
    CapacityReservationSpecification: {
      CapacityReservationPreference: open | none,
      CapacityReservationTarget: {
        CapacityReservationId: 'STRING_VALUE',
        CapacityReservationResourceGroupArn: 'STRING_VALUE'
      }
    },
    CpuOptions: {
      CoreCount: 'NUMBER_VALUE',
      ThreadsPerCore: 'NUMBER_VALUE'
    },
    CreditSpecification: {
      CpuCredits: 'STRING_VALUE' /* required */
    },
    DisableApiTermination: true || false,
    EbsOptimized: true || false,
    ElasticGpuSpecifications: [
      {
        Type: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    ElasticInferenceAccelerators: [
      {
        Type: 'STRING_VALUE', /* required */
        Count: 'NUMBER_VALUE'
      },
      /* more items */
    ],
    EnclaveOptions: {
      Enabled: true || false
    },
    HibernationOptions: {
      Configured: true || false
    },
    IamInstanceProfile: {
      Arn: 'STRING_VALUE',
      Name: 'STRING_VALUE'
    },
    ImageId: 'STRING_VALUE',
    InstanceInitiatedShutdownBehavior: stop | terminate,
    InstanceMarketOptions: {
      MarketType: spot,
      SpotOptions: {
        BlockDurationMinutes: 'NUMBER_VALUE',
        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 | t3a.nano | t3a.micro | t3a.small | t3a.medium | t3a.large | t3a.xlarge | t3a.2xlarge | t4g.nano | t4g.micro | t4g.small | t4g.medium | t4g.large | t4g.xlarge | t4g.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.8xlarge | r5a.12xlarge | r5a.16xlarge | r5a.24xlarge | r5b.large | r5b.xlarge | r5b.2xlarge | r5b.4xlarge | r5b.8xlarge | r5b.12xlarge | r5b.16xlarge | r5b.24xlarge | r5b.metal | r5d.large | r5d.xlarge | r5d.2xlarge | r5d.4xlarge | r5d.8xlarge | r5d.12xlarge | r5d.16xlarge | r5d.24xlarge | r5d.metal | r5ad.large | r5ad.xlarge | r5ad.2xlarge | r5ad.4xlarge | r5ad.8xlarge | r5ad.12xlarge | r5ad.16xlarge | r5ad.24xlarge | r6g.metal | r6g.medium | r6g.large | r6g.xlarge | r6g.2xlarge | r6g.4xlarge | r6g.8xlarge | r6g.12xlarge | r6g.16xlarge | r6gd.metal | r6gd.medium | r6gd.large | r6gd.xlarge | r6gd.2xlarge | r6gd.4xlarge | r6gd.8xlarge | r6gd.12xlarge | r6gd.16xlarge | 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 | i3en.large | i3en.xlarge | i3en.2xlarge | i3en.3xlarge | i3en.6xlarge | i3en.12xlarge | i3en.24xlarge | i3en.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.12xlarge | c5.18xlarge | c5.24xlarge | c5.metal | c5a.large | c5a.xlarge | c5a.2xlarge | c5a.4xlarge | c5a.8xlarge | c5a.12xlarge | c5a.16xlarge | c5a.24xlarge | c5ad.large | c5ad.xlarge | c5ad.2xlarge | c5ad.4xlarge | c5ad.8xlarge | c5ad.12xlarge | c5ad.16xlarge | c5ad.24xlarge | c5d.large | c5d.xlarge | c5d.2xlarge | c5d.4xlarge | c5d.9xlarge | c5d.12xlarge | c5d.18xlarge | c5d.24xlarge | c5d.metal | c5n.large | c5n.xlarge | c5n.2xlarge | c5n.4xlarge | c5n.9xlarge | c5n.18xlarge | c5n.metal | c6g.metal | c6g.medium | c6g.large | c6g.xlarge | c6g.2xlarge | c6g.4xlarge | c6g.8xlarge | c6g.12xlarge | c6g.16xlarge | c6gd.metal | c6gd.medium | c6gd.large | c6gd.xlarge | c6gd.2xlarge | c6gd.4xlarge | c6gd.8xlarge | c6gd.12xlarge | c6gd.16xlarge | c6gn.medium | c6gn.large | c6gn.xlarge | c6gn.2xlarge | c6gn.4xlarge | c6gn.8xlarge | c6gn.12xlarge | c6gn.16xlarge | cc1.4xlarge | cc2.8xlarge | g2.2xlarge | g2.8xlarge | g3.4