Class Rule


  • public class Rule
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS RBin Rule. ## Example Usage ### Basic Usage
     
     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.RuleRetentionPeriodArgs;
     import com.pulumi.aws.rbin.inputs.RuleResourceTagArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .retentionPeriod(RuleRetentionPeriodArgs.builder()
                     .retentionPeriodValue(10)
                     .retentionPeriodUnit("DAYS")
                     .build())
                 .resourceTags(RuleResourceTagArgs.builder()
                     .resourceTagKey("tag_key")
                     .resourceTagValue("tag_value")
                     .build())
                 .description("Example tag-level retention rule")
                 .resourceType("EBS_SNAPSHOT")
                 .tags(Map.of("test_tag_key", "test_tag_value"))
                 .build());
     
         }
     }
     
     
    ### Region-Level Retention Rule
     
     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.RuleRetentionPeriodArgs;
     import com.pulumi.aws.rbin.inputs.RuleExcludeResourceTagArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .retentionPeriod(RuleRetentionPeriodArgs.builder()
                     .retentionPeriodValue(10)
                     .retentionPeriodUnit("DAYS")
                     .build())
                 .excludeResourceTags(RuleExcludeResourceTagArgs.builder()
                     .resourceTagKey("tag_key")
                     .resourceTagValue("tag_value")
                     .build())
                 .description("Example region-level retention rule with exclusion tags")
                 .resourceType("EC2_IMAGE")
                 .tags(Map.of("test_tag_key", "test_tag_value"))
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import RBin Rule using the `id`. For example: ```sh $ pulumi import aws:rbin/rule:Rule example examplerule ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Rule​(java.lang.String name)  
      Rule​(java.lang.String name, RuleArgs args)  
      Rule​(java.lang.String name, RuleArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> description()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<RuleExcludeResourceTag>>> excludeResourceTags()  
      static Rule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RuleState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<RuleLockConfiguration>> lockConfiguration()  
      com.pulumi.core.Output<java.lang.String> lockEndTime()  
      com.pulumi.core.Output<java.lang.String> lockState()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<RuleResourceTag>>> resourceTags()  
      com.pulumi.core.Output<java.lang.String> resourceType()  
      com.pulumi.core.Output<RuleRetentionPeriod> retentionPeriod()  
      com.pulumi.core.Output<java.lang.String> status()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Rule

        public Rule​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Rule

        public Rule​(java.lang.String name,
                    RuleArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Rule

        public Rule​(java.lang.String name,
                    RuleArgs args,
                    @Nullable
                    com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
      • description

        public com.pulumi.core.Output<java.lang.String> description()
        Returns:
        Retention rule description.
      • excludeResourceTags

        public com.pulumi.core.Output<java.util.Optional<java.util.List<RuleExcludeResourceTag>>> excludeResourceTags()
        Returns:
        Exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. See `excludeResourceTags` below.
      • lockConfiguration

        public com.pulumi.core.Output<java.util.Optional<RuleLockConfiguration>> lockConfiguration()
        Returns:
        Information about the retention rule lock configuration. See `lockConfiguration` below.
      • lockEndTime

        public com.pulumi.core.Output<java.lang.String> lockEndTime()
        Returns:
        (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

        public com.pulumi.core.Output<java.lang.String> lockState()
        Returns:
        (Optional) Lock state of the retention rules to list. Only retention rules with the specified lock state are returned. Valid values are `locked`, `pendingUnlock`, `unlocked`.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • resourceTags

        public com.pulumi.core.Output<java.util.Optional<java.util.List<RuleResourceTag>>> resourceTags()
        Returns:
        Resource tags to use to identify resources that are to be retained by a tag-level retention rule. See `resourceTags` below.
      • resourceType

        public com.pulumi.core.Output<java.lang.String> resourceType()
        Returns:
        Resource type to be retained by the retention rule. Valid values are `EBS_SNAPSHOT` and `EC2_IMAGE`.
      • retentionPeriod

        public com.pulumi.core.Output<RuleRetentionPeriod> retentionPeriod()
        Returns:
        Information about the retention period for which the retention rule is to retain resources. See `retentionPeriod` below. The following arguments are optional:
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        (String) State of the retention rule. Only retention rules that are in the `available` state retain resources. Valid values include `pending` and `available`.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
      • get

        public static Rule get​(java.lang.String name,
                               com.pulumi.core.Output<java.lang.String> id,
                               @Nullable
                               RuleState state,
                               @Nullable
                               com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.