AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: AWS.CostExplorer

Inherits:
AWS.Service show all
Identifier:
costexplorer
API Version:
2017-10-25
Defined in:
(unknown)

Overview

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

Service Description

The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for Amazon DynamoDB database tables in your production environment.

Service Endpoint

The Cost Explorer API provides the following endpoint:

For information about costs associated with the Cost Explorer API, see AWS Cost Management Pricing.

Sending a Request Using CostExplorer

var costexplorer = new AWS.CostExplorer();
costexplorer.getCostAndUsage(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 CostExplorer object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var costexplorer = new AWS.CostExplorer({apiVersion: '2017-10-25'});

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

AWS.config.apiVersions = {
  costexplorer: '2017-10-25',
  // other service API versions
};

var costexplorer = new AWS.CostExplorer();

Version:

  • 2017-10-25

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

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

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

Examples:

Constructing a CostExplorer object

var costexplorer = new AWS.CostExplorer({apiVersion: '2017-10-25'});

Options Hash (options):

  • params (map)

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

  • endpoint (String)

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

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

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

  • credentialProvider (AWS.CredentialProviderChain)

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

  • region (String)

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

  • maxRetries (Integer)

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

  • maxRedirects (Integer)

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

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

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

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

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

  • convertResponseTypes (Boolean)

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

  • correctClockSkew (Boolean)

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

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

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

  • s3DisableBodySigning (Boolean)

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

  • retryDelayOptions (map)

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

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and 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.
  • 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)

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

  • endpointCacheSize (Number)

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

  • 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

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

Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. You can also filter and group your data by various dimensions, such as SERVICE or AZ, in a specific time range. For a complete list of valid dimensions, see the GetDimensionValues operation. Master accounts in an organization in AWS Organizations have access to all member accounts.

Service Reference:

Examples:

Calling the getCostAndUsage operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY,
  GroupBy: [
    {
      Key: 'STRING_VALUE',
      Type: DIMENSION | TAG
    },
    /* more items */
  ],
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ],
  NextPageToken: 'STRING_VALUE'
};
costexplorer.getCostAndUsage(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: {})
    • TimePeriod — (map)

      Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Granularity — (String)

      Sets the AWS cost granularity to MONTHLY or DAILY, or HOURLY. If Granularity isn't set, the response object doesn't include the Granularity, either MONTHLY or DAILY, or HOURLY.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters AWS costs by different dimensions. For example, you can specify SERVICE and LINKED_ACCOUNT and get the costs that are associated with that account's usage of that service. You can nest Expression objects to define any combination of dimension filters. For more information, see Expression.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • Metrics — (Array<String>)

      Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill?.

      Valid values are AmortizedCost, BlendedCost, NetAmortizedCost, NetUnblendedCost, NormalizedUsageAmount, UnblendedCost, and UsageQuantity.

      Note: If you return the UsageQuantity metric, the service aggregates all usage numbers without taking into account the units. For example, if you aggregate usageQuantity across all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType or UsageTypeGroups.

      Metrics is required for GetCostAndUsage requests.

    • GroupBy — (Array<map>)

      You can group AWS costs using up to two different groups, either dimensions, tag keys, or both.

      When you group by tag key, you get all tag values, including empty strings.

      Valid values are AZ, INSTANCE_TYPE, LEGAL_ENTITY_NAME, LINKED_ACCOUNT, OPERATION, PLATFORM, PURCHASE_TYPE, SERVICE, TAGS, TENANCY, RECORD_TYPE, and USAGE_TYPE.

      • Type — (String)

        The string that represents the type of group.

        Possible values include:
        • "DIMENSION"
        • "TAG"
      • Key — (String)

        The string that represents a key for a specified group.

    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

      • GroupDefinitions — (Array<map>)

        The groups that are specified by the Filter or GroupBy parameters in the request.

        • Type — (String)

          The string that represents the type of group.

          Possible values include:
          • "DIMENSION"
          • "TAG"
        • Key — (String)

          The string that represents a key for a specified group.

      • ResultsByTime — (Array<map>)

        The time period that is covered by the results in the response.

        • TimePeriod — (map)

          The time period that the result covers.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • Total — (map<map>)

          The total amount of cost or usage accrued during the time period.

          • Amount — (String)

            The actual number that represents the metric.

          • Unit — (String)

            The unit that the metric is given in.

        • Groups — (Array<map>)

          The groups that this time period includes.

          • Keys — (Array<String>)

            The keys that are included in this group.

          • Metrics — (map<map>)

            The metrics that are included in this group.

            • Amount — (String)

              The actual number that represents the metric.

            • Unit — (String)

              The unit that the metric is given in.

        • Estimated — (Boolean)

          Whether the result is estimated.

Returns:

  • (AWS.Request)

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

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

Retrieves cost and usage metrics with resources for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. You can also filter and group your data by various dimensions, such as SERVICE or AZ, in a specific time range. For a complete list of valid dimensions, see the GetDimensionValues operation. Master accounts in an organization in AWS Organizations have access to all member accounts. This API is currently available for the Amazon Elastic Compute Cloud – Compute service only.

Note: This is an opt-in only feature. You can enable this feature from the Cost Explorer Settings page. For information on how to access the Settings page, see Controlling Access for Cost Explorer in the AWS Billing and Cost Management User Guide.

Service Reference:

Examples:

Calling the getCostAndUsageWithResources operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY,
  GroupBy: [
    {
      Key: 'STRING_VALUE',
      Type: DIMENSION | TAG
    },
    /* more items */
  ],
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ],
  NextPageToken: 'STRING_VALUE'
};
costexplorer.getCostAndUsageWithResources(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: {})
    • TimePeriod — (map)

      Sets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last 14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Granularity — (String)

      Sets the AWS cost granularity to MONTHLY, DAILY, or HOURLY. If Granularity isn't set, the response object doesn't include the Granularity, MONTHLY, DAILY, or HOURLY.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters Amazon Web Services costs by different dimensions. For example, you can specify SERVICE and LINKED_ACCOUNT and get the costs that are associated with that account's usage of that service. You can nest Expression objects to define any combination of dimension filters. For more information, see Expression.

      The GetCostAndUsageWithResources operation requires that you either group by or filter by a ResourceId.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • Metrics — (Array<String>)

      Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill?.

      Valid values are AmortizedCost, BlendedCost, NetAmortizedCost, NetUnblendedCost, NormalizedUsageAmount, UnblendedCost, and UsageQuantity.

      Note: If you return the UsageQuantity metric, the service aggregates all usage numbers without taking the units into account. For example, if you aggregate usageQuantity across all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType or UsageTypeGroups.

      Metrics is required for GetCostAndUsageWithResources requests.

    • GroupBy — (Array<map>)

      You can group Amazon Web Services costs using up to two different groups: either dimensions, tag keys, or both.

      • Type — (String)

        The string that represents the type of group.

        Possible values include:
        • "DIMENSION"
        • "TAG"
      • Key — (String)

        The string that represents a key for a specified group.

    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

      • GroupDefinitions — (Array<map>)

        The groups that are specified by the Filter or GroupBy parameters in the request.

        • Type — (String)

          The string that represents the type of group.

          Possible values include:
          • "DIMENSION"
          • "TAG"
        • Key — (String)

          The string that represents a key for a specified group.

      • ResultsByTime — (Array<map>)

        The time period that is covered by the results in the response.

        • TimePeriod — (map)

          The time period that the result covers.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • Total — (map<map>)

          The total amount of cost or usage accrued during the time period.

          • Amount — (String)

            The actual number that represents the metric.

          • Unit — (String)

            The unit that the metric is given in.

        • Groups — (Array<map>)

          The groups that this time period includes.

          • Keys — (Array<String>)

            The keys that are included in this group.

          • Metrics — (map<map>)

            The metrics that are included in this group.

            • Amount — (String)

              The actual number that represents the metric.

            • Unit — (String)

              The unit that the metric is given in.

        • Estimated — (Boolean)

          Whether the result is estimated.

Returns:

  • (AWS.Request)

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

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

Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs.

Service Reference:

Examples:

Calling the getCostForecast operation

var params = {
  Granularity: DAILY | MONTHLY | HOURLY, /* required */
  Metric: BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT, /* required */
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  PredictionIntervalLevel: 'NUMBER_VALUE'
};
costexplorer.getCostForecast(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: {})
    • TimePeriod — (map)

      The period of time that you want the forecast to cover.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Metric — (String)

      Which metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill?.

      Valid values for a GetCostForecast call are the following:

      • AMORTIZED_COST

      • BLENDED_COST

      • NET_AMORTIZED_COST

      • NET_UNBLENDED_COST

      • UNBLENDED_COST

      Possible values include:
      • "BLENDED_COST"
      • "UNBLENDED_COST"
      • "AMORTIZED_COST"
      • "NET_UNBLENDED_COST"
      • "NET_AMORTIZED_COST"
      • "USAGE_QUANTITY"
      • "NORMALIZED_USAGE_AMOUNT"
    • Granularity — (String)

      How granular you want the forecast to be. You can get 3 months of DAILY forecasts or 12 months of MONTHLY forecasts.

      The GetCostForecast operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      The filters that you want to use to filter your forecast. Cost Explorer API supports all of the Cost Explorer filters.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • PredictionIntervalLevel — (Integer)

      Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.

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:

      • Total — (map)

        How much you are forecasted to spend over the forecast period, in USD.

        • Amount — (String)

          The actual number that represents the metric.

        • Unit — (String)

          The unit that the metric is given in.

      • ForecastResultsByTime — (Array<map>)

        The forecasts for your query, in order. For DAILY forecasts, this is a list of days. For MONTHLY forecasts, this is a list of months.

        • TimePeriod — (map)

          The period of time that the forecast covers.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • MeanValue — (String)

          The mean value of the forecast.

        • PredictionIntervalLowerBound — (String)

          The lower limit for the prediction interval.

        • PredictionIntervalUpperBound — (String)

          The upper limit for the prediction interval.

Returns:

  • (AWS.Request)

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

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

Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.

Service Reference:

Examples:

Calling the getDimensionValues operation

var params = {
  Dimension: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION, /* required */
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Context: COST_AND_USAGE | RESERVATIONS | SAVINGS_PLANS,
  NextPageToken: 'STRING_VALUE',
  SearchString: 'STRING_VALUE'
};
costexplorer.getDimensionValues(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: {})
    • SearchString — (String)

      The value that you want to search the filter values for.

    • TimePeriod — (map)

      The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Dimension — (String)

      The name of the dimension. Each Dimension is available for a different Context. For more information, see Context.

      Possible values include:
      • "AZ"
      • "INSTANCE_TYPE"
      • "LINKED_ACCOUNT"
      • "OPERATION"
      • "PURCHASE_TYPE"
      • "REGION"
      • "SERVICE"
      • "USAGE_TYPE"
      • "USAGE_TYPE_GROUP"
      • "RECORD_TYPE"
      • "OPERATING_SYSTEM"
      • "TENANCY"
      • "SCOPE"
      • "PLATFORM"
      • "SUBSCRIPTION_ID"
      • "LEGAL_ENTITY_NAME"
      • "DEPLOYMENT_OPTION"
      • "DATABASE_ENGINE"
      • "CACHE_ENGINE"
      • "INSTANCE_TYPE_FAMILY"
      • "BILLING_ENTITY"
      • "RESERVATION_ID"
      • "RESOURCE_ID"
      • "RIGHTSIZING_TYPE"
      • "SAVINGS_PLANS_TYPE"
      • "SAVINGS_PLAN_ARN"
      • "PAYMENT_OPTION"
    • Context — (String)

      The context for the call to GetDimensionValues. This can be RESERVATIONS or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is set to RESERVATIONS, the resulting dimension values can be used in the GetReservationUtilization operation. If the context is set to COST_AND_USAGE, the resulting dimension values can be used in the GetCostAndUsage operation.

      If you set the context to COST_AND_USAGE, you can use the following dimensions for searching:

      • AZ - The Availability Zone. An example is us-east-1a.

      • DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.

      • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

      • LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services.

      • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

      • OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.

      • OPERATION - The action performed. Examples include RunInstance and CreateBucket.

      • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

      • PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances.

      • SERVICE - The AWS service such as Amazon DynamoDB.

      • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.

      • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.

      • RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits.

      • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.

      If you set the context to RESERVATIONS, you can use the following dimensions for searching:

      • AZ - The Availability Zone. An example is us-east-1a.

      • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

      • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

      • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

      • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

      • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

      • REGION - The AWS Region.

      • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.

      • TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).

      • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

      If you set the context to SAVINGS_PLANS, you can use the following dimensions for searching:

      • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)

      • PAYMENT_OPTION - Payment option for the given Savings Plans (for example, All Upfront)

      • REGION - The AWS Region.

      • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5)

      • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

      • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plan

      Possible values include:
      • "COST_AND_USAGE"
      • "RESERVATIONS"
      • "SAVINGS_PLANS"
    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • DimensionValues — (Array<map>)

        The filters that you used to filter your request. Some dimensions are available only for a specific context.

        If you set the context to COST_AND_USAGE, you can use the following dimensions for searching:

        • AZ - The Availability Zone. An example is us-east-1a.

        • DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.

        • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

        • LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services.

        • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

        • OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.

        • OPERATION - The action performed. Examples include RunInstance and CreateBucket.

        • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

        • PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances.

        • SERVICE - The AWS service such as Amazon DynamoDB.

        • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.

        • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.

        • RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits.

        • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.

        If you set the context to RESERVATIONS, you can use the following dimensions for searching:

        • AZ - The Availability Zone. An example is us-east-1a.

        • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

        • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

        • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

        • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

        • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

        • REGION - The AWS Region.

        • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.

        • TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).

        • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

        If you set the context to SAVINGS_PLANS, you can use the following dimensions for searching:

        • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)

        • PAYMENT_OPTION - Payment option for the given Savings Plans (for example, All Upfront)

        • REGION - The AWS Region.

        • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5)

        • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.

        • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plan

        • Value — (String)

          The value of a dimension with a specific attribute.

        • Attributes — (map<String>)

          The attribute that applies to a specific Dimension.

      • ReturnSize — (Integer)

        The number of results that AWS returned at one time.

      • TotalSize — (Integer)

        The total number of search results.

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Retrieves the reservation coverage for your account. This enables you to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's master account can see the coverage of the associated member accounts. For any time period, you can filter data about reservation usage by the following dimensions:

  • AZ

  • CACHE_ENGINE

  • DATABASE_ENGINE

  • DEPLOYMENT_OPTION

  • INSTANCE_TYPE

  • LINKED_ACCOUNT

  • OPERATING_SYSTEM

  • PLATFORM

  • REGION

  • SERVICE

  • TAG

  • TENANCY

To determine valid values for a dimension, use the GetDimensionValues operation.

Service Reference:

Examples:

