Terraform resource for managing an AWS RBin Rule.
resource "aws_rbin_rule" "example" {
description = "example_rule"
resource_type = "EBS_SNAPSHOT"
resource_tags {
resource_tag_key = "tag_key"
resource_tag_value = "tag_value"
}
retention_period {
retention_period_value = 10
retention_period_unit = "DAYS"
}
tags = {
"test_tag_key" = "test_tag_value"
}
}
The following arguments are required:
resource_type
- (Required) The resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT
and EC2_IMAGE
.retention_period
- (Required) Information about the retention period for which the retention rule is to retain resources. See retention_period
below.The following arguments are optional:
description
- (Optional) The retention rule description.resource_tags
- (Optional) Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags
below.lock_configuration
- (Optional) Information about the retention rule lock configuration. See lock_configuration
below.The following arguments are required:
retention_period_unit
- (Required) The unit of time in which the retention period is measured. Currently, only DAYS is supported.retention_period_value
- (Required) The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.The following argument is required:
resource_tag_key
- (Required) The tag key.The following argument is optional:
resource_tag_value
- (Optional) The tag value.The following argument is required:
unlock_delay
- (Required) Information about the retention rule unlock delay. See unlock_delay
below.The following arguments are required:
unlock_delay_unit
- (Required) The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.unlock_delay_value
- (Required) The unlock delay period, measured in the unit specified for UnlockDelayUnit.This resource exports the following attributes in addition to the arguments above:
id
- (String) ID of the Rule.lock_end_time
- (Timestamp) The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.lock_state
- (Optional) The lock state of the retention rules to list. Only retention rules with the specified lock state are returned. Valid values are locked
, pending_unlock
, unlocked
.status
- (String) The state of the retention rule. Only retention rules that are in the available
state retain resources. Valid values include pending
and available
.In Terraform v1.5.0 and later, use an import
block to import RBin Rule using the id
. For example:
import {
to = aws_rbin_rule.example
id = "examplerule"
}
Using terraform import
, import RBin Rule using the id
. For example:
% terraform import aws_rbin_rule.example examplerule