billing_preferences
Creates, updates, deletes, gets or lists a billing_preferences resource.
Overview
| Name | billing_preferences |
| Type | Resource |
| Id | aws.billing.billing_preferences |
Fields
The following fields are returned by SELECT queries:
- get_billing_preferences
| Name | Datatype | Description |
|---|---|---|
billing_preferences | array | The list of preference entries matching the request. |
next_token | string | Pagination token. Present when more pages are available; null when there are no more results. (pattern: <code>[-a-zA-Z0-9+=/_]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_billing_preferences | select | region | Retrieves billing preferences for the specified feature. Each feature controls a distinct billing capability: which accounts can share Reserved Instances or credits, whether billing alerts are enabled, the historical record of sharing changes, and per-credit options. | |
update_billing_preferences | update | region, feature, billingPreferencesPerKey | Updates billing preferences for the specified feature. Each feature targets a distinct billing capability and has its own set of supported keys. The action sets the value for each provided key; keys not present in the request are unchanged. Sharing keys (RI_SHARING, CREDIT_SHARING, CREDIT_LEVEL_SHARING, and sharing keys under CREDIT_PREFERENCE_OPTIONS) may only be set by the management account of a consolidated billing family. The credit/{creditId}/status key may be set by member accounts for credits they own, or by the management account for any credit in the family. |
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_billing_preferences
Retrieves billing preferences for the specified feature. Each feature controls a distinct billing capability: which accounts can share Reserved Instances or credits, whether billing alerts are enabled, the historical record of sharing changes, and per-credit options.
SELECT
billing_preferences,
next_token
FROM aws.billing.billing_preferences
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- update_billing_preferences
Updates billing preferences for the specified feature. Each feature targets a distinct billing capability and has its own set of supported keys. The action sets the value for each provided key; keys not present in the request are unchanged. Sharing keys (RI_SHARING, CREDIT_SHARING, CREDIT_LEVEL_SHARING, and sharing keys under CREDIT_PREFERENCE_OPTIONS) may only be set by the management account of a consolidated billing family. The credit/{creditId}/status key may be set by member accounts for credits they own, or by the management account for any credit in the family.
UPDATE aws.billing.billing_preferences
SET
feature = '{{ feature }}',
billingPreferencesPerKey = '{{ billingPreferencesPerKey }}'
WHERE
region = '{{ region }}' --required
AND feature = '{{ feature }}' --required
AND billingPreferencesPerKey = '{{ billingPreferencesPerKey }}' --required;