GetSavingsPlansCoverage - AWS Billing and Cost Management
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

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. The filter supports dimensions and cost categories, combined with one level of And or Not. For details, see Filter. For any time period, you can filter data for Savings Plans usage with the following dimensions:

  • LINKED_ACCOUNT

  • REGION

  • SERVICE

  • INSTANCE_TYPE_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" ], "ProductAttributes": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] }, "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_TYPE_FAMILY

GetSavingsPlansCoverage uses the same Expression object as the other operations. The filter must have one of the following shapes:

  • A Dimensions or CostCategories expression.

  • A Not expression that contains one Dimensions or CostCategories expression.

  • An And expression with two or more operands, where each operand has one of the two shapes above.

Or and Tags expressions aren't supported. An And expression can't contain another And, and a Not expression can't contain an And or another Not.

Each dimension can appear only once in the filter, including inside Not, and you can use only one CostCategories expression. To filter on several values of a dimension, put all of the values in one expression. Cost Explorer combines the values in one expression with OR.

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_TYPE_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 Error Types.

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: