Inventory

class Inventory : KotlinCustomResource

Provides a S3 bucket inventory configuration 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.BucketV2;
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.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 testBucketV2 = new BucketV2("testBucketV2");
var inventory = new BucketV2("inventory");
var testInventory = new Inventory("testInventory", InventoryArgs.builder()
.bucket(testBucketV2.id())
.includedObjectVersions("All")
.schedule(InventoryScheduleArgs.builder()
.frequency("Daily")
.build())
.destination(InventoryDestinationArgs.builder()
.bucket(InventoryDestinationBucketArgs.builder()
.format("ORC")
.bucketArn(inventory.arn())
.build())
.build())
.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.BucketV2;
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.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 test = new BucketV2("test");
var inventory = new BucketV2("inventory");
var test_prefix = new Inventory("test-prefix", InventoryArgs.builder()
.bucket(test.id())
.includedObjectVersions("All")
.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())
.build());
}
}

Import

S3 bucket inventory configurations can be imported using bucket:inventory, e.g.,

$ pulumi import aws:s3/inventory:Inventory my-bucket-entire-bucket my-bucket:EntireBucket

Properties

Link copied to clipboard
val bucket: Output<String>

Name of the source bucket that inventory lists the objects for.

Link copied to clipboard

Contains information about where to publish the inventory results (documented below).

Link copied to clipboard
val enabled: Output<Boolean>?

Specifies whether the inventory is enabled or disabled.

Link copied to clipboard
val filter: Output<InventoryFilter>?

Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria (documented below).

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Object versions to include in the inventory list. Valid values: All, Current.

Link copied to clipboard
val name: Output<String>

Unique identifier of the inventory configuration for the bucket.

Link copied to clipboard
val optionalFields: Output<List<String>>?

List of optional fields that are included in the inventory results. Please refer to the S3 documentation for more details.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies the schedule for generating inventory results (documented below).

Link copied to clipboard
val urn: Output<String>