billing_groups
Creates, updates, deletes, gets or lists a billing_groups resource.
Overview
| Name | billing_groups |
| Type | Resource |
| Id | aws.iot.billing_groups |
Fields
The following fields are returned by SELECT queries:
- describe_billing_group
- list_billing_groups
| Name | Datatype | Description |
|---|---|---|
billing_group_arn | string | The ARN of the billing group. |
billing_group_id | string | The ID of the billing group. (pattern: <code>[a-zA-Z0-9-]+</code>) |
billing_group_metadata | object | Additional information about the billing group. |
billing_group_name | string | The name of the billing group. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
billing_group_properties | object | The properties of a billing group. |
version | integer (int64) | The version of the billing group. |
| Name | Datatype | Description |
|---|---|---|
group_arn | string | The group ARN. |
group_name | string | The group name. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_billing_group | select | billing_group_name, region | Returns information about a billing group. Requires permission to access the DescribeBillingGroup action. | |
list_billing_groups | select | region | nextToken, maxResults, namePrefixFilter | Lists the billing groups you have created. Requires permission to access the ListBillingGroups action. |
create_billing_group | insert | billing_group_name, region | Creates a billing group. If this call is made multiple times using the same billing group name and configuration, the call will succeed. If this call is made with the same billing group name but different configuration a ResourceAlreadyExistsException is thrown. Requires permission to access the CreateBillingGroup action. | |
update_billing_group | update | billing_group_name, region, billingGroupProperties | Updates information about the billing group. Requires permission to access the UpdateBillingGroup action. | |
add_thing_to_billing_group | update | region | Adds a thing to a billing group. Requires permission to access the AddThingToBillingGroup action. | |
delete_billing_group | delete | billing_group_name, region | expectedVersion | Deletes the billing group. Requires permission to access the DeleteBillingGroup action. |
remove_thing_from_billing_group | exec | region | Removes the given thing from the billing group. Requires permission to access the RemoveThingFromBillingGroup action. This call is asynchronous. It might take several seconds for the detachment to propagate. |
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 |
|---|---|---|
billing_group_name | string | The name of the billing group. |
region | string | AWS region (default: us-east-1) |
expectedVersion | integer (int64) | The expected version of the billing group. If the version of the billing group does not match the expected version specified in the request, the DeleteBillingGroup request is rejected with a VersionConflictException. |
maxResults | integer | The maximum number of results to return per request. |
namePrefixFilter | string | Limit the results to billing groups whose names have the given prefix. |
nextToken | string | To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results. |
SELECT examples
- describe_billing_group
- list_billing_groups
Returns information about a billing group. Requires permission to access the DescribeBillingGroup action.
SELECT
billing_group_arn,
billing_group_id,
billing_group_metadata,
billing_group_name,
billing_group_properties,
version
FROM aws.iot.billing_groups
WHERE billing_group_name = '{{ billing_group_name }}' -- required
AND region = '{{ region }}' -- required
;
Lists the billing groups you have created. Requires permission to access the ListBillingGroups action.
SELECT
group_arn,
group_name
FROM aws.iot.billing_groups
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND namePrefixFilter = '{{ namePrefixFilter }}'
;
INSERT examples
- create_billing_group
- Manifest
Creates a billing group. If this call is made multiple times using the same billing group name and configuration, the call will succeed. If this call is made with the same billing group name but different configuration a ResourceAlreadyExistsException is thrown. Requires permission to access the CreateBillingGroup action.
INSERT INTO aws.iot.billing_groups (
billingGroupProperties,
tags,
billing_group_name,
region
)
SELECT
'{{ billingGroupProperties }}',
'{{ tags }}',
'{{ billing_group_name }}',
'{{ region }}'
RETURNING
billing_group_arn,
billing_group_id,
billing_group_name
;
# Description fields are for documentation purposes
- name: billing_groups
props:
- name: billing_group_name
value: "{{ billing_group_name }}"
description: Required parameter for the billing_groups resource.
- name: region
value: "{{ region }}"
description: Required parameter for the billing_groups resource.
- name: billingGroupProperties
description: |
The properties of a billing group.
value:
billingGroupDescription: "{{ billingGroupDescription }}"
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_billing_group
- add_thing_to_billing_group
Updates information about the billing group. Requires permission to access the UpdateBillingGroup action.
UPDATE aws.iot.billing_groups
SET
billingGroupProperties = '{{ billingGroupProperties }}',
expectedVersion = {{ expectedVersion }}
WHERE
billing_group_name = '{{ billing_group_name }}' --required
AND region = '{{ region }}' --required
AND billingGroupProperties = '{{ billingGroupProperties }}' --required
RETURNING
version;
Adds a thing to a billing group. Requires permission to access the AddThingToBillingGroup action.
UPDATE aws.iot.billing_groups
SET
billingGroupName = '{{ billingGroupName }}',
billingGroupArn = '{{ billingGroupArn }}',
thingName = '{{ thingName }}',
thingArn = '{{ thingArn }}'
WHERE
region = '{{ region }}' --required;
DELETE examples
- delete_billing_group
Deletes the billing group. Requires permission to access the DeleteBillingGroup action.
DELETE FROM aws.iot.billing_groups
WHERE billing_group_name = '{{ billing_group_name }}' --required
AND region = '{{ region }}' --required
AND expectedVersion = '{{ expectedVersion }}'
;
Lifecycle Methods
- remove_thing_from_billing_group
Removes the given thing from the billing group. Requires permission to access the RemoveThingFromBillingGroup action. This call is asynchronous. It might take several seconds for the detachment to propagate.
EXEC aws.iot.billing_groups.remove_thing_from_billing_group
@region='{{ region }}' --required
@@json=
'{
"billingGroupName": "{{ billingGroupName }}",
"billingGroupArn": "{{ billingGroupArn }}",
"thingName": "{{ thingName }}",
"thingArn": "{{ thingArn }}"
}'
;