CfnRuleProps
- class aws_cdk.aws_rbin.CfnRuleProps(*, resource_type, retention_period, description=None, exclude_resource_tags=None, lock_configuration=None, resource_tags=None, status=None, tags=None)
Bases:
object
Properties for defining a
CfnRule
.- Parameters:
resource_type (
str
) – The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specifyEBS_SNAPSHOT
. To retain EBS-backed AMIs, specifyEC2_IMAGE
.retention_period (
Union
[IResolvable
,RetentionPeriodProperty
,Dict
[str
,Any
]]) – Information about the retention period for which the retention rule is to retain resources.description (
Optional
[str
]) – The retention rule description.exclude_resource_tags (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ResourceTagProperty
,Dict
[str
,Any
]]],None
]) – [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.lock_configuration (
Union
[IResolvable
,UnlockDelayProperty
,Dict
[str
,Any
],None
]) – Information about the retention rule lock configuration.resource_tags (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ResourceTagProperty
,Dict
[str
,Any
]]],None
]) – [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.status (
Optional
[str
]) – The state of the retention rule. Only retention rules that are in theavailable
state retain resources.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – Information about the tags to assign to the retention rule.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rbin-rule.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_rbin as rbin cfn_rule_props = rbin.CfnRuleProps( resource_type="resourceType", retention_period=rbin.CfnRule.RetentionPeriodProperty( retention_period_unit="retentionPeriodUnit", retention_period_value=123 ), # the properties below are optional description="description", exclude_resource_tags=[rbin.CfnRule.ResourceTagProperty( resource_tag_key="resourceTagKey", resource_tag_value="resourceTagValue" )], lock_configuration=rbin.CfnRule.UnlockDelayProperty( unlock_delay_unit="unlockDelayUnit", unlock_delay_value=123 ), resource_tags=[rbin.CfnRule.ResourceTagProperty( resource_tag_key="resourceTagKey", resource_tag_value="resourceTagValue" )], status="status", tags=[CfnTag( key="key", value="value" )] )
Attributes
- description
The retention rule description.
- exclude_resource_tags
[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.
- lock_configuration
Information about the retention rule lock configuration.
- resource_tags
[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.
- resource_type
The resource type to be retained by the retention rule.
Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT
. To retain EBS-backed AMIs, specifyEC2_IMAGE
.
- retention_period
Information about the retention period for which the retention rule is to retain resources.
- status
The state of the retention rule.
Only retention rules that are in the
available
state retain resources.
- tags
Information about the tags to assign to the retention rule.