Calling the getReservationCoverage operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY,
  GroupBy: [
    {
      Key: 'STRING_VALUE',
      Type: DIMENSION | TAG
    },
    /* more items */
  ],
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ],
  NextPageToken: 'STRING_VALUE'
};
costexplorer.getReservationCoverage(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: {})
    • TimePeriod — (map)

      The start and end dates of the period that you want to retrieve data about reservation coverage for. You can retrieve data for a maximum of 13 months: the last 12 months and the current month. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • GroupBy — (Array<map>)

      You can group the data by the following attributes:

      • AZ

      • CACHE_ENGINE

      • DATABASE_ENGINE

      • DEPLOYMENT_OPTION

      • INSTANCE_TYPE

      • LINKED_ACCOUNT

      • OPERATING_SYSTEM

      • PLATFORM

      • REGION

      • TENANCY

      • Type — (String)

        The string that represents the type of group.

        Possible values include:
        • "DIMENSION"
        • "TAG"
      • Key — (String)

        The string that represents a key for a specified group.

    • Granularity — (String)

      The granularity of the AWS cost data for the reservation. Valid values are MONTHLY and DAILY.

      If GroupBy is set, Granularity can't be set. If Granularity isn't set, the response object doesn't include Granularity, either MONTHLY or DAILY.

      The GetReservationCoverage operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters utilization data by dimensions. You can filter by the following dimensions:

      • AZ

      • CACHE_ENGINE

      • DATABASE_ENGINE

      • DEPLOYMENT_OPTION

      • INSTANCE_TYPE

      • LINKED_ACCOUNT

      • OPERATING_SYSTEM

      • PLATFORM

      • REGION

      • SERVICE

      • TAG

      • TENANCY

      GetReservationCoverage uses the same Expression object as the other operations, but only AND is supported among each dimension. You can nest only one level deep. If there are multiple values for a dimension, they are OR'd together.

      If you don't provide a SERVICE filter, Cost Explorer defaults to EC2.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • Metrics — (Array<String>)

      The measurement that you want your reservation coverage reported in.

      Valid values are Hour, Unit, and Cost. You can use multiple values in a request.

    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • CoveragesByTime — (Array<map>)

        The amount of time that your reservations covered.

        • TimePeriod — (map)

          The period that this coverage was used over.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • Groups — (Array<map>)

          The groups of instances that the reservation covered.

          • Attributes — (map<String>)

            The attributes for this group of reservations.

          • Coverage — (map)

            How much instance usage this group of reservations covered.

            • CoverageHours — (map)

              The amount of instance usage that the reservation covered, in hours.

              • OnDemandHours — (String)

                The number of instance running hours that On-Demand Instances covered.

              • ReservedHours — (String)

                The number of instance running hours that reservations covered.

              • TotalRunningHours — (String)

                The total instance usage, in hours.

              • CoverageHoursPercentage — (String)

                The percentage of instance hours that a reservation covered.

            • CoverageNormalizedUnits — (map)

              The amount of instance usage that the reservation covered, in normalized units.

              • OnDemandNormalizedUnits — (String)

                The number of normalized units that are covered by On-Demand Instances instead of a reservation.

              • ReservedNormalizedUnits — (String)

                The number of normalized units that a reservation covers.

              • TotalRunningNormalizedUnits — (String)

                The total number of normalized units that you used.

              • CoverageNormalizedUnitsPercentage — (String)

                The percentage of your used instance normalized units that a reservation covers.

            • CoverageCost — (map)

              The amount of cost that the reservation covered.

              • OnDemandCost — (String)

                How much an On-Demand instance cost.

        • Total — (map)

          The total reservation coverage, in hours.

          • CoverageHours — (map)

            The amount of instance usage that the reservation covered, in hours.

            • OnDemandHours — (String)

              The number of instance running hours that On-Demand Instances covered.

            • ReservedHours — (String)

              The number of instance running hours that reservations covered.

            • TotalRunningHours — (String)

              The total instance usage, in hours.

            • CoverageHoursPercentage — (String)

              The percentage of instance hours that a reservation covered.

          • CoverageNormalizedUnits — (map)

            The amount of instance usage that the reservation covered, in normalized units.

            • OnDemandNormalizedUnits — (String)

              The number of normalized units that are covered by On-Demand Instances instead of a reservation.

            • ReservedNormalizedUnits — (String)

              The number of normalized units that a reservation covers.

            • TotalRunningNormalizedUnits — (String)

              The total number of normalized units that you used.

            • CoverageNormalizedUnitsPercentage — (String)

              The percentage of your used instance normalized units that a reservation covers.

          • CoverageCost — (map)

            The amount of cost that the reservation covered.

            • OnDemandCost — (String)

              How much an On-Demand instance cost.

      • Total — (map)

        The total amount of instance usage that a reservation covered.

        • CoverageHours — (map)

          The amount of instance usage that the reservation covered, in hours.

          • OnDemandHours — (String)

            The number of instance running hours that On-Demand Instances covered.

          • ReservedHours — (String)

            The number of instance running hours that reservations covered.

          • TotalRunningHours — (String)

            The total instance usage, in hours.

          • CoverageHoursPercentage — (String)

            The percentage of instance hours that a reservation covered.

        • CoverageNormalizedUnits — (map)

          The amount of instance usage that the reservation covered, in normalized units.

          • OnDemandNormalizedUnits — (String)

            The number of normalized units that are covered by On-Demand Instances instead of a reservation.

          • ReservedNormalizedUnits — (String)

            The number of normalized units that a reservation covers.

          • TotalRunningNormalizedUnits — (String)

            The total number of normalized units that you used.

          • CoverageNormalizedUnitsPercentage — (String)

            The percentage of your used instance normalized units that a reservation covers.

        • CoverageCost — (map)

          The amount of cost that the reservation covered.

          • OnDemandCost — (String)

            How much an On-Demand instance cost.

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Gets recommendations for which reservations to purchase. These recommendations could help you reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.

AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of RI to purchase to maximize your estimated savings.

For example, AWS automatically aggregates your Amazon EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a size-flexible RI. AWS also shows the equal number of normalized units so that you can purchase any instance size that you want. For this example, your RI recommendation would be for c4.large because that is the smallest size instance in the c4 instance family.

Examples:

Calling the getReservationPurchaseRecommendation operation

var params = {
  Service: 'STRING_VALUE', /* required */
  AccountId: 'STRING_VALUE',
  AccountScope: PAYER | LINKED,
  LookbackPeriodInDays: SEVEN_DAYS | THIRTY_DAYS | SIXTY_DAYS,
  NextPageToken: 'STRING_VALUE',
  PageSize: 'NUMBER_VALUE',
  PaymentOption: NO_UPFRONT | PARTIAL_UPFRONT | ALL_UPFRONT | LIGHT_UTILIZATION | MEDIUM_UTILIZATION | HEAVY_UTILIZATION,
  ServiceSpecification: {
    EC2Specification: {
      OfferingClass: STANDARD | CONVERTIBLE
    }
  },
  TermInYears: ONE_YEAR | THREE_YEARS
};
costexplorer.getReservationPurchaseRecommendation(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: {})
    • AccountId — (String)

      The account ID that is associated with the recommendation.

    • Service — (String)

      The specific service that you want recommendations for.

    • AccountScope — (String)

      The account scope that you want recommendations for. PAYER means that AWS includes the master account and any member accounts when it calculates its recommendations. LINKED means that AWS includes only member accounts when it calculates its recommendations.

      Valid values are PAYER and LINKED.

      Possible values include:
      • "PAYER"
      • "LINKED"
    • LookbackPeriodInDays — (String)

      The number of previous days that you want AWS to consider when it calculates your recommendations.

      Possible values include:
      • "SEVEN_DAYS"
      • "THIRTY_DAYS"
      • "SIXTY_DAYS"
    • TermInYears — (String)

      The reservation term that you want recommendations for.

      Possible values include:
      • "ONE_YEAR"
      • "THREE_YEARS"
    • PaymentOption — (String)

      The reservation purchase option that you want recommendations for.

      Possible values include:
      • "NO_UPFRONT"
      • "PARTIAL_UPFRONT"
      • "ALL_UPFRONT"
      • "LIGHT_UTILIZATION"
      • "MEDIUM_UTILIZATION"
      • "HEAVY_UTILIZATION"
    • ServiceSpecification — (map)

      The hardware specifications for the service instances that you want recommendations for, such as standard or convertible Amazon EC2 instances.

      • EC2Specification — (map)

        The Amazon EC2 hardware specifications that you want AWS to provide recommendations for.

        • OfferingClass — (String)

          Whether you want a recommendation for standard or convertible reservations.

          Possible values include:
          • "STANDARD"
          • "CONVERTIBLE"
    • PageSize — (Integer)

      The number of recommendations that you want returned in a single response object.

    • NextPageToken — (String)

      The pagination token that indicates the next set of results that you want to retrieve.

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:

      • Metadata — (map)

        Information about this specific recommendation call, such as the time stamp for when Cost Explorer generated this recommendation.

        • RecommendationId — (String)

          The ID for this specific recommendation.

        • GenerationTimestamp — (String)

          The time stamp for when AWS made this recommendation.

      • Recommendations — (Array<map>)

        Recommendations for reservations to purchase.

        • AccountScope — (String)

          The account scope that AWS recommends that you purchase this instance for. For example, you can purchase this reservation for an entire organization in AWS Organizations.

          Possible values include:
          • "PAYER"
          • "LINKED"
        • LookbackPeriodInDays — (String)

          How many days of previous usage that AWS considers when making this recommendation.

          Possible values include:
          • "SEVEN_DAYS"
          • "THIRTY_DAYS"
          • "SIXTY_DAYS"
        • TermInYears — (String)

          The term of the reservation that you want recommendations for, in years.

          Possible values include:
          • "ONE_YEAR"
          • "THREE_YEARS"
        • PaymentOption — (String)

          The payment option for the reservation. For example, AllUpfront or NoUpfront.

          Possible values include:
          • "NO_UPFRONT"
          • "PARTIAL_UPFRONT"
          • "ALL_UPFRONT"
          • "LIGHT_UTILIZATION"
          • "MEDIUM_UTILIZATION"
          • "HEAVY_UTILIZATION"
        • ServiceSpecification — (map)

          Hardware specifications for the service that you want recommendations for.

          • EC2Specification — (map)

            The Amazon EC2 hardware specifications that you want AWS to provide recommendations for.

            • OfferingClass — (String)

              Whether you want a recommendation for standard or convertible reservations.

              Possible values include:
              • "STANDARD"
              • "CONVERTIBLE"
        • RecommendationDetails — (Array<map>)

          Details about the recommended purchases.

          • AccountId — (String)

            The account that this RI recommendation is for.

          • InstanceDetails — (map)

            Details about the instances that AWS recommends that you purchase.

            • EC2InstanceDetails — (map)

              The Amazon EC2 instances that AWS recommends that you purchase.

              • Family — (String)

                The instance family of the recommended reservation.

              • InstanceType — (String)

                The type of instance that AWS recommends.

              • Region — (String)

                The AWS Region of the recommended reservation.

              • AvailabilityZone — (String)

                The Availability Zone of the recommended reservation.

              • Platform — (String)

                The platform of the recommended reservation. The platform is the specific combination of operating system, license model, and software on an instance.

              • Tenancy — (String)

                Whether the recommended reservation is dedicated or shared.

              • CurrentGeneration — (Boolean)

                Whether the recommendation is for a current-generation instance.

              • SizeFlexEligible — (Boolean)

                Whether the recommended reservation is size flexible.

            • RDSInstanceDetails — (map)

              The Amazon RDS instances that AWS recommends that you purchase.

              • Family — (String)

                The instance family of the recommended reservation.

              • InstanceType — (String)

                The type of instance that AWS recommends.

              • Region — (String)

                The AWS Region of the recommended reservation.

              • DatabaseEngine — (String)

                The database engine that the recommended reservation supports.

              • DatabaseEdition — (String)

                The database edition that the recommended reservation supports.

              • DeploymentOption — (String)

                Whether the recommendation is for a reservation in a single Availability Zone or a reservation with a backup in a second Availability Zone.

              • LicenseModel — (String)

                The license model that the recommended reservation supports.

              • CurrentGeneration — (Boolean)

                Whether the recommendation is for a current-generation instance.

              • SizeFlexEligible — (Boolean)

                Whether the recommended reservation is size flexible.

            • RedshiftInstanceDetails — (map)

              The Amazon Redshift instances that AWS recommends that you purchase.

              • Family — (String)

                The instance family of the recommended reservation.

              • NodeType — (String)

                The type of node that AWS recommends.

              • Region — (String)

                The AWS Region of the recommended reservation.

              • CurrentGeneration — (Boolean)

                Whether the recommendation is for a current-generation instance.

              • SizeFlexEligible — (Boolean)

                Whether the recommended reservation is size flexible.

            • ElastiCacheInstanceDetails — (map)

              The ElastiCache instances that AWS recommends that you purchase.

              • Family — (String)

                The instance family of the recommended reservation.

              • NodeType — (String)

                The type of node that AWS recommends.

              • Region — (String)

                The AWS Region of the recommended reservation.

              • ProductDescription — (String)

                The description of the recommended reservation.

              • CurrentGeneration — (Boolean)

                Whether the recommendation is for a current generation instance.

              • SizeFlexEligible — (Boolean)

                Whether the recommended reservation is size flexible.

            • ESInstanceDetails — (map)

              The Amazon ES instances that AWS recommends that you purchase.

              • InstanceClass — (String)

                The class of instance that AWS recommends.

              • InstanceSize — (String)

                The size of instance that AWS recommends.

              • Region — (String)

                The AWS Region of the recommended reservation.

              • CurrentGeneration — (Boolean)

                Whether the recommendation is for a current-generation instance.

              • SizeFlexEligible — (Boolean)

                Whether the recommended reservation is size flexible.

          • RecommendedNumberOfInstancesToPurchase — (String)

            The number of instances that AWS recommends that you purchase.

          • RecommendedNormalizedUnitsToPurchase — (String)

            The number of normalized units that AWS recommends that you purchase.

          • MinimumNumberOfInstancesUsedPerHour — (String)

            The minimum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • MinimumNormalizedUnitsUsedPerHour — (String)

            The minimum number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • MaximumNumberOfInstancesUsedPerHour — (String)

            The maximum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • MaximumNormalizedUnitsUsedPerHour — (String)

            The maximum number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • AverageNumberOfInstancesUsedPerHour — (String)

            The average number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • AverageNormalizedUnitsUsedPerHour — (String)

            The average number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.

          • AverageUtilization — (String)

            The average utilization of your instances. AWS uses this to calculate your recommended reservation purchases.

          • EstimatedBreakEvenInMonths — (String)

            How long AWS estimates that it takes for this instance to start saving you money, in months.

          • CurrencyCode — (String)

            The currency code that AWS used to calculate the costs for this instance.

          • EstimatedMonthlySavingsAmount — (String)

            How much AWS estimates that this specific recommendation could save you in a month.

          • EstimatedMonthlySavingsPercentage — (String)

            How much AWS estimates that this specific recommendation could save you in a month, as a percentage of your overall costs.

          • EstimatedMonthlyOnDemandCost — (String)

            How much AWS estimates that you spend on On-Demand Instances in a month.

          • EstimatedReservationCostForLookbackPeriod — (String)

            How much AWS estimates that you would have spent for all usage during the specified historical period if you had a reservation.

          • UpfrontCost — (String)

            How much purchasing this instance costs you upfront.

          • RecurringStandardMonthlyCost — (String)

            How much purchasing this instance costs you on a monthly basis.

        • RecommendationSummary — (map)

          A summary about the recommended purchase.

          • TotalEstimatedMonthlySavingsAmount — (String)

            The total amount that AWS estimates that this recommendation could save you in a month.

          • TotalEstimatedMonthlySavingsPercentage — (String)

            The total amount that AWS estimates that this recommendation could save you in a month, as a percentage of your costs.

          • CurrencyCode — (String)

            The currency code used for this recommendation.

      • NextPageToken — (String)

        The pagination token for the next set of retrievable results.

Returns:

  • (AWS.Request)

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

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

Retrieves the reservation utilization for your account. Master accounts in an organization have access to member accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues to determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID.

Service Reference:

Examples:

Calling the getReservationUtilization operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY,
  GroupBy: [
    {
      Key: 'STRING_VALUE',
      Type: DIMENSION | TAG
    },
    /* more items */
  ],
  NextPageToken: 'STRING_VALUE'
};
costexplorer.getReservationUtilization(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: {})
    • TimePeriod — (map)

      Sets the start and end dates for retrieving RI utilization. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • GroupBy — (Array<map>)

      Groups only by SUBSCRIPTION_ID. Metadata is included.

      • Type — (String)

        The string that represents the type of group.

        Possible values include:
        • "DIMENSION"
        • "TAG"
      • Key — (String)

        The string that represents a key for a specified group.

    • Granularity — (String)

      If GroupBy is set, Granularity can't be set. If Granularity isn't set, the response object doesn't include Granularity, either MONTHLY or DAILY. If both GroupBy and Granularity aren't set, GetReservationUtilization defaults to DAILY.

      The GetReservationUtilization operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters utilization data by dimensions. You can filter by the following dimensions:

      • AZ

      • CACHE_ENGINE

      • DATABASE_ENGINE

      • DEPLOYMENT_OPTION

      • INSTANCE_TYPE

      • LINKED_ACCOUNT

      • OPERATING_SYSTEM

      • PLATFORM

      • REGION

      • SERVICE

      • SCOPE

      • TENANCY

      GetReservationUtilization uses the same Expression object as the other operations, but only AND is supported among each dimension, and nesting is supported up to only one level deep. If there are multiple values for a dimension, they are OR'd together.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • UtilizationsByTime — (Array<map>)

        The amount of time that you used your RIs.

        • TimePeriod — (map)

          The period of time that this utilization was used for.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • Groups — (Array<map>)

          The groups that this utilization result uses.

          • Key — (String)

            The key for a specific reservation attribute.

          • Value — (String)

            The value of a specific reservation attribute.

          • Attributes — (map<String>)

            The attributes for this group of reservations.

          • Utilization — (map)

            How much you used this group of reservations.

            • UtilizationPercentage — (String)

              The percentage of reservation time that you used.

            • UtilizationPercentageInUnits — (String)

              The percentage of Amazon EC2 reservation time that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

            • PurchasedHours — (String)

              How many reservation hours that you purchased.

            • PurchasedUnits — (String)

              How many Amazon EC2 reservation hours that you purchased, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

            • TotalActualHours — (String)

              The total number of reservation hours that you used.

            • TotalActualUnits — (String)

              The total number of Amazon EC2 reservation hours that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

            • UnusedHours — (String)

              The number of reservation hours that you didn't use.

            • UnusedUnits — (String)

              The number of Amazon EC2 reservation hours that you didn't use, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

            • OnDemandCostOfRIHoursUsed — (String)

              How much your reservation would cost if charged On-Demand rates.

            • NetRISavings — (String)

              How much you saved due to purchasing and utilizing reservation. AWS calculates this by subtracting TotalAmortizedFee from OnDemandCostOfRIHoursUsed.

            • TotalPotentialRISavings — (String)

              How much you could save if you use your entire reservation.

            • AmortizedUpfrontFee — (String)

              The upfront cost of your reservation, amortized over the reservation period.

            • AmortizedRecurringFee — (String)

              The monthly cost of your reservation, amortized over the reservation period.

            • TotalAmortizedFee — (String)

              The total cost of your reservation, amortized over the reservation period.

        • Total — (map)

          The total number of reservation hours that were used.

          • UtilizationPercentage — (String)

            The percentage of reservation time that you used.

          • UtilizationPercentageInUnits — (String)

            The percentage of Amazon EC2 reservation time that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

          • PurchasedHours — (String)

            How many reservation hours that you purchased.

          • PurchasedUnits — (String)

            How many Amazon EC2 reservation hours that you purchased, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

          • TotalActualHours — (String)

            The total number of reservation hours that you used.

          • TotalActualUnits — (String)

            The total number of Amazon EC2 reservation hours that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

          • UnusedHours — (String)

            The number of reservation hours that you didn't use.

          • UnusedUnits — (String)

            The number of Amazon EC2 reservation hours that you didn't use, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

          • OnDemandCostOfRIHoursUsed — (String)

            How much your reservation would cost if charged On-Demand rates.

          • NetRISavings — (String)

            How much you saved due to purchasing and utilizing reservation. AWS calculates this by subtracting TotalAmortizedFee from OnDemandCostOfRIHoursUsed.

          • TotalPotentialRISavings — (String)

            How much you could save if you use your entire reservation.

          • AmortizedUpfrontFee — (String)

            The upfront cost of your reservation, amortized over the reservation period.

          • AmortizedRecurringFee — (String)

            The monthly cost of your reservation, amortized over the reservation period.

          • TotalAmortizedFee — (String)

            The total cost of your reservation, amortized over the reservation period.

      • Total — (map)

        The total amount of time that you used your RIs.

        • UtilizationPercentage — (String)

          The percentage of reservation time that you used.

        • UtilizationPercentageInUnits — (String)

          The percentage of Amazon EC2 reservation time that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

        • PurchasedHours — (String)

          How many reservation hours that you purchased.

        • PurchasedUnits — (String)

          How many Amazon EC2 reservation hours that you purchased, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

        • TotalActualHours — (String)

          The total number of reservation hours that you used.

        • TotalActualUnits — (String)

          The total number of Amazon EC2 reservation hours that you used, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

        • UnusedHours — (String)

          The number of reservation hours that you didn't use.

        • UnusedUnits — (String)

          The number of Amazon EC2 reservation hours that you didn't use, converted to normalized units. Normalized units are available only for Amazon EC2 usage after November 11, 2017.

        • OnDemandCostOfRIHoursUsed — (String)

          How much your reservation would cost if charged On-Demand rates.

        • NetRISavings — (String)

          How much you saved due to purchasing and utilizing reservation. AWS calculates this by subtracting TotalAmortizedFee from OnDemandCostOfRIHoursUsed.

        • TotalPotentialRISavings — (String)

          How much you could save if you use your entire reservation.

        • AmortizedUpfrontFee — (String)

          The upfront cost of your reservation, amortized over the reservation period.

        • AmortizedRecurringFee — (String)

          The monthly cost of your reservation, amortized over the reservation period.

        • TotalAmortizedFee — (String)

          The total cost of your reservation, amortized over the reservation period.

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Creates recommendations that helps you save cost by identifying idle and underutilized Amazon EC2 instances.

Recommendations are generated to either downsize or terminate instances, along with providing savings detail and metrics. For details on calculation and function, see Optimizing Your Cost with Rightsizing Recommendations.

Service Reference:

Examples:

Calling the getRightsizingRecommendation operation

var params = {
  Service: 'STRING_VALUE', /* required */
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  NextPageToken: 'STRING_VALUE',
  PageSize: 'NUMBER_VALUE'
};
costexplorer.getRightsizingRecommendation(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: {})
    • Filter — (map)

      Use Expression to filter by cost or by usage. There are two patterns:

      • Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for REGION==us-east-1 OR REGION==us-west-1. The Expression for that looks like this:

        { "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", “us-west-1” ] } }

        The list of dimension values are OR'd together to retrieve cost or usage data. You can create Expression and DimensionValues objects using either with* methods or set* methods in multiple lines.

      • Compound dimension values with logical operations - You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. This allows you to filter on more advanced options. For example, you can filter on ((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer). The Expression for that looks like this:

        { "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] }

        Note: Because each Expression can have only one operator, the service returns an error if more than one is specified. The following example shows an Expression object that creates an error.

        { "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values": [ "DataTransfer" ] } }

      Note: For GetRightsizingRecommendation action, a combination of OR and NOT is not supported. OR is not supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT, REGION, or RIGHTSIZING_TYPE.
      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • Service — (String)

      The specific service that you want recommendations for. The only valid value for GetRightsizingRecommendation is "AmazonEC2".

    • PageSize — (Integer)

      The number of recommendations that you want returned in a single response object.

    • NextPageToken — (String)

      The pagination token that indicates the next set of results that you want to retrieve.

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:

      • Metadata — (map)

        Information regarding this specific recommendation set.

        • RecommendationId — (String)

          The ID for this specific recommendation.

        • GenerationTimestamp — (String)

          The time stamp for when Amazon Web Services made this recommendation.

        • LookbackPeriodInDays — (String)

          How many days of previous usage that Amazon Web Services considers when making this recommendation.

          Possible values include:
          • "SEVEN_DAYS"
          • "THIRTY_DAYS"
          • "SIXTY_DAYS"
      • Summary — (map)

        Summary of this recommendation set.

        • TotalRecommendationCount — (String)

          Total number of instance recommendations.

        • EstimatedTotalMonthlySavingsAmount — (String)

          Estimated total savings resulting from modifications, on a monthly basis.

        • SavingsCurrencyCode — (String)

          The currency code that Amazon Web Services used to calculate the savings.

        • SavingsPercentage — (String)

          Savings percentage based on the recommended modifications, relative to the total On Demand costs associated with these instances.

      • RightsizingRecommendations — (Array<map>)

        Recommendations to rightsize resources.

        • AccountId — (String)

          The account that this recommendation is for.

        • CurrentInstance — (map)

          Context regarding the current instance.

          • ResourceId — (String)

            Resource ID of the current instance.

          • Tags — (Array<map>)

            Cost allocation resource tags applied to the instance.

            • Key — (String)

              The key for the tag.

            • Values — (Array<String>)

              The specific value of the tag.

          • ResourceDetails — (map)

            Details about the resource and utilization.

            • EC2ResourceDetails — (map)

              Details on the Amazon EC2 resource.

              • HourlyOnDemandRate — (String)

                Hourly public On Demand rate for the instance type.

              • InstanceType — (String)

                The type of Amazon Web Services instance.

              • Platform — (String)

                The platform of the Amazon Web Services instance. The platform is the specific combination of operating system, license model, and software on an instance.

              • Region — (String)

                The Amazon Web Services Region of the instance.

              • Sku — (String)

                The SKU of the product.

              • Memory — (String)

                Memory capacity of Amazon Web Services instance.

              • NetworkPerformance — (String)

                Network performance capacity of the Amazon Web Services instance.

              • Storage — (String)

                The disk storage of the Amazon Web Services instance (Not EBS storage).

              • Vcpu — (String)

                Number of VCPU cores in the Amazon Web Services instance type.

          • ResourceUtilization — (map)

            Utilization information of the current instance during the lookback period.

            • EC2ResourceUtilization — (map)

              Utilization of current Amazon EC2 Instance

              • MaxCpuUtilizationPercentage — (String)

                Maximum observed or expected CPU utilization of the instance.

              • MaxMemoryUtilizationPercentage — (String)

                Maximum observed or expected memory utilization of the instance.

              • MaxStorageUtilizationPercentage — (String)

                Maximum observed or expected storage utilization of the instance (does not measure EBS storage).

          • ReservationCoveredHoursInLookbackPeriod — (String)

            Number of hours during the lookback period covered by reservations.

          • SavingsPlansCoveredHoursInLookbackPeriod — (String)

            Number of hours during the lookback period covered by Savings Plans.

          • OnDemandHoursInLookbackPeriod — (String)

            Number of hours during the lookback period billed at On Demand rates.

          • TotalRunningHoursInLookbackPeriod — (String)

            The total number of hours the instance ran during the lookback period.

          • MonthlyCost — (String)

            Current On Demand cost of operating this instance on a monthly basis.

          • CurrencyCode — (String)

            The currency code that Amazon Web Services used to calculate the costs for this instance.

        • RightsizingType — (String)

          Recommendation to either terminate or modify the resource.

          Possible values include:
          • "TERMINATE"
          • "MODIFY"
        • ModifyRecommendationDetail — (map)

          Details for modification recommendations.

          • TargetInstances — (Array<map>)

            Identifies whether this instance type is the Amazon Web Services default recommendation.

            • EstimatedMonthlyCost — (String)

              Expected cost to operate this instance type on a monthly basis.

            • EstimatedMonthlySavings — (String)

              Estimated savings resulting from modification, on a monthly basis.

            • CurrencyCode — (String)

              The currency code that Amazon Web Services used to calculate the costs for this instance.

            • DefaultTargetInstance — (Boolean)

              Indicates whether or not this recommendation is the defaulted Amazon Web Services recommendation.

            • ResourceDetails — (map)

              Details on the target instance type.

              • EC2ResourceDetails — (map)

                Details on the Amazon EC2 resource.

                • HourlyOnDemandRate — (String)

                  Hourly public On Demand rate for the instance type.

                • InstanceType — (String)

                  The type of Amazon Web Services instance.

                • Platform — (String)

                  The platform of the Amazon Web Services instance. The platform is the specific combination of operating system, license model, and software on an instance.

                • Region — (String)

                  The Amazon Web Services Region of the instance.

                • Sku — (String)

                  The SKU of the product.

                • Memory — (String)

                  Memory capacity of Amazon Web Services instance.

                • NetworkPerformance — (String)

                  Network performance capacity of the Amazon Web Services instance.

                • Storage — (String)

                  The disk storage of the Amazon Web Services instance (Not EBS storage).

                • Vcpu — (String)

                  Number of VCPU cores in the Amazon Web Services instance type.

            • ExpectedResourceUtilization — (map)

              Expected utilization metrics for target instance type.

              • EC2ResourceUtilization — (map)

                Utilization of current Amazon EC2 Instance

                • MaxCpuUtilizationPercentage — (String)

                  Maximum observed or expected CPU utilization of the instance.

                • MaxMemoryUtilizationPercentage — (String)

                  Maximum observed or expected memory utilization of the instance.

                • MaxStorageUtilizationPercentage — (String)

                  Maximum observed or expected storage utilization of the instance (does not measure EBS storage).

        • TerminateRecommendationDetail — (map)

          Details for termination recommendations.

          • EstimatedMonthlySavings — (String)

            Estimated savings resulting from modification, on a monthly basis.

          • CurrencyCode — (String)

            The currency code that Amazon Web Services used to calculate the costs for this instance.

      • NextPageToken — (String)

        The token to retrieve the next set of results.

Returns:

  • (AWS.Request)

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

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

Retrieves the Savings Plans covered for your account. This enables you to see how much of your cost is covered by a Savings Plan. An organization’s master account can see the coverage of the associated member accounts. For any time period, you can filter data for Savings Plans usage with the following dimensions:

  • LINKED_ACCOUNT

  • REGION

  • SERVICE

  • INSTANCE_FAMILY

To determine valid values for a dimension, use the GetDimensionValues operation.

Service Reference:

Examples:

Calling the getSavingsPlansCoverage operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY,
  GroupBy: [
    {
      Key: 'STRING_VALUE',
      Type: DIMENSION | TAG
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  Metrics: [
    'STRING_VALUE',
    /* more items */
  ],
  NextToken: 'STRING_VALUE'
};
costexplorer.getSavingsPlansCoverage(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: {})
    • TimePeriod — (map)

      The time period that you want the usage and costs for. The Start date must be within 13 months. The End date must be after the Start date, and before the current date. Future dates can't be used as an End date.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • GroupBy — (Array<map>)

      You can group the data using the attributes INSTANCE_FAMILY, REGION, or SERVICE.

      • Type — (String)

        The string that represents the type of group.

        Possible values include:
        • "DIMENSION"
        • "TAG"
      • Key — (String)

        The string that represents a key for a specified group.

    • Granularity — (String)

      The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity can't be set if GroupBy is set.

      The GetSavingsPlansCoverage operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:

      • LINKED_ACCOUNT

      • REGION

      • SERVICE

      • INSTANCE_FAMILY

      GetSavingsPlansCoverage uses the same Expression object as the other operations, but only AND is supported among each dimension. If there are multiple values for a dimension, they are OR'd together.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • Metrics — (Array<String>)

      The measurement that you want your Savings Plans coverage reported in. The only valid value is SpendCoveredBySavingsPlans.

    • NextToken — (String)

      The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

    • MaxResults — (Integer)

      The number of items to be returned in a response. The default is 20, with a minimum value of 1.

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:

      • SavingsPlansCoverages — (Array<map>)

        The amount of spend that your Savings Plans covered.

        • Attributes — (map<String>)

          The attribute that applies to a specific Dimension.

        • Coverage — (map)

          The amount of Savings Plans eligible usage that the Savings Plans covered.

          • SpendCoveredBySavingsPlans — (String)

            The amount of your Amazon Web Services usage that is covered by a Savings Plans.

          • OnDemandCost — (String)

            The cost of your Amazon Web Services usage at the public On-Demand rate.

          • TotalCost — (String)

            The total cost of your Amazon Web Services usage, regardless of your purchase option.

          • CoveragePercentage — (String)

            The percentage of your existing Savings Planscovered usage, divided by all of your eligible Savings Plans usage in an account(or set of accounts).

        • TimePeriod — (map)

          The time period that you want the usage and costs for.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

      • NextToken — (String)

        The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Retrieves your request parameters, Savings Plan Recommendations Summary and Details.

Examples:

Calling the getSavingsPlansPurchaseRecommendation operation

var params = {
  LookbackPeriodInDays: SEVEN_DAYS | THIRTY_DAYS | SIXTY_DAYS, /* required */
  PaymentOption: NO_UPFRONT | PARTIAL_UPFRONT | ALL_UPFRONT | LIGHT_UTILIZATION | MEDIUM_UTILIZATION | HEAVY_UTILIZATION, /* required */
  SavingsPlansType: COMPUTE_SP | EC2_INSTANCE_SP, /* required */
  TermInYears: ONE_YEAR | THREE_YEARS, /* required */
  NextPageToken: 'STRING_VALUE',
  PageSize: 'NUMBER_VALUE'
};
costexplorer.getSavingsPlansPurchaseRecommendation(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: {})
    • SavingsPlansType — (String)

      The Savings Plans recommendation type requested.

      Possible values include:
      • "COMPUTE_SP"
      • "EC2_INSTANCE_SP"
    • TermInYears — (String)

      The savings plan recommendation term used to generated these recommendations.

      Possible values include:
      • "ONE_YEAR"
      • "THREE_YEARS"
    • PaymentOption — (String)

      The payment option used to generate these recommendations.

      Possible values include:
      • "NO_UPFRONT"
      • "PARTIAL_UPFRONT"
      • "ALL_UPFRONT"
      • "LIGHT_UTILIZATION"
      • "MEDIUM_UTILIZATION"
      • "HEAVY_UTILIZATION"
    • NextPageToken — (String)

      The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

    • PageSize — (Integer)

      The number of recommendations that you want returned in a single response object.

    • LookbackPeriodInDays — (String)

      The lookback period used to generate the recommendation.

      Possible values include:
      • "SEVEN_DAYS"
      • "THIRTY_DAYS"
      • "SIXTY_DAYS"

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:

      • Metadata — (map)

        Information regarding this specific recommendation set.

        • RecommendationId — (String)

          The unique identifier for the recommendation set.

        • GenerationTimestamp — (String)

          The timestamp showing when the recommendations were generated.

      • SavingsPlansPurchaseRecommendation — (map)

        Contains your request parameters, Savings Plan Recommendations Summary, and Details.

        • SavingsPlansType — (String)

          The requested Savings Plans recommendation type.

          Possible values include:
          • "COMPUTE_SP"
          • "EC2_INSTANCE_SP"
        • TermInYears — (String)

          The Savings Plans recommendation term in years, used to generate the recommendation.

          Possible values include:
          • "ONE_YEAR"
          • "THREE_YEARS"
        • PaymentOption — (String)

          The payment option used to generate the recommendation.

          Possible values include:
          • "NO_UPFRONT"
          • "PARTIAL_UPFRONT"
          • "ALL_UPFRONT"
          • "LIGHT_UTILIZATION"
          • "MEDIUM_UTILIZATION"
          • "HEAVY_UTILIZATION"
        • LookbackPeriodInDays — (String)

          The lookback period in days, used to generate the recommendation.

          Possible values include:
          • "SEVEN_DAYS"
          • "THIRTY_DAYS"
          • "SIXTY_DAYS"
        • SavingsPlansPurchaseRecommendationDetails — (Array<map>)

          Details for the Savings Plans we recommend you to purchase to cover existing, Savings Plans eligible workloads.

          • SavingsPlansDetails — (map)

            Details for your recommended Savings Plans.

            • Region — (String)

              A collection of AWS resources in a geographic area. Each AWS Region is isolated and independent of the other Regions.

            • InstanceFamily — (String)

              A group of instance types that Savings Plans applies to.

            • OfferingId — (String)

              The unique ID used to distinguish Savings Plans from one another.

          • AccountId — (String)

            The AccountID the recommendation is generated for.

          • UpfrontCost — (String)

            The upfront cost of the recommended Savings Plans, based on the selected payment option.

          • EstimatedROI — (String)

            The estimated return on investment based on the recommended Savings Plans purchased. This is calculated as estimatedSavingsAmount/ estimatedSPCost*100.

          • CurrencyCode — (String)

            The currency code Amazon Web Services used to generate the recommendations and present potential savings.

          • EstimatedSPCost — (String)

            The cost of the recommended Savings Plans over the length of the lookback period.

          • EstimatedOnDemandCost — (String)

            The remaining On-Demand cost estimated to not be covered by the recommended Savings Plans, over the length of the lookback period.

          • EstimatedOnDemandCostWithCurrentCommitment — (String)

            The estimated On-Demand costs you would expect with no additional commitment, based on your usage of the selected time period and the Savings Plans you own.

          • EstimatedSavingsAmount — (String)

            The estimated savings amount based on the recommended Savings Plans over the length of the lookback period.

          • EstimatedSavingsPercentage — (String)

            The estimated savings percentage relative to the total cost of applicable On-Demand usage over the lookback period.

          • HourlyCommitmentToPurchase — (String)

            The recommended hourly commitment level for the Savings Plans type, and configuration based on the usage during the lookback period.

          • EstimatedAverageUtilization — (String)

            The estimated utilization of the recommended Savings Plans.

          • EstimatedMonthlySavingsAmount — (String)

            The estimated monthly savings amount, based on the recommended Savings Plans.

          • CurrentMinimumHourlyOnDemandSpend — (String)

            The lowest value of hourly On-Demand spend over the lookback period of the applicable usage type.

          • CurrentMaximumHourlyOnDemandSpend — (String)

            The highest value of hourly On-Demand spend over the lookback period of the applicable usage type.

          • CurrentAverageHourlyOnDemandSpend — (String)

            The average value of hourly On-Demand spend over the lookback period of the applicable usage type.

        • SavingsPlansPurchaseRecommendationSummary — (map)

          Summary metrics for your Savings Plans Recommendations.

          • EstimatedROI — (String)

            The estimated return on investment based on the recommended Savings Plans and estimated savings.

          • CurrencyCode — (String)

            The currency code Amazon Web Services used to generate the recommendations and present potential savings.

          • EstimatedTotalCost — (String)

            The estimated total cost of the usage after purchasing the recommended Savings Plans. This is a sum of the cost of Savings Plans during this term, and the remaining On-Demand usage.

          • CurrentOnDemandSpend — (String)

            The current total on demand spend of the applicable usage types over the lookback period.

          • EstimatedSavingsAmount — (String)

            The estimated total savings over the lookback period, based on the purchase of the recommended Savings Plans.

          • TotalRecommendationCount — (String)

            The aggregate number of Savings Plans recommendations that exist for your account.

          • DailyCommitmentToPurchase — (String)

            The recommended Savings Plans cost on a daily (24 hourly) basis.

          • HourlyCommitmentToPurchase — (String)

            The recommended hourly commitment based on the recommendation parameters.

          • EstimatedSavingsPercentage — (String)

            The estimated savings relative to the total cost of On-Demand usage, over the lookback period. This is calculated as estimatedSavingsAmount/ CurrentOnDemandSpend*100.

          • EstimatedMonthlySavingsAmount — (String)

            The estimated monthly savings amount, based on the recommended Savings Plans purchase.

          • EstimatedOnDemandCostWithCurrentCommitment — (String)

            The estimated On-Demand costs you would expect with no additional commitment, based on your usage of the selected time period and the Savings Plans you own.

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity. Master accounts in an organization have access to member accounts. You can use GetDimensionValues in SAVINGS_PLANS to determine the possible dimension values.

Note: You cannot group by any dimension values for GetSavingsPlansUtilization.

Service Reference:

Examples:

Calling the getSavingsPlansUtilization operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  Granularity: DAILY | MONTHLY | HOURLY
};
costexplorer.getSavingsPlansUtilization(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: {})
    • TimePeriod — (map)

      The time period that you want the usage and costs for. The Start date must be within 13 months. The End date must be after the Start date, and before the current date. Future dates can't be used as an End date.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Granularity — (String)

      The granularity of the Amazon Web Services utillization data for your Savings Plans.

      The GetSavingsPlansUtilization operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:

      • LINKED_ACCOUNT

      • SAVINGS_PLAN_ARN

      • SAVINGS_PLANS_TYPE

      • REGION

      • PAYMENT_OPTION

      • INSTANCE_TYPE_FAMILY

      GetSavingsPlansUtilization uses the same Expression object as the other operations, but only AND is supported among each dimension.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

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:

      • SavingsPlansUtilizationsByTime — (Array<map>)

        The amount of cost/commitment you used your Savings Plans. This allows you to specify date ranges.

        • TimePeriodrequired — (map)

          The time period that you want the usage and costs for.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • Utilizationrequired — (map)

          A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible.

          • TotalCommitment — (String)

            The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts).

          • UsedCommitment — (String)

            The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period.

          • UnusedCommitment — (String)

            The amount of your Savings Plans commitment that was not consumed from Savings Plans eligible usage in a specific period.

          • UtilizationPercentage — (String)

            The amount of UsedCommitment divided by the TotalCommitment for your Savings Plans.

        • Savings — (map)

          The amount saved by using existing Savings Plans. Savings returns both net savings from Savings Plans as well as the onDemandCostEquivalent of the Savings Plans when considering the utilization rate.

          • NetSavings — (String)

            The savings amount that you are accumulating for the usage that is covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage.

          • OnDemandCostEquivalent — (String)

            How much the amount that the usage would have cost if it was accrued at the On-Demand rate.

        • AmortizedCommitment — (map)

          The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees.

          • AmortizedRecurringCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with either a Partial or a NoUpfront.

          • AmortizedUpfrontCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with an Upfront or PartialUpfront Savings Plans.

          • TotalAmortizedCommitment — (String)

            The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method.

      • Total — (map)

        The total amount of cost/commitment that you used your Savings Plans, regardless of date ranges.

        • Utilizationrequired — (map)

          A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible.

          • TotalCommitment — (String)

            The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts).

          • UsedCommitment — (String)

            The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period.

          • UnusedCommitment — (String)

            The amount of your Savings Plans commitment that was not consumed from Savings Plans eligible usage in a specific period.

          • UtilizationPercentage — (String)

            The amount of UsedCommitment divided by the TotalCommitment for your Savings Plans.

        • Savings — (map)

          The amount saved by using existing Savings Plans. Savings returns both net savings from Savings Plans, as well as the onDemandCostEquivalent of the Savings Plans when considering the utilization rate.

          • NetSavings — (String)

            The savings amount that you are accumulating for the usage that is covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage.

          • OnDemandCostEquivalent — (String)

            How much the amount that the usage would have cost if it was accrued at the On-Demand rate.

        • AmortizedCommitment — (map)

          The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees.

          • AmortizedRecurringCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with either a Partial or a NoUpfront.

          • AmortizedUpfrontCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with an Upfront or PartialUpfront Savings Plans.

          • TotalAmortizedCommitment — (String)

            The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method.

Returns:

  • (AWS.Request)

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

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

Retrieves attribute data along with aggregate utilization and savings data for a given time period. This doesn't support granular or grouped data (daily/monthly) in response. You can't retrieve data by dates in a single response similar to GetSavingsPlanUtilization, but you have the option to make multiple calls to GetSavingsPlanUtilizationDetails by providing individual dates. You can use GetDimensionValues in SAVINGS_PLANS to determine the possible dimension values.

Note: GetSavingsPlanUtilizationDetails internally groups data by SavingsPlansArn.

Examples:

Calling the getSavingsPlansUtilizationDetails operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
costexplorer.getSavingsPlansUtilizationDetails(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: {})
    • TimePeriod — (map)

      The time period that you want the usage and costs for. The Start date must be within 13 months. The End date must be after the Start date, and before the current date. Future dates can't be used as an End date.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Filter — (map)

      Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:

      • LINKED_ACCOUNT

      • SAVINGS_PLAN_ARN

      • REGION

      • PAYMENT_OPTION

      • INSTANCE_TYPE_FAMILY

      GetSavingsPlansUtilizationDetails uses the same Expression object as the other operations, but only AND is supported among each dimension.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • NextToken — (String)

      The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

    • MaxResults — (Integer)

      The number of items to be returned in a response. The default is 20, with a minimum value of 1.

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:

      • SavingsPlansUtilizationDetails — (Array<map>)

        Retrieves a single daily or monthly Savings Plans utilization rate and details for your account.

        • SavingsPlanArn — (String)

          The unique Amazon Resource Name (ARN) for a particular Savings Plan.

        • Attributes — (map<String>)

          The attribute that applies to a specific Dimension.

        • Utilization — (map)

          A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible.

          • TotalCommitment — (String)

            The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts).

          • UsedCommitment — (String)

            The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period.

          • UnusedCommitment — (String)

            The amount of your Savings Plans commitment that was not consumed from Savings Plans eligible usage in a specific period.

          • UtilizationPercentage — (String)

            The amount of UsedCommitment divided by the TotalCommitment for your Savings Plans.

        • Savings — (map)

          The amount saved by using existing Savings Plans. Savings returns both net savings from savings plans as well as the onDemandCostEquivalent of the Savings Plans when considering the utilization rate.

          • NetSavings — (String)

            The savings amount that you are accumulating for the usage that is covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage.

          • OnDemandCostEquivalent — (String)

            How much the amount that the usage would have cost if it was accrued at the On-Demand rate.

        • AmortizedCommitment — (map)

          The total amortized commitment for a Savings Plans. Includes the sum of the upfront and recurring Savings Plans fees.

          • AmortizedRecurringCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with either a Partial or a NoUpfront.

          • AmortizedUpfrontCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with an Upfront or PartialUpfront Savings Plans.

          • TotalAmortizedCommitment — (String)

            The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method.

      • Total — (map)

        The total Savings Plans utilization, regardless of time period.

        • Utilizationrequired — (map)

          A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible.

          • TotalCommitment — (String)

            The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts).

          • UsedCommitment — (String)

            The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period.

          • UnusedCommitment — (String)

            The amount of your Savings Plans commitment that was not consumed from Savings Plans eligible usage in a specific period.

          • UtilizationPercentage — (String)

            The amount of UsedCommitment divided by the TotalCommitment for your Savings Plans.

        • Savings — (map)

          The amount saved by using existing Savings Plans. Savings returns both net savings from Savings Plans, as well as the onDemandCostEquivalent of the Savings Plans when considering the utilization rate.

          • NetSavings — (String)

            The savings amount that you are accumulating for the usage that is covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage.

          • OnDemandCostEquivalent — (String)

            How much the amount that the usage would have cost if it was accrued at the On-Demand rate.

        • AmortizedCommitment — (map)

          The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees.

          • AmortizedRecurringCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with either a Partial or a NoUpfront.

          • AmortizedUpfrontCommitment — (String)

            The amortized amount of your Savings Plans commitment that was purchased with an Upfront or PartialUpfront Savings Plans.

          • TotalAmortizedCommitment — (String)

            The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method.

      • TimePeriod — (map)

        The time period that you want the usage and costs for.

        • Startrequired — (String)

          The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

        • Endrequired — (String)

          The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

      • NextToken — (String)

        The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Returns:

  • (AWS.Request)

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

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

Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.

