import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CostExplorerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CostExplorerClient"; import type { GetCostAndUsageWithResourcesRequest, GetCostAndUsageWithResourcesResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link GetCostAndUsageWithResourcesCommand}. */ export interface GetCostAndUsageWithResourcesCommandInput extends GetCostAndUsageWithResourcesRequest { } /** * @public * * The output of {@link GetCostAndUsageWithResourcesCommand}. */ export interface GetCostAndUsageWithResourcesCommandOutput extends GetCostAndUsageWithResourcesResponse, __MetadataBearer { } declare const GetCostAndUsageWithResourcesCommand_base: { new (input: GetCostAndUsageWithResourcesCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: GetCostAndUsageWithResourcesCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

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. Management account in an organization in Organizations have access to all member accounts.

*

Hourly granularity is only available for EC2-Instances (Elastic Compute Cloud) * resource-level data. All other resource-level data is available at daily * granularity.

* *

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

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { CostExplorerClient, GetCostAndUsageWithResourcesCommand } from "@aws-sdk/client-cost-explorer"; // ES Modules import * // const { CostExplorerClient, GetCostAndUsageWithResourcesCommand } = require("@aws-sdk/client-cost-explorer"); // CommonJS import * // import type { CostExplorerClientConfig } from "@aws-sdk/client-cost-explorer"; * const config = {}; // type is CostExplorerClientConfig * const client = new CostExplorerClient(config); * const input = { // GetCostAndUsageWithResourcesRequest * TimePeriod: { // DateInterval * Start: "STRING_VALUE", // required * End: "STRING_VALUE", // required * }, * Granularity: "DAILY" || "MONTHLY" || "HOURLY", // required * Filter: { // Expression * Or: [ // Expressions * { * Or: [ * "", * ], * And: [ * "", * ], * Not: "", * Dimensions: { // DimensionValues * Key: "AZ" || "INSTANCE_TYPE" || "LINKED_ACCOUNT" || "PAYER_ACCOUNT" || "LINKED_ACCOUNT_NAME" || "OPERATION" || "PURCHASE_TYPE" || "REGION" || "SERVICE" || "SERVICE_CODE" || "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" || "AGREEMENT_END_DATE_TIME_AFTER" || "AGREEMENT_END_DATE_TIME_BEFORE" || "INVOICING_ENTITY" || "ANOMALY_TOTAL_IMPACT_ABSOLUTE" || "ANOMALY_TOTAL_IMPACT_PERCENTAGE", * Values: [ // Values * "STRING_VALUE", * ], * MatchOptions: [ // MatchOptions * "EQUALS" || "ABSENT" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS" || "CASE_SENSITIVE" || "CASE_INSENSITIVE" || "GREATER_THAN_OR_EQUAL", * ], * }, * Tags: { // TagValues * Key: "STRING_VALUE", * Values: [ * "STRING_VALUE", * ], * MatchOptions: [ * "EQUALS" || "ABSENT" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS" || "CASE_SENSITIVE" || "CASE_INSENSITIVE" || "GREATER_THAN_OR_EQUAL", * ], * }, * CostCategories: { // CostCategoryValues * Key: "STRING_VALUE", * Values: [ * "STRING_VALUE", * ], * MatchOptions: [ * "EQUALS" || "ABSENT" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS" || "CASE_SENSITIVE" || "CASE_INSENSITIVE" || "GREATER_THAN_OR_EQUAL", * ], * }, * }, * ], * And: [ * "", * ], * Not: "", * Dimensions: { * Key: "AZ" || "INSTANCE_TYPE" || "LINKED_ACCOUNT" || "PAYER_ACCOUNT" || "LINKED_ACCOUNT_NAME" || "OPERATION" || "PURCHASE_TYPE" || "REGION" || "SERVICE" || "SERVICE_CODE" || "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" || "AGREEMENT_END_DATE_TIME_AFTER" || "AGREEMENT_END_DATE_TIME_BEFORE" || "INVOICING_ENTITY" || "ANOMALY_TOTAL_IMPACT_ABSOLUTE" || "ANOMALY_TOTAL_IMPACT_PERCENTAGE", * Values: [ * "STRING_VALUE", * ], * MatchOptions: [ * "EQUALS" || "ABSENT" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS" || "CASE_SENSITIVE" || "CASE_INSENSITIVE" || "GREATER_THAN_OR_EQUAL", * ], * }, * Tags: { * Key: "STRING_VALUE", * Values: [ * "STRING_VALUE", * ], * MatchOptions: [ * "EQUALS" || "ABSENT" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS" || "CASE_SENSITIVE" || "CASE_INSENSITIVE" || "GREATER_THAN_OR_EQUAL", * ], * }, * CostCategories: { * Key: "STRING_VALUE", * Values: "", * MatchOptions: "", * }, * }, * Metrics: [ // MetricNames * "STRING_VALUE", * ], * GroupBy: [ // GroupDefinitions * { // GroupDefinition * Type: "DIMENSION" || "TAG" || "COST_CATEGORY", * Key: "STRING_VALUE", * }, * ], * BillingViewArn: "STRING_VALUE", * NextPageToken: "STRING_VALUE", * }; * const command = new GetCostAndUsageWithResourcesCommand(input); * const response = await client.send(command); * // { // GetCostAndUsageWithResourcesResponse * // NextPageToken: "STRING_VALUE", * // GroupDefinitions: [ // GroupDefinitions * // { // GroupDefinition * // Type: "DIMENSION" || "TAG" || "COST_CATEGORY", * // Key: "STRING_VALUE", * // }, * // ], * // ResultsByTime: [ // ResultsByTime * // { // ResultByTime * // TimePeriod: { // DateInterval * // Start: "STRING_VALUE", // required * // End: "STRING_VALUE", // required * // }, * // Total: { // Metrics * // "": { // MetricValue * // Amount: "STRING_VALUE", * // Unit: "STRING_VALUE", * // }, * // }, * // Groups: [ // Groups * // { // Group * // Keys: [ // Keys * // "STRING_VALUE", * // ], * // Metrics: { * // "": { * // Amount: "STRING_VALUE", * // Unit: "STRING_VALUE", * // }, * // }, * // }, * // ], * // Estimated: true || false, * // }, * // ], * // DimensionValueAttributes: [ // DimensionValuesWithAttributesList * // { // DimensionValuesWithAttributes * // Value: "STRING_VALUE", * // Attributes: { // Attributes * // "": "STRING_VALUE", * // }, * // }, * // ], * // }; * * ``` * * @param GetCostAndUsageWithResourcesCommandInput - {@link GetCostAndUsageWithResourcesCommandInput} * @returns {@link GetCostAndUsageWithResourcesCommandOutput} * @see {@link GetCostAndUsageWithResourcesCommandInput} for command's `input` shape. * @see {@link GetCostAndUsageWithResourcesCommandOutput} for command's `response` shape. * @see {@link CostExplorerClientResolvedConfig | config} for CostExplorerClient's `config` shape. * * @throws {@link BillExpirationException} (client fault) *

The requested report expired. Update the date interval and try again.

* * @throws {@link BillingViewHealthStatusException} (client fault) *

* The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY. *

* * @throws {@link DataUnavailableException} (client fault) *

The requested data is unavailable.

* * @throws {@link InvalidNextTokenException} (client fault) *

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

* * @throws {@link LimitExceededException} (client fault) *

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

* * @throws {@link RequestChangedException} (client fault) *

Your request parameters changed between pages. Try again with the old parameters or * without a pagination token.

* * @throws {@link ResourceNotFoundException} (client fault) *

The specified ARN in the request doesn't exist.

* * @throws {@link CostExplorerServiceException} *

Base exception class for all service exceptions from CostExplorer service.

* * * @public */ export declare class GetCostAndUsageWithResourcesCommand extends GetCostAndUsageWithResourcesCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: GetCostAndUsageWithResourcesRequest; output: GetCostAndUsageWithResourcesResponse; }; sdk: { input: GetCostAndUsageWithResourcesCommandInput; output: GetCostAndUsageWithResourcesCommandOutput; }; }; }