billing_groups
Creates, updates, deletes, gets or lists a billing_groups resource.
Overview
| Name | billing_groups |
| Type | Resource |
| Id | aws.billingconductor.billing_groups |
Fields
The following fields are returned by SELECT queries:
- list_billing_groups
| Name | Datatype | Description |
|---|---|---|
account_grouping | object | Specifies if the billing group has automatic account association (AutoAssociate) enabled. |
arn | string | The Amazon Resource Number (ARN) that can be used to uniquely identify the billing group. (pattern: <code>(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[a-zA-Z0-9]{10,12}</code>) |
billing_group_type | string | The type of billing group. (STANDARD, TRANSFER_BILLING) |
computation_preference | object | The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group. |
creation_time | integer (int64) | The time when the billing group was created. |
description | string | The description of the billing group. |
last_modified_time | integer (int64) | The most recent time when the billing group was modified. |
name | string | The name of the billing group. (pattern: <code>[a-zA-Z0-9_+=.-@]+</code>) |
primary_account_id | string | The account ID that serves as the main account in a billing group. (pattern: <code>[0-9]{12}</code>) |
size | integer (int64) | The number of accounts in the particular billing group. |
status | string | The billing group status. Only one of the valid values can be used. (ACTIVE, PRIMARY_ACCOUNT_MISSING, PENDING) |
status_reason | string | The reason why the billing group is in its current status. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_billing_groups | select | region | A paginated call to retrieve a list of billing groups for the given billing period. If you don't provide a billing group, the current billing period is used. | |
create_billing_group | insert | region, AccountGrouping, ComputationPreference | X-Amzn-Client-Token | Creates a billing group that resembles a consolidated billing family that Amazon Web Services charges, based off of the predefined pricing plan computation. |
update_billing_group | update | region | This updates an existing billing group. | |
delete_billing_group | delete | region | Deletes a billing group. |
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) |
X-Amzn-Client-Token | string | A unique, case-sensitive identifier that you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions. |
SELECT examples
- list_billing_groups
A paginated call to retrieve a list of billing groups for the given billing period. If you don't provide a billing group, the current billing period is used.
SELECT
account_grouping,
arn,
billing_group_type,
computation_preference,
creation_time,
description,
last_modified_time,
name,
primary_account_id,
size,
status,
status_reason
FROM aws.billingconductor.billing_groups
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_billing_group
- Manifest
Creates a billing group that resembles a consolidated billing family that Amazon Web Services charges, based off of the predefined pricing plan computation.
INSERT INTO aws.billingconductor.billing_groups (
Name,
AccountGrouping,
ComputationPreference,
PrimaryAccountId,
Description,
Tags,
region,
`X-Amzn-Client-Token`
)
SELECT
'{{ Name }}',
'{{ AccountGrouping }}' /* required */,
'{{ ComputationPreference }}' /* required */,
'{{ PrimaryAccountId }}',
'{{ Description }}',
'{{ Tags }}',
'{{ region }}',
'{{ X-Amzn-Client-Token }}'
RETURNING
arn
;
# Description fields are for documentation purposes
- name: billing_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the billing_groups resource.
- name: Name
value: "{{ Name }}"
- name: AccountGrouping
description: |
The set of accounts that will be under the billing group. The set of accounts resemble the linked accounts in a consolidated billing family.
value:
LinkedAccountIds:
- "{{ LinkedAccountIds }}"
AutoAssociate: {{ AutoAssociate }}
ResponsibilityTransferArn: "{{ ResponsibilityTransferArn }}"
- name: ComputationPreference
description: |
The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group.
value:
PricingPlanArn: "{{ PricingPlanArn }}"
- name: PrimaryAccountId
value: "{{ PrimaryAccountId }}"
- name: Description
value: "{{ Description }}"
- name: Tags
value: "{{ Tags }}"
- name: X-Amzn-Client-Token
value: "{{ X-Amzn-Client-Token }}"
description: A unique, case-sensitive identifier that you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.
description: A unique, case-sensitive identifier that you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.
UPDATE examples
- update_billing_group
This updates an existing billing group.
UPDATE aws.billingconductor.billing_groups
SET
Arn = '{{ Arn }}',
Name = '{{ Name }}',
Status = '{{ Status }}',
ComputationPreference = '{{ ComputationPreference }}',
Description = '{{ Description }}',
AccountGrouping = '{{ AccountGrouping }}'
WHERE
region = '{{ region }}' --required
RETURNING
account_grouping,
arn,
description,
last_modified_time,
name,
pricing_plan_arn,
primary_account_id,
size,
status,
status_reason;
DELETE examples
- delete_billing_group
Deletes a billing group.
DELETE FROM aws.billingconductor.billing_groups
WHERE region = '{{ region }}' --required
;