CfnRuleProps
Properties for defining a CfnRule.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_rbin as rbin } from 'aws-cdk-lib';
const cfnRuleProps: rbin.CfnRuleProps = {
resourceType: 'resourceType',
retentionPeriod: {
retentionPeriodUnit: 'retentionPeriodUnit',
retentionPeriodValue: 123,
},
// the properties below are optional
description: 'description',
excludeResourceTags: [{
resourceTagKey: 'resourceTagKey',
resourceTagValue: 'resourceTagValue',
}],
lockConfiguration: {
unlockDelayUnit: 'unlockDelayUnit',
unlockDelayValue: 123,
},
resourceTags: [{
resourceTagKey: 'resourceTagKey',
resourceTagValue: 'resourceTagValue',
}],
status: 'status',
tags: [{
key: 'key',
value: 'value',
}],
};
from aws_cdk import CfnTag
# 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"
)]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.rbin.*;
CfnRuleProps cfnRuleProps = CfnRuleProps.builder()
.resourceType("resourceType")
.retentionPeriod(RetentionPeriodProperty.builder()
.retentionPeriodUnit("retentionPeriodUnit")
.retentionPeriodValue(123)
.build())
// the properties below are optional
.description("description")
.excludeResourceTags(List.of(ResourceTagProperty.builder()
.resourceTagKey("resourceTagKey")
.resourceTagValue("resourceTagValue")
.build()))
.lockConfiguration(UnlockDelayProperty.builder()
.unlockDelayUnit("unlockDelayUnit")
.unlockDelayValue(123)
.build())
.resourceTags(List.of(ResourceTagProperty.builder()
.resourceTagKey("resourceTagKey")
.resourceTagValue("resourceTagValue")
.build()))
.status("status")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Rbin;
var cfnRuleProps = new CfnRuleProps {
ResourceType = "resourceType",
RetentionPeriod = new RetentionPeriodProperty {
RetentionPeriodUnit = "retentionPeriodUnit",
RetentionPeriodValue = 123
},
// the properties below are optional
Description = "description",
ExcludeResourceTags = new [] { new ResourceTagProperty {
ResourceTagKey = "resourceTagKey",
ResourceTagValue = "resourceTagValue"
} },
LockConfiguration = new UnlockDelayProperty {
UnlockDelayUnit = "unlockDelayUnit",
UnlockDelayValue = 123
},
ResourceTags = new [] { new ResourceTagProperty {
ResourceTagKey = "resourceTagKey",
ResourceTagValue = "resourceTagValue"
} },
Status = "status",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnRuleProps := &CfnRuleProps{
ResourceType: jsii.String("resourceType"),
RetentionPeriod: &RetentionPeriodProperty{
RetentionPeriodUnit: jsii.String("retentionPeriodUnit"),
RetentionPeriodValue: jsii.Number(123),
},
// the properties below are optional
Description: jsii.String("description"),
ExcludeResourceTags: []interface{}{
&ResourceTagProperty{
ResourceTagKey: jsii.String("resourceTagKey"),
ResourceTagValue: jsii.String("resourceTagValue"),
},
},
LockConfiguration: &UnlockDelayProperty{
UnlockDelayUnit: jsii.String("unlockDelayUnit"),
UnlockDelayValue: jsii.Number(123),
},
ResourceTags: []interface{}{
&ResourceTagProperty{
ResourceTagKey: jsii.String("resourceTagKey"),
ResourceTagValue: jsii.String("resourceTagValue"),
},
},
Status: jsii.String("status"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #excludeResourceTagsoptionalIResolvable | IResolvable | CfnRule.ResourceTagProperty[]exclude_resource_tagsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourceTagProperty]]]excludeResourceTagsoptionalIResolvableExcludeResourceTagsoptionalIResolvableExcludeResourceTagsoptionalinterface{} #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.
lockConfigurationoptionalIResolvable | CfnRule.UnlockDelayPropertylock_configurationoptionaltyping.Union[IResolvable, UnlockDelayProperty]lockConfigurationoptionalIResolvableLockConfigurationoptionalIResolvableLockConfigurationoptionalinterface{} #resourceTagsoptionalIResolvable | IResolvable | CfnRule.ResourceTagProperty[]resource_tagsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourceTagProperty]]]resourceTagsoptionalIResolvableResourceTagsoptionalIResolvableResourceTagsoptionalinterface{} #notes
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.
resourceTypestringresource_typestrresourceTypeStringResourceTypestringResourceType*string required #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.
retentionPeriodIResolvable | CfnRule.RetentionPeriodPropertyretention_periodtyping.Union[IResolvable, RetentionPeriodProperty]retentionPeriodIResolvableRetentionPeriodIResolvableRetentionPeriodinterface{} required #statusoptionalstringstatusoptionalstrstatusoptionalStringStatusoptionalstringStatusoptional*string #Only retention rules that are in the available state retain resources.