Service Reference:

Examples:

Calling the getTags operation

var params = {
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  NextPageToken: 'STRING_VALUE',
  SearchString: 'STRING_VALUE',
  TagKey: 'STRING_VALUE'
};
costexplorer.getTags(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: {})
    • SearchString — (String)

      The value that you want to search for.

    • TimePeriod — (map)

      The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • TagKey — (String)

      The key of the tag that you want to return values for.

    • NextPageToken — (String)

      The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

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:

      • NextPageToken — (String)

        The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.

      • Tags — (Array<String>)

        The tags that match your request.

      • ReturnSize — (Integer)

        The number of query results that AWS returns at a time.

      • TotalSize — (Integer)

        The total number of query results.

Returns:

  • (AWS.Request)

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

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

Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage.

Service Reference:

Examples:

Calling the getUsageForecast operation

var params = {
  Granularity: DAILY | MONTHLY | HOURLY, /* required */
  Metric: BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT, /* required */
  TimePeriod: { /* required */
    End: 'STRING_VALUE', /* required */
    Start: 'STRING_VALUE' /* required */
  },
  Filter: { /* Expression */
    And: [
      /* recursive Expression */,
      /* more items */
    ],
    Dimensions: {
      Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | OPERATION | PURCHASE_TYPE | REGION | SERVICE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION,
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    Not: /* recursive Expression */,
    Or: [
      /* recursive Expression */,
      /* more items */
    ],
    Tags: {
      Key: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  PredictionIntervalLevel: 'NUMBER_VALUE'
};
costexplorer.getUsageForecast(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: {})
    • TimePeriod — (map)

      The start and end dates of the period that you want to retrieve usage forecast for. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.

      • Startrequired — (String)

        The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

      • Endrequired — (String)

        The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

    • Metric — (String)

      Which metric Cost Explorer uses to create your forecast.

      Valid values for a GetUsageForecast call are the following:

      • USAGE_QUANTITY

      • NORMALIZED_USAGE_AMOUNT

      Possible values include:
      • "BLENDED_COST"
      • "UNBLENDED_COST"
      • "AMORTIZED_COST"
      • "NET_UNBLENDED_COST"
      • "NET_AMORTIZED_COST"
      • "USAGE_QUANTITY"
      • "NORMALIZED_USAGE_AMOUNT"
    • Granularity — (String)

      How granular you want the forecast to be. You can get 3 months of DAILY forecasts or 12 months of MONTHLY forecasts.

      The GetUsageForecast operation supports only DAILY and MONTHLY granularities.

      Possible values include:
      • "DAILY"
      • "MONTHLY"
      • "HOURLY"
    • Filter — (map)

      The filters that you want to use to filter your forecast. Cost Explorer API supports all of the Cost Explorer filters.

      • Or — (Array<map>)

        Return results that match either Dimension object.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • And — (Array<map>)

        Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Not — (map)

        Return results that don't match a Dimension object.

        • Or — (Array<map>)

          Return results that match either Dimension object.

        • And — (Array<map>)

          Return results that match both Dimension objects.

        • Dimensions — (map)

          The specific Dimension to use for Expression.

          • Key — (String)

            The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

            Possible values include:
            • "AZ"
            • "INSTANCE_TYPE"
            • "LINKED_ACCOUNT"
            • "OPERATION"
            • "PURCHASE_TYPE"
            • "REGION"
            • "SERVICE"
            • "USAGE_TYPE"
            • "USAGE_TYPE_GROUP"
            • "RECORD_TYPE"
            • "OPERATING_SYSTEM"
            • "TENANCY"
            • "SCOPE"
            • "PLATFORM"
            • "SUBSCRIPTION_ID"
            • "LEGAL_ENTITY_NAME"
            • "DEPLOYMENT_OPTION"
            • "DATABASE_ENGINE"
            • "CACHE_ENGINE"
            • "INSTANCE_TYPE_FAMILY"
            • "BILLING_ENTITY"
            • "RESERVATION_ID"
            • "RESOURCE_ID"
            • "RIGHTSIZING_TYPE"
            • "SAVINGS_PLANS_TYPE"
            • "SAVINGS_PLAN_ARN"
            • "PAYMENT_OPTION"
          • Values — (Array<String>)

            The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

            Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

        • Tags — (map)

          The specific Tag to use for Expression.

          • Key — (String)

            The key for the tag.

          • Values — (Array<String>)

            The specific value of the tag.

      • Dimensions — (map)

        The specific Dimension to use for Expression.

        • Key — (String)

          The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

          Possible values include:
          • "AZ"
          • "INSTANCE_TYPE"
          • "LINKED_ACCOUNT"
          • "OPERATION"
          • "PURCHASE_TYPE"
          • "REGION"
          • "SERVICE"
          • "USAGE_TYPE"
          • "USAGE_TYPE_GROUP"
          • "RECORD_TYPE"
          • "OPERATING_SYSTEM"
          • "TENANCY"
          • "SCOPE"
          • "PLATFORM"
          • "SUBSCRIPTION_ID"
          • "LEGAL_ENTITY_NAME"
          • "DEPLOYMENT_OPTION"
          • "DATABASE_ENGINE"
          • "CACHE_ENGINE"
          • "INSTANCE_TYPE_FAMILY"
          • "BILLING_ENTITY"
          • "RESERVATION_ID"
          • "RESOURCE_ID"
          • "RIGHTSIZING_TYPE"
          • "SAVINGS_PLANS_TYPE"
          • "SAVINGS_PLAN_ARN"
          • "PAYMENT_OPTION"
        • Values — (Array<String>)

          The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

          Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

      • Tags — (map)

        The specific Tag to use for Expression.

        • Key — (String)

          The key for the tag.

        • Values — (Array<String>)

          The specific value of the tag.

    • PredictionIntervalLevel — (Integer)

      Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.

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:

      • Total — (map)

        How much you're forecasted to use over the forecast period.

        • Amount — (String)

          The actual number that represents the metric.

        • Unit — (String)

          The unit that the metric is given in.

      • ForecastResultsByTime — (Array<map>)

        The forecasts for your query, in order. For DAILY forecasts, this is a list of days. For MONTHLY forecasts, this is a list of months.

        • TimePeriod — (map)

          The period of time that the forecast covers.

          • Startrequired — (String)

            The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if start is 2017-01-01, AWS retrieves cost and usage data starting at 2017-01-01 up to the end date.

          • Endrequired — (String)

            The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if end is 2017-05-01, AWS retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

        • MeanValue — (String)

          The mean value of the forecast.

        • PredictionIntervalLowerBound — (String)

          The lower limit for the prediction interval.

        • PredictionIntervalUpperBound — (String)

          The upper limit for the prediction interval.

Returns:

  • (AWS.Request)

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