1. Packages
  2. AWS
  3. API Docs
  4. rbin
  5. Rule
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

aws.rbin.Rule

Explore with Pulumi AI

aws logo
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

    Resource for managing an AWS RBin Rule.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.rbin.Rule("example", {
        description: "Example tag-level retention rule",
        resourceType: "EBS_SNAPSHOT",
        resourceTags: [{
            resourceTagKey: "tag_key",
            resourceTagValue: "tag_value",
        }],
        retentionPeriod: {
            retentionPeriodValue: 10,
            retentionPeriodUnit: "DAYS",
        },
        tags: {
            test_tag_key: "test_tag_value",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.rbin.Rule("example",
        description="Example tag-level retention 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",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rbin"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rbin.NewRule(ctx, "example", &rbin.RuleArgs{
    			Description:  pulumi.String("Example tag-level retention rule"),
    			ResourceType: pulumi.String("EBS_SNAPSHOT"),
    			ResourceTags: rbin.RuleResourceTagArray{
    				&rbin.RuleResourceTagArgs{
    					ResourceTagKey:   pulumi.String("tag_key"),
    					ResourceTagValue: pulumi.String("tag_value"),
    				},
    			},
    			RetentionPeriod: &rbin.RuleRetentionPeriodArgs{
    				RetentionPeriodValue: pulumi.Int(10),
    				RetentionPeriodUnit:  pulumi.String("DAYS"),
    			},
    			Tags: pulumi.StringMap{
    				"test_tag_key": pulumi.String("test_tag_value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Rbin.Rule("example", new()
        {
            Description = "Example tag-level retention rule",
            ResourceType = "EBS_SNAPSHOT",
            ResourceTags = new[]
            {
                new Aws.Rbin.Inputs.RuleResourceTagArgs
                {
                    ResourceTagKey = "tag_key",
                    ResourceTagValue = "tag_value",
                },
            },
            RetentionPeriod = new Aws.Rbin.Inputs.RuleRetentionPeriodArgs
            {
                RetentionPeriodValue = 10,
                RetentionPeriodUnit = "DAYS",
            },
            Tags = 
            {
                { "test_tag_key", "test_tag_value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.rbin.Rule;
    import com.pulumi.aws.rbin.RuleArgs;
    import com.pulumi.aws.rbin.inputs.RuleResourceTagArgs;
    import com.pulumi.aws.rbin.inputs.RuleRetentionPeriodArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Rule("example", RuleArgs.builder()
                .description("Example tag-level retention rule")
                .resourceType("EBS_SNAPSHOT")
                .resourceTags(RuleResourceTagArgs.builder()
                    .resourceTagKey("tag_key")
                    .resourceTagValue("tag_value")
                    .build())
                .retentionPeriod(RuleRetentionPeriodArgs.builder()
                    .retentionPeriodValue(10)
                    .retentionPeriodUnit("DAYS")
                    .build())
                .tags(Map.of("test_tag_key", "test_tag_value"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:rbin:Rule
        properties:
          description: Example tag-level retention rule
          resourceType: EBS_SNAPSHOT
          resourceTags:
            - resourceTagKey: tag_key
              resourceTagValue: tag_value
          retentionPeriod:
            retentionPeriodValue: 10
            retentionPeriodUnit: DAYS
          tags:
            test_tag_key: test_tag_value
    

    Region-Level Retention Rule

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.rbin.Rule("example", {
        description: "Example region-level retention rule with exclusion tags",
        resourceType: "EC2_IMAGE",
        excludeResourceTags: [{
            resourceTagKey: "tag_key",
            resourceTagValue: "tag_value",
        }],
        retentionPeriod: {
            retentionPeriodValue: 10,
            retentionPeriodUnit: "DAYS",
        },
        tags: {
            test_tag_key: "test_tag_value",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.rbin.Rule("example",
        description="Example region-level retention rule with exclusion tags",
        resource_type="EC2_IMAGE",
        exclude_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",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rbin"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rbin.NewRule(ctx, "example", &rbin.RuleArgs{
    			Description:  pulumi.String("Example region-level retention rule with exclusion tags"),
    			ResourceType: pulumi.String("EC2_IMAGE"),
    			ExcludeResourceTags: rbin.RuleExcludeResourceTagArray{
    				&rbin.RuleExcludeResourceTagArgs{
    					ResourceTagKey:   pulumi.String("tag_key"),
    					ResourceTagValue: pulumi.String("tag_value"),
    				},
    			},
    			RetentionPeriod: &rbin.RuleRetentionPeriodArgs{
    				RetentionPeriodValue: pulumi.Int(10),
    				RetentionPeriodUnit:  pulumi.String("DAYS"),
    			},
    			Tags: pulumi.StringMap{
    				"test_tag_key": pulumi.String("test_tag_value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Rbin.Rule("example", new()
        {
            Description = "Example region-level retention rule with exclusion tags",
            ResourceType = "EC2_IMAGE",
            ExcludeResourceTags = new[]
            {
                new Aws.Rbin.Inputs.RuleExcludeResourceTagArgs
                {
                    ResourceTagKey = "tag_key",
                    ResourceTagValue = "tag_value",
                },
            },
            RetentionPeriod = new Aws.Rbin.Inputs.RuleRetentionPeriodArgs
            {
                RetentionPeriodValue = 10,
                RetentionPeriodUnit = "DAYS",
            },
            Tags = 
            {
                { "test_tag_key", "test_tag_value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.rbin.Rule;
    import com.pulumi.aws.rbin.RuleArgs;
    import com.pulumi.aws.rbin.inputs.RuleExcludeResourceTagArgs;
    import com.pulumi.aws.rbin.inputs.RuleRetentionPeriodArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Rule("example", RuleArgs.builder()
                .description("Example region-level retention rule with exclusion tags")
                .resourceType("EC2_IMAGE")
                .excludeResourceTags(RuleExcludeResourceTagArgs.builder()
                    .resourceTagKey("tag_key")
                    .resourceTagValue("tag_value")
                    .build())
                .retentionPeriod(RuleRetentionPeriodArgs.builder()
                    .retentionPeriodValue(10)
                    .retentionPeriodUnit("DAYS")
                    .build())
                .tags(Map.of("test_tag_key", "test_tag_value"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:rbin:Rule
        properties:
          description: Example region-level retention rule with exclusion tags
          resourceType: EC2_IMAGE
          excludeResourceTags:
            - resourceTagKey: tag_key
              resourceTagValue: tag_value
          retentionPeriod:
            retentionPeriodValue: 10
            retentionPeriodUnit: DAYS
          tags:
            test_tag_key: test_tag_value
    

    Create Rule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);
    @overload
    def Rule(resource_name: str,
             args: RuleArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Rule(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             resource_type: Optional[str] = None,
             retention_period: Optional[RuleRetentionPeriodArgs] = None,
             description: Optional[str] = None,
             exclude_resource_tags: Optional[Sequence[RuleExcludeResourceTagArgs]] = None,
             lock_configuration: Optional[RuleLockConfigurationArgs] = None,
             region: Optional[str] = None,
             resource_tags: Optional[Sequence[RuleResourceTagArgs]] = None,
             tags: Optional[Mapping[str, str]] = None)
    func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
    public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
    public Rule(String name, RuleArgs args)
    public Rule(String name, RuleArgs args, CustomResourceOptions options)
    
    type: aws:rbin:Rule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var awsRuleResource = new Aws.Rbin.Rule("awsRuleResource", new()
    {
        ResourceType = "string",
        RetentionPeriod = new Aws.Rbin.Inputs.RuleRetentionPeriodArgs
        {
            RetentionPeriodUnit = "string",
            RetentionPeriodValue = 0,
        },
        Description = "string",
        ExcludeResourceTags = new[]
        {
            new Aws.Rbin.Inputs.RuleExcludeResourceTagArgs
            {
                ResourceTagKey = "string",
                ResourceTagValue = "string",
            },
        },
        LockConfiguration = new Aws.Rbin.Inputs.RuleLockConfigurationArgs
        {
            UnlockDelay = new Aws.Rbin.Inputs.RuleLockConfigurationUnlockDelayArgs
            {
                UnlockDelayUnit = "string",
                UnlockDelayValue = 0,
            },
        },
        Region = "string",
        ResourceTags = new[]
        {
            new Aws.Rbin.Inputs.RuleResourceTagArgs
            {
                ResourceTagKey = "string",
                ResourceTagValue = "string",
            },
        },
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := rbin.NewRule(ctx, "awsRuleResource", &rbin.RuleArgs{
    	ResourceType: pulumi.String("string"),
    	RetentionPeriod: &rbin.RuleRetentionPeriodArgs{
    		RetentionPeriodUnit:  pulumi.String("string"),
    		RetentionPeriodValue: pulumi.Int(0),
    	},
    	Description: pulumi.String("string"),
    	ExcludeResourceTags: rbin.RuleExcludeResourceTagArray{
    		&rbin.RuleExcludeResourceTagArgs{
    			ResourceTagKey:   pulumi.String("string"),
    			ResourceTagValue: pulumi.String("string"),
    		},
    	},
    	LockConfiguration: &rbin.RuleLockConfigurationArgs{
    		UnlockDelay: &rbin.RuleLockConfigurationUnlockDelayArgs{
    			UnlockDelayUnit:  pulumi.String("string"),
    			UnlockDelayValue: pulumi.Int(0),
    		},
    	},
    	Region: pulumi.String("string"),
    	ResourceTags: rbin.RuleResourceTagArray{
    		&rbin.RuleResourceTagArgs{
    			ResourceTagKey:   pulumi.String("string"),
    			ResourceTagValue: pulumi.String("string"),
    		},
    	},
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var awsRuleResource = new com.pulumi.aws.rbin.Rule("awsRuleResource", com.pulumi.aws.rbin.RuleArgs.builder()
        .resourceType("string")
        .retentionPeriod(RuleRetentionPeriodArgs.builder()
            .retentionPeriodUnit("string")
            .retentionPeriodValue(0)
            .build())
        .description("string")
        .excludeResourceTags(RuleExcludeResourceTagArgs.builder()
            .resourceTagKey("string")
            .resourceTagValue("string")
            .build())
        .lockConfiguration(RuleLockConfigurationArgs.builder()
            .unlockDelay(RuleLockConfigurationUnlockDelayArgs.builder()
                .unlockDelayUnit("string")
                .unlockDelayValue(0)
                .build())
            .build())
        .region("string")
        .resourceTags(RuleResourceTagArgs.builder()
            .resourceTagKey("string")
            .resourceTagValue("string")
            .build())
        .tags(Map.of("string", "string"))
        .build());
    
    aws_rule_resource = aws.rbin.Rule("awsRuleResource",
        resource_type="string",
        retention_period={
            "retention_period_unit": "string",
            "retention_period_value": 0,
        },
        description="string",
        exclude_resource_tags=[{
            "resource_tag_key": "string",
            "resource_tag_value": "string",
        }],
        lock_configuration={
            "unlock_delay": {
                "unlock_delay_unit": "string",
                "unlock_delay_value": 0,
            },
        },
        region="string",
        resource_tags=[{
            "resource_tag_key": "string",
            "resource_tag_value": "string",
        }],
        tags={
            "string": "string",
        })
    
    const awsRuleResource = new aws.rbin.Rule("awsRuleResource", {
        resourceType: "string",
        retentionPeriod: {
            retentionPeriodUnit: "string",
            retentionPeriodValue: 0,
        },
        description: "string",
        excludeResourceTags: [{
            resourceTagKey: "string",
            resourceTagValue: "string",
        }],
        lockConfiguration: {
            unlockDelay: {
                unlockDelayUnit: "string",
                unlockDelayValue: 0,
            },
        },
        region: "string",
        resourceTags: [{
            resourceTagKey: "string",
            resourceTagValue: "string",
        }],
        tags: {
            string: "string",
        },
    });
    
    type: aws:rbin:Rule
    properties:
        description: string
        excludeResourceTags:
            - resourceTagKey: string
              resourceTagValue: string
        lockConfiguration:
            unlockDelay:
                unlockDelayUnit: string
                unlockDelayValue: 0
        region: string
        resourceTags:
            - resourceTagKey: string
              resourceTagValue: string
        resourceType: string
        retentionPeriod:
            retentionPeriodUnit: string
            retentionPeriodValue: 0
        tags:
            string: string
    

    Rule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Rule resource accepts the following input properties:

    ResourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    RetentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    Description string
    Retention rule description.
    ExcludeResourceTags List<RuleExcludeResourceTag>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    LockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceTags List<RuleResourceTag>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    Tags Dictionary<string, string>
    ResourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    RetentionPeriod RuleRetentionPeriodArgs

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

    The following arguments are optional:

    Description string
    Retention rule description.
    ExcludeResourceTags []RuleExcludeResourceTagArgs
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    LockConfiguration RuleLockConfigurationArgs
    Information about the retention rule lock configuration. See lock_configuration below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceTags []RuleResourceTagArgs
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    Tags map[string]string
    resourceType String
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    description String
    Retention rule description.
    excludeResourceTags List<RuleExcludeResourceTag>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags List<RuleResourceTag>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    tags Map<String,String>
    resourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    description string
    Retention rule description.
    excludeResourceTags RuleExcludeResourceTag[]
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags RuleResourceTag[]
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    tags {[key: string]: string}
    resource_type str
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retention_period RuleRetentionPeriodArgs

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

    The following arguments are optional:

    description str
    Retention rule description.
    exclude_resource_tags Sequence[RuleExcludeResourceTagArgs]
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lock_configuration RuleLockConfigurationArgs
    Information about the retention rule lock configuration. See lock_configuration below.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resource_tags Sequence[RuleResourceTagArgs]
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    tags Mapping[str, str]
    resourceType String
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod Property Map

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

    The following arguments are optional:

    description String
    Retention rule description.
    excludeResourceTags List<Property Map>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration Property Map
    Information about the retention rule lock configuration. See lock_configuration below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags List<Property Map>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    tags Map<String>

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:

    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    LockEndTime string
    (Timestamp) 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.
    LockState string
    (Optional) 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
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    TagsAll Dictionary<string, string>
    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    LockEndTime string
    (Timestamp) 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.
    LockState string
    (Optional) 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
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    TagsAll map[string]string
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    lockEndTime String
    (Timestamp) 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.
    lockState String
    (Optional) 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
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tagsAll Map<String,String>
    arn string
    id string
    The provider-assigned unique ID for this managed resource.
    lockEndTime string
    (Timestamp) 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.
    lockState string
    (Optional) 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
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tagsAll {[key: string]: string}
    arn str
    id str
    The provider-assigned unique ID for this managed resource.
    lock_end_time str
    (Timestamp) 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 str
    (Optional) 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 str
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tags_all Mapping[str, str]
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    lockEndTime String
    (Timestamp) 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.
    lockState String
    (Optional) 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
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tagsAll Map<String>

    Look up Existing Rule Resource

    Get an existing Rule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RuleState, opts?: CustomResourceOptions): Rule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            description: Optional[str] = None,
            exclude_resource_tags: Optional[Sequence[RuleExcludeResourceTagArgs]] = None,
            lock_configuration: Optional[RuleLockConfigurationArgs] = None,
            lock_end_time: Optional[str] = None,
            lock_state: Optional[str] = None,
            region: Optional[str] = None,
            resource_tags: Optional[Sequence[RuleResourceTagArgs]] = None,
            resource_type: Optional[str] = None,
            retention_period: Optional[RuleRetentionPeriodArgs] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> Rule
    func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
    public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
    public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)
    resources:  _:    type: aws:rbin:Rule    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    Description string
    Retention rule description.
    ExcludeResourceTags List<RuleExcludeResourceTag>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    LockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    LockEndTime string
    (Timestamp) 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.
    LockState string
    (Optional) 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceTags List<RuleResourceTag>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    ResourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    RetentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    Status string
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    Tags Dictionary<string, string>
    TagsAll Dictionary<string, string>
    Arn string
    Description string
    Retention rule description.
    ExcludeResourceTags []RuleExcludeResourceTagArgs
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    LockConfiguration RuleLockConfigurationArgs
    Information about the retention rule lock configuration. See lock_configuration below.
    LockEndTime string
    (Timestamp) 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.
    LockState string
    (Optional) 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceTags []RuleResourceTagArgs
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    ResourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    RetentionPeriod RuleRetentionPeriodArgs

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

    The following arguments are optional:

    Status string
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    Tags map[string]string
    TagsAll map[string]string
    arn String
    description String
    Retention rule description.
    excludeResourceTags List<RuleExcludeResourceTag>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    lockEndTime String
    (Timestamp) 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.
    lockState String
    (Optional) 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags List<RuleResourceTag>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    resourceType String
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    status String
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tags Map<String,String>
    tagsAll Map<String,String>
    arn string
    description string
    Retention rule description.
    excludeResourceTags RuleExcludeResourceTag[]
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration RuleLockConfiguration
    Information about the retention rule lock configuration. See lock_configuration below.
    lockEndTime string
    (Timestamp) 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.
    lockState string
    (Optional) 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.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags RuleResourceTag[]
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    resourceType string
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod RuleRetentionPeriod

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

    The following arguments are optional:

    status string
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tags {[key: string]: string}
    tagsAll {[key: string]: string}
    arn str
    description str
    Retention rule description.
    exclude_resource_tags Sequence[RuleExcludeResourceTagArgs]
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lock_configuration RuleLockConfigurationArgs
    Information about the retention rule lock configuration. See lock_configuration below.
    lock_end_time str
    (Timestamp) 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 str
    (Optional) 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.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resource_tags Sequence[RuleResourceTagArgs]
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    resource_type str
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retention_period RuleRetentionPeriodArgs

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

    The following arguments are optional:

    status str
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tags Mapping[str, str]
    tags_all Mapping[str, str]
    arn String
    description String
    Retention rule description.
    excludeResourceTags List<Property Map>
    Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See exclude_resource_tags below.
    lockConfiguration Property Map
    Information about the retention rule lock configuration. See lock_configuration below.
    lockEndTime String
    (Timestamp) 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.
    lockState String
    (Optional) 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceTags List<Property Map>
    Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See resource_tags below.
    resourceType String
    Resource type to be retained by the retention rule. Valid values are EBS_SNAPSHOT and EC2_IMAGE.
    retentionPeriod Property Map

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

    The following arguments are optional:

    status String
    (String) State of the retention rule. Only retention rules that are in the available state retain resources. Valid values include pending and available.
    tags Map<String>
    tagsAll Map<String>

    Supporting Types

    RuleExcludeResourceTag, RuleExcludeResourceTagArgs

    ResourceTagKey string

    Tag key.

    The following argument is optional:

    ResourceTagValue string
    Tag value.
    ResourceTagKey string

    Tag key.

    The following argument is optional:

    ResourceTagValue string
    Tag value.
    resourceTagKey String

    Tag key.

    The following argument is optional:

    resourceTagValue String
    Tag value.
    resourceTagKey string

    Tag key.

    The following argument is optional:

    resourceTagValue string
    Tag value.
    resource_tag_key str

    Tag key.

    The following argument is optional:

    resource_tag_value str
    Tag value.
    resourceTagKey String

    Tag key.

    The following argument is optional:

    resourceTagValue String
    Tag value.

    RuleLockConfiguration, RuleLockConfigurationArgs

    UnlockDelay RuleLockConfigurationUnlockDelay
    Information about the retention rule unlock delay. See unlock_delay below.
    UnlockDelay RuleLockConfigurationUnlockDelay
    Information about the retention rule unlock delay. See unlock_delay below.
    unlockDelay RuleLockConfigurationUnlockDelay
    Information about the retention rule unlock delay. See unlock_delay below.
    unlockDelay RuleLockConfigurationUnlockDelay
    Information about the retention rule unlock delay. See unlock_delay below.
    unlock_delay RuleLockConfigurationUnlockDelay
    Information about the retention rule unlock delay. See unlock_delay below.
    unlockDelay Property Map
    Information about the retention rule unlock delay. See unlock_delay below.

    RuleLockConfigurationUnlockDelay, RuleLockConfigurationUnlockDelayArgs

    UnlockDelayUnit string
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    UnlockDelayValue int
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.
    UnlockDelayUnit string
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    UnlockDelayValue int
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.
    unlockDelayUnit String
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    unlockDelayValue Integer
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.
    unlockDelayUnit string
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    unlockDelayValue number
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.
    unlock_delay_unit str
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    unlock_delay_value int
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.
    unlockDelayUnit String
    Unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
    unlockDelayValue Number
    Unlock delay period, measured in the unit specified for UnlockDelayUnit.

    RuleResourceTag, RuleResourceTagArgs

    ResourceTagKey string

    Tag key.

    The following argument is optional:

    ResourceTagValue string
    Tag value.
    ResourceTagKey string

    Tag key.

    The following argument is optional:

    ResourceTagValue string
    Tag value.
    resourceTagKey String

    Tag key.

    The following argument is optional:

    resourceTagValue String
    Tag value.
    resourceTagKey string

    Tag key.

    The following argument is optional:

    resourceTagValue string
    Tag value.
    resource_tag_key str

    Tag key.

    The following argument is optional:

    resource_tag_value str
    Tag value.
    resourceTagKey String

    Tag key.

    The following argument is optional:

    resourceTagValue String
    Tag value.

    RuleRetentionPeriod, RuleRetentionPeriodArgs

    RetentionPeriodUnit string
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    RetentionPeriodValue int
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
    RetentionPeriodUnit string
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    RetentionPeriodValue int
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
    retentionPeriodUnit String
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    retentionPeriodValue Integer
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
    retentionPeriodUnit string
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    retentionPeriodValue number
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
    retention_period_unit str
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    retention_period_value int
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
    retentionPeriodUnit String
    Unit of time in which the retention period is measured. Currently, only DAYS is supported.
    retentionPeriodValue Number
    Period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.

    Import

    Using pulumi import, import RBin Rule using the id. For example:

    $ pulumi import aws:rbin/rule:Rule example examplerule
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi