GetAttributeValuesCommand

Returns a list of attribute values. Attributes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions  in the Billing and Cost Management User Guide .

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { PricingClient, GetAttributeValuesCommand } from "@aws-sdk/client-pricing"; // ES Modules import
// const { PricingClient, GetAttributeValuesCommand } = require("@aws-sdk/client-pricing"); // CommonJS import
const client = new PricingClient(config);
const input = { // GetAttributeValuesRequest
  ServiceCode: "STRING_VALUE", // required
  AttributeName: "STRING_VALUE", // required
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new GetAttributeValuesCommand(input);
const response = await client.send(command);
// { // GetAttributeValuesResponse
//   AttributeValues: [ // AttributeValueList
//     { // AttributeValue
//       Value: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

 Loading code editorLoading code editor

GetAttributeValuesCommand Input

See GetAttributeValuesCommandInput for more details

Parameter
Type
Description
AttributeName
Required
string | undefined

The name of the attribute that you want to retrieve the values for, such as volumeType.

ServiceCode
Required
string | undefined

The service code for the service whose attributes you want to retrieve. For example, if you want the retrieve an EC2 attribute, use AmazonEC2.

MaxResults
number | undefined

The maximum number of results to return in response.

NextToken
string | undefined

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

GetAttributeValuesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AttributeValues
AttributeValue[] | undefined

The list of values for an attribute. For example, Throughput Optimized HDD and Provisioned IOPS are two available values for the AmazonEC2 volumeType.

NextToken
string | undefined

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

Throws

Name
Fault
Details
ExpiredNextTokenException
client

The pagination token expired. Try again without a pagination token.

InternalErrorException
server

An error on the server occurred during the processing of your request. Try again later.

InvalidNextTokenException
client

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

InvalidParameterException
client

One or more parameters had an invalid value.

NotFoundException
client

The requested resource can't be found.

ThrottlingException
client

You've made too many requests exceeding service quotas.

PricingServiceException
Base exception class for all service exceptions from Pricing service.