Skip to content

DescribeServices

Source: src/AWS/Pricing/DescribeServices.ts

Runtime binding for pricing:DescribeServices — list the service codes known to the AWS Price List API, or the filterable attribute names of one service.

Call it without a ServiceCode to enumerate every service code, or with one (e.g. AmazonEC2) to get the attribute names you can filter GetProducts by (instanceType, location, operatingSystem, …). The binding takes no arguments and grants the function pricing:DescribeServices (the action has no resource-level IAM). Calls are pinned to us-east-1, the region that serves the Price List API. Provide the implementation with Effect.provide(AWS.Pricing.DescribeServicesHttp).

// init
const describeServices = yield* AWS.Pricing.DescribeServices();
// runtime
const result = yield* describeServices({ ServiceCode: "AmazonEC2" });
const attributeNames = result.Services?.[0]?.AttributeNames ?? [];