The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as pricing from "@distilled.cloud/aws/pricing"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | |
| 5 | export interface GetAttributeValuesRequest extends pricing.GetAttributeValuesRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for `pricing:GetAttributeValues` — list the values of a |
| 9 | * filterable attribute (e.g. every `volumeType` AWS prices for |
| 10 | * `AmazonEC2`). |
| 11 | * |
| 12 | * Use `DescribeServices` to discover attribute names, then this binding to |
| 13 | * enumerate their values, and feed both into `GetProducts` filters. The |
| 14 | * binding takes no arguments and grants the function |
| 15 | * `pricing:GetAttributeValues` (the action has no resource-level IAM). |
| 16 | * Calls are pinned to `us-east-1`, the region that serves the Price List |
| 17 | * API. Provide the implementation with |
| 18 | * `Effect.provide(AWS.Pricing.GetAttributeValuesHttp)`. |
| 19 | * |
| 20 | * ### Listing Attribute Values |
| 21 | * **Example:** List EC2 Volume Types |
| 22 | * ```typescript |
| 23 | * // init |
| 24 | * const getAttributeValues = yield* AWS.Pricing.GetAttributeValues(); |
| 25 | * |
| 26 | * // runtime |
| 27 | * const result = yield* getAttributeValues({ |
| 28 | * ServiceCode: "AmazonEC2", |
| 29 | * AttributeName: "volumeType", |
| 30 | * }); |
| 31 | * const volumeTypes = (result.AttributeValues ?? []).map((v) => v.Value); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetAttributeValues extends Binding.Service< |
| 37 | GetAttributeValues, |
| 38 | "AWS.Pricing.GetAttributeValues", |
| 39 | () => Effect.Effect< |
| 40 | ( |
| 41 | request: GetAttributeValuesRequest, |
| 42 | ) => Effect.Effect<pricing.GetAttributeValuesResponse, pricing.GetAttributeValuesError> |
| 43 | > |
| 44 | > {} |
| 45 | export const GetAttributeValues = Binding.Service<GetAttributeValues>( |
| 46 | "AWS.Pricing.GetAttributeValues", |
| 47 | ); |