Skip to content

aws.ce.get_reservation_utilization

Example SQL Queries

SELECT * FROM
aws.ce.get_reservation_utilization
WHERE
"time_period" = 'VALUE';

Description

Retrieves the reservation utilization for your account. Management account 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.

Table Definition

Column NameColumn Data Type
time_period Required Input Column

Sets the start and end dates for retrieving Reserved Instance (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.

STRUCT(
"start" VARCHAR,
"end" VARCHAR
)
Show child fields
time_period.end

The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

time_period.start

The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01, Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

filter Input Column

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

  • AZ

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

STRUCT(
"dimensions" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"tags" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"cost_categories" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
)
)
Show child fields
filter.cost_categories

The filter that's based on CostCategory values.

Show child fields
filter.cost_categories.key

The unique name of the Cost Category.

filter.cost_categories.match_options[]
filter.cost_categories.values[]
filter.dimensions

The specific Dimension to use for Expression.

Show child fields
filter.dimensions.key

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.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINK_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule.

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions.

filter.dimensions.match_options[]
filter.dimensions.values[]
filter.tags

The specific Tag to use for Expression.

Show child fields
filter.tags.key

The key for the tag.

filter.tags.match_options[]
filter.tags.values[]
granularity Input Column

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.

VARCHAR
group_by Input Column

Groups only by SUBSCRIPTION_ID. Metadata is included.

STRUCT(
"type" VARCHAR,
"key" VARCHAR
)[]
Show child fields
group_by[]
Show child fields
group_by[].key

The string that represents a key for a specified group.

group_by[].type

The string that represents the type of group.

max_results Input Column

The maximum number of objects that you returned for this request. If more objects are available, in the response, Amazon Web Services provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.

BIGINT
next_page_token Input Column

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

VARCHAR
sort_by Input Column

The value that you want to sort the data by.

The following values are supported for Key:

  • UtilizationPercentage

  • UtilizationPercentageInUnits

  • PurchasedHours

  • PurchasedUnits

  • TotalActualHours

  • TotalActualUnits

  • UnusedHours

  • UnusedUnits

  • OnDemandCostOfRIHoursUsed

  • NetRISavings

  • TotalPotentialRISavings

  • AmortizedUpfrontFee

  • AmortizedRecurringFee

  • TotalAmortizedFee

  • RICostForUnusedHours

  • RealizedSavings

  • UnrealizedSavings

The supported values for SortOrder are ASCENDING and DESCENDING.

STRUCT(
"key" VARCHAR,
"sort_order" VARCHAR
)
Show child fields
sort_by.key

The key that's used to sort the data.

sort_by.sort_order

The order that's used to sort the data.

_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

total

The total amount of time that you used your Reserved Instances (RIs).

STRUCT(
"utilization_percentage" VARCHAR,
"utilization_percentage_in_units" VARCHAR,
"purchased_hours" VARCHAR,
"purchased_units" VARCHAR,
"total_actual_hours" VARCHAR,
"total_actual_units" VARCHAR,
"unused_hours" VARCHAR,
"unused_units" VARCHAR,
"on_demand_cost_of_ri_hours_used" VARCHAR,
"net_ri_savings" VARCHAR,
"total_potential_ri_savings" VARCHAR,
"amortized_upfront_fee" VARCHAR,
"amortized_recurring_fee" VARCHAR,
"total_amortized_fee" VARCHAR,
"ri_cost_for_unused_hours" VARCHAR,
"realized_savings" VARCHAR,
"unrealized_savings" VARCHAR
)
Show child fields
total.amortized_recurring_fee

The monthly cost of your reservation. It's amortized over the reservation period.

total.amortized_upfront_fee

The upfront cost of your reservation. It's amortized over the reservation period.

total.net_ri_savings

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

total.on_demand_cost_of_ri_hours_used

How much your reservation costs if charged On-Demand rates.

total.purchased_hours

How many reservation hours that you purchased.

total.purchased_units

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

total.realized_savings

The realized savings because of purchasing and using a reservation.

total.ri_cost_for_unused_hours

The cost of unused hours for your reservation.

total.total_actual_hours

The total number of reservation hours that you used.

total.total_actual_units

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

total.total_amortized_fee

The total cost of your reservation. It's amortized over the reservation period.

total.total_potential_ri_savings

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

total.unrealized_savings

The unrealized savings because of purchasing and using a reservation.

total.unused_hours

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

total.unused_units

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

total.utilization_percentage

The percentage of reservation time that you used.

total.utilization_percentage_in_units

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

utilizations_by_time

The amount of time that you used your Reserved Instances (RIs).

STRUCT(
"time_period" STRUCT(
"start" VARCHAR,
"end" VARCHAR
),
"groups" STRUCT(
"key" VARCHAR,
"value" VARCHAR,
"attributes" MAP(VARCHAR, VARCHAR),
"utilization" STRUCT(
"utilization_percentage" VARCHAR,
"utilization_percentage_in_units" VARCHAR,
"purchased_hours" VARCHAR,
"purchased_units" VARCHAR,
"total_actual_hours" VARCHAR,
"total_actual_units" VARCHAR,
"unused_hours" VARCHAR,
"unused_units" VARCHAR,
"on_demand_cost_of_ri_hours_used" VARCHAR,
"net_ri_savings" VARCHAR,
"total_potential_ri_savings" VARCHAR,
"amortized_upfront_fee" VARCHAR,
"amortized_recurring_fee" VARCHAR,
"total_amortized_fee" VARCHAR,
"ri_cost_for_unused_hours" VARCHAR,
"realized_savings" VARCHAR,
"unrealized_savings" VARCHAR
)
)[],
"total" STRUCT(
"utilization_percentage" VARCHAR,
"utilization_percentage_in_units" VARCHAR,
"purchased_hours" VARCHAR,
"purchased_units" VARCHAR,
"total_actual_hours" VARCHAR,
"total_actual_units" VARCHAR,
"unused_hours" VARCHAR,
"unused_units" VARCHAR,
"on_demand_cost_of_ri_hours_used" VARCHAR,
"net_ri_savings" VARCHAR,
"total_potential_ri_savings" VARCHAR,
"amortized_upfront_fee" VARCHAR,
"amortized_recurring_fee" VARCHAR,
"total_amortized_fee" VARCHAR,
"ri_cost_for_unused_hours" VARCHAR,
"realized_savings" VARCHAR,
"unrealized_savings" VARCHAR
)
)[]
Show child fields
utilizations_by_time[]
Show child fields
utilizations_by_time[].groups[]
Show child fields
utilizations_by_time[].groups[].attributes

The attributes for this group of reservations.

utilizations_by_time[].groups[].key

The key for a specific reservation attribute.

utilizations_by_time[].groups[].utilization

How much you used this group of reservations.

Show child fields
utilizations_by_time[].groups[].utilization.amortized_recurring_fee

The monthly cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].groups[].utilization.amortized_upfront_fee

The upfront cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].groups[].utilization.net_ri_savings

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

utilizations_by_time[].groups[].utilization.on_demand_cost_of_ri_hours_used

How much your reservation costs if charged On-Demand rates.

utilizations_by_time[].groups[].utilization.purchased_hours

How many reservation hours that you purchased.

utilizations_by_time[].groups[].utilization.purchased_units

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

utilizations_by_time[].groups[].utilization.realized_savings

The realized savings because of purchasing and using a reservation.

utilizations_by_time[].groups[].utilization.ri_cost_for_unused_hours

The cost of unused hours for your reservation.

utilizations_by_time[].groups[].utilization.total_actual_hours

The total number of reservation hours that you used.

utilizations_by_time[].groups[].utilization.total_actual_units

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

utilizations_by_time[].groups[].utilization.total_amortized_fee

The total cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].groups[].utilization.total_potential_ri_savings

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

utilizations_by_time[].groups[].utilization.unrealized_savings

The unrealized savings because of purchasing and using a reservation.

utilizations_by_time[].groups[].utilization.unused_hours

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

utilizations_by_time[].groups[].utilization.unused_units

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

utilizations_by_time[].groups[].utilization.utilization_percentage

The percentage of reservation time that you used.

utilizations_by_time[].groups[].utilization.utilization_percentage_in_units

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

utilizations_by_time[].groups[].value

The value of a specific reservation attribute.

utilizations_by_time[].time_period

The period of time that this utilization was used for.

Show child fields
utilizations_by_time[].time_period.end

The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

utilizations_by_time[].time_period.start

The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01, Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

utilizations_by_time[].total

The total number of reservation hours that were used.

Show child fields
utilizations_by_time[].total.amortized_recurring_fee

The monthly cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].total.amortized_upfront_fee

The upfront cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].total.net_ri_savings

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

utilizations_by_time[].total.on_demand_cost_of_ri_hours_used

How much your reservation costs if charged On-Demand rates.

utilizations_by_time[].total.purchased_hours

How many reservation hours that you purchased.

utilizations_by_time[].total.purchased_units

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

utilizations_by_time[].total.realized_savings

The realized savings because of purchasing and using a reservation.

utilizations_by_time[].total.ri_cost_for_unused_hours

The cost of unused hours for your reservation.

utilizations_by_time[].total.total_actual_hours

The total number of reservation hours that you used.

utilizations_by_time[].total.total_actual_units

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

utilizations_by_time[].total.total_amortized_fee

The total cost of your reservation. It's amortized over the reservation period.

utilizations_by_time[].total.total_potential_ri_savings

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

utilizations_by_time[].total.unrealized_savings

The unrealized savings because of purchasing and using a reservation.

utilizations_by_time[].total.unused_hours

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

utilizations_by_time[].total.unused_units

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

utilizations_by_time[].total.utilization_percentage

The percentage of reservation time that you used.

utilizations_by_time[].total.utilization_percentage_in_units

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