pulumi_wasm_providers_aws_mini::s3

Module inventory

source
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§

Functions§

  • Registers a new resource with the given unique name and arguments