Skip to main content

rules

Creates, updates, deletes or gets a rule resource or lists rules in a region

Overview

Namerules
TypeResource
DescriptionResource Type definition for AWS::Rbin::Rule
Idawscc.rbin.rules

Fields

NameDatatypeDescription
arnstringRule Arn is unique for each rule.
identifierstringThe unique ID of the retention rule.
descriptionstringThe description of the retention rule.
resource_tagsarrayInformation about the resource tags used to identify resources that are retained by the retention rule.
exclude_resource_tagsarrayInformation about the exclude resource tags used to identify resources that are excluded by the retention rule.
resource_typestringThe resource type retained by the retention rule.
tagsarrayInformation about the tags assigned to the retention rule.
retention_periodobjectInformation about the retention period for which the retention rule is to retain resources.
statusstringThe state of the retention rule. Only retention rules that are in the available state retain resources.
lock_configurationobjectInformation about the retention rule lock configuration.
lock_statestringThe lock state for the retention rule.
regionstringAWS region.

For more information, see AWS::Rbin::Rule.

Methods

NameResourceAccessible byRequired Params
create_resourcerulesINSERTRetentionPeriod, ResourceType, region
delete_resourcerulesDELETEIdentifier, region
update_resourcerulesUPDATEIdentifier, PatchDocument, region
list_resourcesrules_list_onlySELECTregion
get_resourcerulesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual rule.

SELECT
region,
arn,
identifier,
description,
resource_tags,
exclude_resource_tags,
resource_type,
tags,
retention_period,
status,
lock_configuration,
lock_state
FROM awscc.rbin.rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new rule resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.rbin.rules (
ResourceType,
RetentionPeriod,
region
)
SELECT
'{{ resource_type }}',
'{{ retention_period }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a rule resource, using stack-deploy.

/*+ update */
UPDATE awscc.rbin.rules
SET PatchDocument = string('{{ {
"Description": description,
"ResourceTags": resource_tags,
"ExcludeResourceTags": exclude_resource_tags,
"Tags": tags,
"RetentionPeriod": retention_period,
"Status": status,
"LockConfiguration": lock_configuration
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.rbin.rules
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

To operate on the rules resource, the following permissions are required:

rbin:CreateRule,
rbin:GetRule,
rbin:LockRule,
rbin:TagResource,
iam:PassRole