Skip to main content

credits

Creates, updates, deletes, gets or lists a credits resource.

Overview

Namecredits
TypeResource
Idaws.billing.credits

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creditsarrayThe list of credits matching the request. Returns an empty list when no credits exist.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_creditsselectregionReturns 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_creditsexecregion, promoCodeRedeems 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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 }}"
}'
;