AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Rbin::Rule

CfnRule

Creates a Recycle Bin retention rule. You can create two types of retention rules:. - *Tag-level retention rules* - These retention rules use resource tags to identify the resources to protect. For each retention rule, you specify one or more tag key and value pairs. Resources (of the specified type) that have at least one of these tag key and value pairs are automatically retained in the Recycle Bin upon deletion. Use this type of retention rule to protect specific resources in your account based on their tags. - *Region-level retention rules* - These retention rules, by default, apply to all of the resources (of the specified type) in the Region, even if the resources are not tagged. However, you can specify exclusion tags to exclude resources that have specific tags. Use this type of retention rule to protect all resources of a specific type in a Region. For more information, see [Create Recycle Bin retention rules](https://docs.aws.amazon.com/ebs/latest/userguide/recycle-bin.html) in the *Amazon EBS User Guide* .

Import

import { CfnRule } from 'aws-cdk-lib/aws-rbin';

Or use the module namespace:

import * as rbin from 'aws-cdk-lib/aws-rbin';
// rbin.CfnRule

Properties

Configuration passed to the constructor as CfnRuleProps.

resourceTypeRequired
string

The resource type to be retained by the retention rule. Currently, only EBS volumes, EBS snapshots, and EBS-backed AMIs are supported. - To retain EBS volumes, specify `EBS_VOLUME` . - To retain EBS snapshots, specify `EBS_SNAPSHOT` - To retain EBS-backed AMIs, specify `EC2_IMAGE` .

retentionPeriodRequired
IResolvable | RetentionPeriodProperty

Information about the retention period for which the retention rule is to retain resources.

descriptionOptional
string

The retention rule description.

excludeResourceTagsOptional
IResolvable | IResolvable | ResourceTagProperty[]

[Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. Resources that have any of these tags are not retained by the retention rule upon deletion. You can't specify exclusion tags for tag-level retention rules.

lockConfigurationOptional
IResolvable | UnlockDelayProperty

Information about the retention rule lock configuration.

resourceTagsOptional
IResolvable | IResolvable | ResourceTagProperty[]

[Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule. You can add the same tag key and value pair to a maximum or five retention rules. To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.

statusOptional
string

The state of the retention rule. Only retention rules that are in the `available` state retain resources.

tagsOptional
CfnTag[]

Information about the tags to assign to the retention rule.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-rbin
CFN TypeAWS::Rbin::Rule
Properties8

External Links