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
Idaws.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

NameAccessible byRequired Params
create_resourceINSERTRetentionPeriod, ResourceType, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all rules in a region.

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

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 aws.rbin.rules
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.rbin.rules
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

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

Create

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

Read

rbin:GetRule,
rbin:ListTagsForResource,
iam:PassRole

Update

rbin:GetRule,
rbin:UpdateRule,
rbin:LockRule,
rbin:UnlockRule,
rbin:TagResource,
rbin:UntagResource,
rbin:ListTagsForResource,
iam:PassRole

Delete

rbin:GetRule,
rbin:DeleteRule,
iam:PassRole

List

rbin:ListRules,
rbin:ListTagsForResource,
iam:PassRole