credits
Creates, updates, deletes, gets or lists a credits resource.
Overview
| Name | credits |
| Type | Resource |
| Id | aws.billing.credits |
Fields
The following fields are returned by SELECT queries:
- get_credits
| Name | Datatype | Description |
|---|---|---|
credits | array | The list of credits matching the request. Returns an empty list when no credits exist. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_credits | select | region | Returns the list of Amazon Web Services account credits for the specified account. Each credit includes its identifier, type, monetary amounts, applicable products, expiration, sharing configuration, and current enabled status. When the caller is the management account of a consolidated billing family and payerAccountFlag is true, the response aggregates credits across the entire family. Otherwise, the response includes only credits owned by the account specified in accountId. | |
redeem_credits | exec | region, promoCode | Redeems an Amazon Web Services promotional credit code on behalf of the calling account. On success, a new credit is added to the account's credit ledger with the amount, validity period, and applicable products defined by the promotion. The credit is then automatically applied to subsequent bills according to the standard credit application order. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_credits
Returns the list of Amazon Web Services account credits for the specified account. Each credit includes its identifier, type, monetary amounts, applicable products, expiration, sharing configuration, and current enabled status. When the caller is the management account of a consolidated billing family and payerAccountFlag is true, the response aggregates credits across the entire family. Otherwise, the response includes only credits owned by the account specified in accountId.
SELECT
credits
FROM aws.billing.credits
WHERE region = '{{ region }}' -- required
;
Lifecycle Methods
- redeem_credits
Redeems an Amazon Web Services promotional credit code on behalf of the calling account. On success, a new credit is added to the account's credit ledger with the amount, validity period, and applicable products defined by the promotion. The credit is then automatically applied to subsequent bills according to the standard credit application order.
EXEC aws.billing.credits.redeem_credits
@region='{{ region }}' --required
@@json=
'{
"promoCode": "{{ promoCode }}"
}'
;