billing_groups
Creates, updates, deletes or gets a billing_group
resource or lists billing_groups
in a region
Overview
Name | billing_groups |
Type | Resource |
Description | A billing group is a set of linked account which belong to the same end customer. It can be seen as a virtual consolidated billing family. |
Id | aws.billingconductor.billing_groups |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | Billing Group ARN |
name | string | |
description | string | |
primary_account_id | string | This account will act as a virtual payer account of the billing group |
computation_preference | object | |
account_grouping | object | |
size | integer | Number of accounts in the billing group |
status | string | |
status_reason | string | |
creation_time | integer | Creation timestamp in UNIX epoch time format |
last_modified_time | integer | Latest modified timestamp in UNIX epoch time format |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, AccountGrouping, PrimaryAccountId, ComputationPreference, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all billing_groups
in a region.
SELECT
region,
arn,
name,
description,
primary_account_id,
computation_preference,
account_grouping,
size,
status,
status_reason,
creation_time,
last_modified_time,
tags
FROM aws.billingconductor.billing_groups
WHERE region = 'us-east-1';
Gets all properties from an individual billing_group
.
SELECT
region,
arn,
name,
description,
primary_account_id,
computation_preference,
account_grouping,
size,
status,
status_reason,
creation_time,
last_modified_time,
tags
FROM aws.billingconductor.billing_groups
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new billing_group
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.billingconductor.billing_groups (
Name,
PrimaryAccountId,
ComputationPreference,
AccountGrouping,
region
)
SELECT
'{{ Name }}',
'{{ PrimaryAccountId }}',
'{{ ComputationPreference }}',
'{{ AccountGrouping }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.billingconductor.billing_groups (
Name,
Description,
PrimaryAccountId,
ComputationPreference,
AccountGrouping,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ PrimaryAccountId }}',
'{{ ComputationPreference }}',
'{{ AccountGrouping }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: billing_group
props:
- name: Name
value: '{{ Name }}'
- name: Description
value: '{{ Description }}'
- name: PrimaryAccountId
value: '{{ PrimaryAccountId }}'
- name: ComputationPreference
value:
PricingPlanArn: '{{ PricingPlanArn }}'
- name: AccountGrouping
value:
LinkedAccountIds:
- '{{ LinkedAccountIds[0] }}'
AutoAssociate: '{{ AutoAssociate }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.billingconductor.billing_groups
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the billing_groups
resource, the following permissions are required:
Create
billingconductor:CreateBillingGroup,
billingconductor:AssociateAccounts,
billingconductor:ListBillingGroups,
billingconductor:TagResource,
billingconductor:ListTagsForResource
Read
billingconductor:ListBillingGroups,
billingconductor:ListAccountAssociations,
organizations:ListAccounts,
billingconductor:ListTagsForResource
List
billingconductor:ListBillingGroups,
billingconductor:ListAccountAssociations,
organizations:ListAccounts,
billingconductor:ListTagsForResource
Update
billingconductor:UpdateBillingGroup,
billingconductor:ListAccountAssociations,
organizations:ListAccounts,
billingconductor:AssociateAccounts,
billingconductor:DisassociateAccounts,
billingconductor:ListBillingGroups,
billingconductor:TagResource,
billingconductor:UntagResource
Delete
billingconductor:DeleteBillingGroup,
billingconductor:ListBillingGroups,
billingconductor:UntagResource,
billingconductor:UpdateBillingGroup