Class Inventory


  • public class Inventory
    extends com.pulumi.resources.CustomResource
    Provides a S3 bucket [inventory configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) resource. ## Example Usage ### Add inventory configuration
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.s3.Inventory;
     import com.pulumi.aws.s3.InventoryArgs;
     import com.pulumi.aws.s3.inputs.InventoryScheduleArgs;
     import com.pulumi.aws.s3.inputs.InventoryDestinationArgs;
     import com.pulumi.aws.s3.inputs.InventoryDestinationBucketArgs;
     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 test = new Bucket("test", BucketArgs.builder()
                 .bucket("my-tf-test-bucket")
                 .build());
     
             var inventory = new Bucket("inventory", BucketArgs.builder()
                 .bucket("my-tf-inventory-bucket")
                 .build());
     
             var testInventory = new Inventory("testInventory", InventoryArgs.builder()
                 .schedule(InventoryScheduleArgs.builder()
                     .frequency("Daily")
                     .build())
                 .destination(InventoryDestinationArgs.builder()
                     .bucket(InventoryDestinationBucketArgs.builder()
                         .format("ORC")
                         .bucketArn(inventory.arn())
                         .build())
                     .build())
                 .bucket(test.id())
                 .name("EntireBucketDaily")
                 .includedObjectVersions("All")
                 .build());
     
         }
     }
     
     
    ### Add inventory configuration with S3 object prefix
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.s3.Inventory;
     import com.pulumi.aws.s3.InventoryArgs;
     import com.pulumi.aws.s3.inputs.InventoryScheduleArgs;
     import com.pulumi.aws.s3.inputs.InventoryFilterArgs;
     import com.pulumi.aws.s3.inputs.InventoryDestinationArgs;
     import com.pulumi.aws.s3.inputs.InventoryDestinationBucketArgs;
     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 test = new Bucket("test", BucketArgs.builder()
                 .bucket("my-tf-test-bucket")
                 .build());
     
             var inventory = new Bucket("inventory", BucketArgs.builder()
                 .bucket("my-tf-inventory-bucket")
                 .build());
     
             var test_prefix = new Inventory("test-prefix", InventoryArgs.builder()
                 .schedule(InventoryScheduleArgs.builder()
                     .frequency("Daily")
                     .build())
                 .filter(InventoryFilterArgs.builder()
                     .prefix("documents/")
                     .build())
                 .destination(InventoryDestinationArgs.builder()
                     .bucket(InventoryDestinationBucketArgs.builder()
                         .format("ORC")
                         .bucketArn(inventory.arn())
                         .prefix("inventory")
                         .build())
                     .build())
                 .bucket(test.id())
                 .name("DocumentsWeekly")
                 .includedObjectVersions("All")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import S3 bucket inventory configurations using `bucket:inventory`. For example: ```sh $ pulumi import aws:s3/inventory:Inventory my-bucket-entire-bucket my-bucket:EntireBucket ```
    • 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
      Inventory​(java.lang.String name)  
      Inventory​(java.lang.String name, InventoryArgs args)  
      Inventory​(java.lang.String name, InventoryArgs 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> bucket()  
      com.pulumi.core.Output<InventoryDestination> destination()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enabled()  
      com.pulumi.core.Output<java.util.Optional<InventoryFilter>> filter()  
      static Inventory get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, InventoryState 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.lang.String> includedObjectVersions()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> optionalFields()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<InventorySchedule> schedule()  
      • 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

      • Inventory

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

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

        public Inventory​(java.lang.String name,
                         InventoryArgs 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

      • bucket

        public com.pulumi.core.Output<java.lang.String> bucket()
        Returns:
        Name of the source bucket that inventory lists the objects for. Both general purpose and directory buckets are supported.
      • destination

        public com.pulumi.core.Output<InventoryDestination> destination()
        Returns:
        Where to publish the inventory results. See `destination` Block below.
      • enabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enabled()
        Returns:
        Whether to enable the inventory.
      • filter

        public com.pulumi.core.Output<java.util.Optional<InventoryFilter>> filter()
        Returns:
        Inventory filter. The inventory only includes objects that meet the filter's criteria. See `filter` Block below.
      • includedObjectVersions

        public com.pulumi.core.Output<java.lang.String> includedObjectVersions()
        Returns:
        Object versions to include in the inventory list. Valid values: `All`, `Current`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Unique identifier of the inventory configuration for the bucket.
      • optionalFields

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> optionalFields()
        Returns:
        List of optional fields that are included in the inventory results. Please refer to the S3 [documentation](https://docs.aws.amazon.com/AmazonS3/latest/API/API_InventoryConfiguration.html#AmazonS3-Type-InventoryConfiguration-OptionalFields) for more details.
      • 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.
      • schedule

        public com.pulumi.core.Output<InventorySchedule> schedule()
        Returns:
        Schedule for generating inventory results. See `schedule` Block below. The following arguments are optional:
      • get

        public static Inventory get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    InventoryState 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.