Skip to main content

billing_groups

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

Overview

Namebilling_groups
TypeResource
Idaws.iot.billing_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
billing_group_arnstringThe ARN of the billing group.
billing_group_idstringThe ID of the billing group. (pattern: <code>[a-zA-Z0-9-]+</code>)
billing_group_metadataobjectAdditional information about the billing group.
billing_group_namestringThe name of the billing group. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
billing_group_propertiesobjectThe properties of a billing group.
versioninteger (int64)The version of the billing group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_billing_groupselectbilling_group_name, regionReturns information about a billing group. Requires permission to access the DescribeBillingGroup action.
list_billing_groupsselectregionnextToken, maxResults, namePrefixFilterLists the billing groups you have created. Requires permission to access the ListBillingGroups action.
create_billing_groupinsertbilling_group_name, regionCreates 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_groupupdatebilling_group_name, region, billingGroupPropertiesUpdates information about the billing group. Requires permission to access the UpdateBillingGroup action.
add_thing_to_billing_groupupdateregionAdds a thing to a billing group. Requires permission to access the AddThingToBillingGroup action.
delete_billing_groupdeletebilling_group_name, regionexpectedVersionDeletes the billing group. Requires permission to access the DeleteBillingGroup action.
remove_thing_from_billing_groupexecregionRemoves 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.

NameDatatypeDescription
billing_group_namestringThe name of the billing group.
regionstringAWS region (default: us-east-1)
expectedVersioninteger (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.
maxResultsintegerThe maximum number of results to return per request.
namePrefixFilterstringLimit the results to billing groups whose names have the given prefix.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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;

DELETE examples

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

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