Inventory Args
data class InventoryArgs(val bucket: Output<String>? = null, val destination: Output<InventoryDestinationArgs>? = null, val enabled: Output<Boolean>? = null, val filter: Output<InventoryFilterArgs>? = null, val includedObjectVersions: Output<String>? = null, val name: Output<String>? = null, val optionalFields: Output<List<String>>? = null, val schedule: Output<InventoryScheduleArgs>? = null) : ConvertibleToJava<InventoryArgs>
Provides a S3 bucket inventory configuration resource.
This resource cannot be used with S3 directory buckets.
Example Usage
Add inventory configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.s3.BucketV2("test", {bucket: "my-tf-test-bucket"});
const inventory = new aws.s3.BucketV2("inventory", {bucket: "my-tf-inventory-bucket"});
const testInventory = new aws.s3.Inventory("test", {
bucket: test.id,
name: "EntireBucketDaily",
includedObjectVersions: "All",
schedule: {
frequency: "Daily",
},
destination: {
bucket: {
format: "ORC",
bucketArn: inventory.arn,
},
},
});Content copied to clipboard
import pulumi
import pulumi_aws as aws
test = aws.s3.BucketV2("test", bucket="my-tf-test-bucket")
inventory = aws.s3.BucketV2("inventory", bucket="my-tf-inventory-bucket")
test_inventory = aws.s3.Inventory("test",
bucket=test.id,
name="EntireBucketDaily",
included_object_versions="All",
schedule=aws.s3.InventoryScheduleArgs(
frequency="Daily",
),
destination=aws.s3.InventoryDestinationArgs(
bucket=aws.s3.InventoryDestinationBucketArgs(
format="ORC",
bucket_arn=inventory.arn,
),
))Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.S3.BucketV2("test", new()
{
Bucket = "my-tf-test-bucket",
});
var inventory = new Aws.S3.BucketV2("inventory", new()
{
Bucket = "my-tf-inventory-bucket",
});
var testInventory = new Aws.S3.Inventory("test", new()
{
Bucket = test.Id,
Name = "EntireBucketDaily",
IncludedObjectVersions = "All",
Schedule = new Aws.S3.Inputs.InventoryScheduleArgs
{
Frequency = "Daily",
},
Destination = new Aws.S3.Inputs.InventoryDestinationArgs
{
Bucket = new Aws.S3.Inputs.InventoryDestinationBucketArgs
{
Format = "ORC",
BucketArn = inventory.Arn,
},
},
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := s3.NewBucketV2(ctx, "test", &s3.BucketV2Args{
Bucket: pulumi.String("my-tf-test-bucket"),
})
if err != nil {
return err
}
inventory, err := s3.NewBucketV2(ctx, "inventory", &s3.BucketV2Args{
Bucket: pulumi.String("my-tf-inventory-bucket"),
})
if err != nil {
return err
}
_, err = s3.NewInventory(ctx, "test", &s3.InventoryArgs{
Bucket: test.ID(),
Name: pulumi.String("EntireBucketDaily"),
IncludedObjectVersions: pulumi.String("All"),
Schedule: &s3.InventoryScheduleArgs{
Frequency: pulumi.String("Daily"),
},
Destination: &s3.InventoryDestinationArgs{
Bucket: &s3.InventoryDestinationBucketArgs{
Format: pulumi.String("ORC"),
BucketArn: inventory.Arn,
},
},
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
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.BucketV2Args;
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 test = new BucketV2("test", BucketV2Args.builder()
.bucket("my-tf-test-bucket")
.build());
var inventory = new BucketV2("inventory", BucketV2Args.builder()
.bucket("my-tf-inventory-bucket")
.build());
var testInventory = new Inventory("testInventory", InventoryArgs.builder()
.bucket(test.id())
.name("EntireBucketDaily")
.includedObjectVersions("All")
.schedule(InventoryScheduleArgs.builder()
.frequency("Daily")
.build())
.destination(InventoryDestinationArgs.builder()
.bucket(InventoryDestinationBucketArgs.builder()
.format("ORC")
.bucketArn(inventory.arn())
.build())
.build())
.build());
}
}Content copied to clipboard
resources:
test:
type: aws:s3:BucketV2
properties:
bucket: my-tf-test-bucket
inventory:
type: aws:s3:BucketV2
properties:
bucket: my-tf-inventory-bucket
testInventory:
type: aws:s3:Inventory
name: test
properties:
bucket: ${test.id}
name: EntireBucketDaily
includedObjectVersions: All
schedule:
frequency: Daily
destination:
bucket:
format: ORC
bucketArn: ${inventory.arn}Content copied to clipboard
Add inventory configuration with S3 object prefix
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.s3.BucketV2("test", {bucket: "my-tf-test-bucket"});
const inventory = new aws.s3.BucketV2("inventory", {bucket: "my-tf-inventory-bucket"});
const test_prefix = new aws.s3.Inventory("test-prefix", {
bucket: test.id,
name: "DocumentsWeekly",
includedObjectVersions: "All",
schedule: {
frequency: "Daily",
},
filter: {
prefix: "documents/",
},
destination: {
bucket: {
format: "ORC",
bucketArn: inventory.arn,
prefix: "inventory",
},
},
});Content copied to clipboard
import pulumi
import pulumi_aws as aws
test = aws.s3.BucketV2("test", bucket="my-tf-test-bucket")
inventory = aws.s3.BucketV2("inventory", bucket="my-tf-inventory-bucket")
test_prefix = aws.s3.Inventory("test-prefix",
bucket=test.id,
name="DocumentsWeekly",
included_object_versions="All",
schedule=aws.s3.InventoryScheduleArgs(
frequency="Daily",
),
filter=aws.s3.InventoryFilterArgs(
prefix="documents/",
),
destination=aws.s3.InventoryDestinationArgs(
bucket=aws.s3.InventoryDestinationBucketArgs(
format="ORC",
bucket_arn=inventory.arn,
prefix="inventory",
),
))Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.S3.BucketV2("test", new()
{
Bucket = "my-tf-test-bucket",
});
var inventory = new Aws.S3.BucketV2("inventory", new()
{
Bucket = "my-tf-inventory-bucket",
});
var test_prefix = new Aws.S3.Inventory("test-prefix", new()
{
Bucket = test.Id,
Name = "DocumentsWeekly",
IncludedObjectVersions = "All",
Schedule = new Aws.S3.Inputs.InventoryScheduleArgs
{
Frequency = "Daily",
},
Filter = new Aws.S3.Inputs.InventoryFilterArgs
{
Prefix = "documents/",
},
Destination = new Aws.S3.Inputs.InventoryDestinationArgs
{
Bucket = new Aws.S3.Inputs.InventoryDestinationBucketArgs
{
Format = "ORC",
BucketArn = inventory.Arn,
Prefix = "inventory",
},
},
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := s3.NewBucketV2(ctx, "test", &s3.BucketV2Args{
Bucket: pulumi.String("my-tf-test-bucket"),
})
if err != nil {
return err
}
inventory, err := s3.NewBucketV2(ctx, "inventory", &s3.BucketV2Args{
Bucket: pulumi.String("my-tf-inventory-bucket"),
})
if err != nil {
return err
}
_, err = s3.NewInventory(ctx, "test-prefix", &s3.InventoryArgs{
Bucket: test.ID(),
Name: pulumi.String("DocumentsWeekly"),
IncludedObjectVersions: pulumi.String("All"),
Schedule: &s3.InventoryScheduleArgs{
Frequency: pulumi.String("Daily"),
},
Filter: &s3.InventoryFilterArgs{
Prefix: pulumi.String("documents/"),
},
Destination: &s3.InventoryDestinationArgs{
Bucket: &s3.InventoryDestinationBucketArgs{
Format: pulumi.String("ORC"),
BucketArn: inventory.Arn,
Prefix: pulumi.String("inventory"),
},
},
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
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.BucketV2Args;
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", BucketV2Args.builder()
.bucket("my-tf-test-bucket")
.build());
var inventory = new BucketV2("inventory", BucketV2Args.builder()
.bucket("my-tf-inventory-bucket")
.build());
var test_prefix = new Inventory("test-prefix", InventoryArgs.builder()
.bucket(test.id())
.name("DocumentsWeekly")
.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());
}
}Content copied to clipboard
resources:
test:
type: aws:s3:BucketV2
properties:
bucket: my-tf-test-bucket
inventory:
type: aws:s3:BucketV2
properties:
bucket: my-tf-inventory-bucket
test-prefix:
type: aws:s3:Inventory
properties:
bucket: ${test.id}
name: DocumentsWeekly
includedObjectVersions: All
schedule:
frequency: Daily
filter:
prefix: documents/
destination:
bucket:
format: ORC
bucketArn: ${inventory.arn}
prefix: inventoryContent copied to clipboard
Import
Using pulumi import, import S3 bucket inventory configurations using bucket:inventory. For example:
$ pulumi import aws:s3/inventory:Inventory my-bucket-entire-bucket my-bucket:EntireBucketContent copied to clipboard
Constructors
Link copied to clipboard
fun InventoryArgs(bucket: Output<String>? = null, destination: Output<InventoryDestinationArgs>? = null, enabled: Output<Boolean>? = null, filter: Output<InventoryFilterArgs>? = null, includedObjectVersions: Output<String>? = null, name: Output<String>? = null, optionalFields: Output<List<String>>? = null, schedule: Output<InventoryScheduleArgs>? = null)
Functions
Properties
Link copied to clipboard
List of optional fields that are included in the inventory results. Please refer to the S3 documentation for more details.