GetSavingsPlansCoverage - AWS Billing and Cost Management

GetSavingsPlansCoverage

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 management account can see the coverage of the associated member accounts. This supports dimensions, Cost Categories, and nested expressions. 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.

Request Syntax

{ "Filter": { "And": [ "Expression" ], "CostCategories": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] }, "Dimensions": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] }, "Not": "Expression", "Or": [ "Expression" ], "Tags": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] } }, "Granularity": "string", "GroupBy": [ { "Key": "string", "Type": "string" } ], "MaxResults": number, "Metrics": [ "string" ], "NextToken": "string", "SortBy": { "Key": "string", "SortOrder": "string" }, "TimePeriod": { "End": "string", "Start": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Filter

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.

Cost category is also supported.

Type: Expression object

Required: No

Granularity

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.

Type: String

Valid Values: DAILY | MONTHLY | HOURLY

Required: No

GroupBy

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

Type: Array of GroupDefinition objects

Required: No

MaxResults

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

Type: Integer

Valid Range: Minimum value of 1.

Required: No

Metrics

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

Type: Array of strings

Length Constraints: Minimum length of 0. Maximum length of 1024.

Pattern: [\S\s]*

Required: No

NextToken

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.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 8192.

Pattern: [\S\s]*

Required: No

SortBy

The value that you want to sort the data by.

The following values are supported for Key:

  • SpendCoveredBySavingsPlan

  • OnDemandCost

  • CoveragePercentage

  • TotalCost

  • InstanceFamily

  • Region

  • Service

The supported values for SortOrder are ASCENDING and DESCENDING.

Type: SortDefinition object

Required: No

TimePeriod

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.

Type: DateInterval object

Required: Yes

Response Syntax

{ "NextToken": "string", "SavingsPlansCoverages": [ { "Attributes": { "string" : "string" }, "Coverage": { "CoveragePercentage": "string", "OnDemandCost": "string", "SpendCoveredBySavingsPlans": "string", "TotalCost": "string" }, "TimePeriod": { "End": "string", "Start": "string" } } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

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.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 8192.

Pattern: [\S\s]*

SavingsPlansCoverages

The amount of spend that your Savings Plans covered.

Type: Array of SavingsPlansCoverage objects

Errors

For information about the errors that are common to all actions, see Common Errors.

DataUnavailableException

The requested data is unavailable.

HTTP Status Code: 400

InvalidNextTokenException

The pagination token is invalid. Try again without a pagination token.

HTTP Status Code: 400

LimitExceededException

You made too many calls in a short period of time. Try again later.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: