Expand description
Provides a S3 bucket inventory configuration resource.
This resource cannot be used with S3 directory buckets.
§Example Usage
§Add inventory configuration
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let inventory = bucket_v_2::create(
"inventory",
BucketV2Args::builder().bucket("my-tf-inventory-bucket").build_struct(),
);
let test = bucket_v_2::create(
"test",
BucketV2Args::builder().bucket("my-tf-test-bucket").build_struct(),
);
let testInventory = inventory::create(
"testInventory",
InventoryArgs::builder()
.bucket("${test.id}")
.destination(
InventoryDestination::builder()
.bucket(
InventoryDestinationBucket::builder()
.bucketArn("${inventory.arn}")
.format("ORC")
.build_struct(),
)
.build_struct(),
)
.included_object_versions("All")
.name("EntireBucketDaily")
.schedule(InventorySchedule::builder().frequency("Daily").build_struct())
.build_struct(),
);
}
§Add inventory configuration with S3 object prefix
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: inventory
§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:EntireBucket
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments