CfnRulePropsMixin

class aws_cdk.mixins_preview.aws_rbin.mixins.CfnRulePropsMixin(props, *, strategy=None)

Bases: Mixin

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 in the Amazon EBS User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rbin-rule.html

CloudformationResource:

AWS::Rbin::Rule

Mixin:

true

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.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_rbin import mixins as rbin_mixins

cfn_rule_props_mixin = rbin_mixins.CfnRulePropsMixin(rbin_mixins.CfnRuleMixinProps(
    description="description",
    exclude_resource_tags=[rbin_mixins.CfnRulePropsMixin.ResourceTagProperty(
        resource_tag_key="resourceTagKey",
        resource_tag_value="resourceTagValue"
    )],
    lock_configuration=rbin_mixins.CfnRulePropsMixin.UnlockDelayProperty(
        unlock_delay_unit="unlockDelayUnit",
        unlock_delay_value=123
    ),
    resource_tags=[rbin_mixins.CfnRulePropsMixin.ResourceTagProperty(
        resource_tag_key="resourceTagKey",
        resource_tag_value="resourceTagValue"
    )],
    resource_type="resourceType",
    retention_period=rbin_mixins.CfnRulePropsMixin.RetentionPeriodProperty(
        retention_period_unit="retentionPeriodUnit",
        retention_period_value=123
    ),
    status="status",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Rbin::Rule.

Parameters:
  • props (Union[CfnRuleMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['description', 'excludeResourceTags', 'lockConfiguration', 'resourceTags', 'resourceType', 'retentionPeriod', 'status', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ResourceTagProperty

class CfnRulePropsMixin.ResourceTagProperty(*, resource_tag_key=None, resource_tag_value=None)

Bases: object

[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.

Parameters:
  • resource_tag_key (Optional[str]) – The tag key.

  • resource_tag_value (Optional[str]) – The tag value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-resourcetag.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.mixins_preview.aws_rbin import mixins as rbin_mixins

resource_tag_property = rbin_mixins.CfnRulePropsMixin.ResourceTagProperty(
    resource_tag_key="resourceTagKey",
    resource_tag_value="resourceTagValue"
)

Attributes

resource_tag_key

The tag key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-resourcetag.html#cfn-rbin-rule-resourcetag-resourcetagkey

resource_tag_value

The tag value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-resourcetag.html#cfn-rbin-rule-resourcetag-resourcetagvalue

RetentionPeriodProperty

class CfnRulePropsMixin.RetentionPeriodProperty(*, retention_period_unit=None, retention_period_value=None)

Bases: object

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

Parameters:
  • retention_period_unit (Optional[str]) – The unit of time in which the retention period is measured. Currently, only DAYS is supported.

  • retention_period_value (Union[int, float, None]) – The period value for which the retention rule is to retain resources, measured in days. The supported retention periods are: - EBS volumes: 1 - 7 days - EBS snapshots and EBS-backed AMIs: 1 - 365 days

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-retentionperiod.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.mixins_preview.aws_rbin import mixins as rbin_mixins

retention_period_property = rbin_mixins.CfnRulePropsMixin.RetentionPeriodProperty(
    retention_period_unit="retentionPeriodUnit",
    retention_period_value=123
)

Attributes

retention_period_unit

The unit of time in which the retention period is measured.

Currently, only DAYS is supported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-retentionperiod.html#cfn-rbin-rule-retentionperiod-retentionperiodunit

retention_period_value

The period value for which the retention rule is to retain resources, measured in days.

The supported retention periods are:

  • EBS volumes: 1 - 7 days

  • EBS snapshots and EBS-backed AMIs: 1 - 365 days

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-retentionperiod.html#cfn-rbin-rule-retentionperiod-retentionperiodvalue

UnlockDelayProperty

class CfnRulePropsMixin.UnlockDelayProperty(*, unlock_delay_unit=None, unlock_delay_value=None)

Bases: object

Information about the retention rule unlock delay.

The unlock delay is the period after which a retention rule can be modified or edited after it has been unlocked by a user with the required permissions. The retention rule can’t be modified or deleted during the unlock delay.

Parameters:
  • unlock_delay_unit (Optional[str]) – The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measured only in days.

  • unlock_delay_value (Union[int, float, None]) – The unlock delay period, measured in the unit specified for UnlockDelayUnit .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-unlockdelay.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.mixins_preview.aws_rbin import mixins as rbin_mixins

unlock_delay_property = rbin_mixins.CfnRulePropsMixin.UnlockDelayProperty(
    unlock_delay_unit="unlockDelayUnit",
    unlock_delay_value=123
)

Attributes

unlock_delay_unit

The unit of time in which to measure the unlock delay.

Currently, the unlock delay can be measured only in days.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-unlockdelay.html#cfn-rbin-rule-unlockdelay-unlockdelayunit

unlock_delay_value

The unlock delay period, measured in the unit specified for UnlockDelayUnit .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rbin-rule-unlockdelay.html#cfn-rbin-rule-unlockdelay-unlockdelayvalue