Inventory

Provides a S3 bucket inventory configuration resource.

Example Usage

Add inventory configuration

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var testBucket = new Aws.S3.Bucket("testBucket", new Aws.S3.BucketArgs
        {
        });
        var inventory = new Aws.S3.Bucket("inventory", new Aws.S3.BucketArgs
        {
        });
        var testInventory = new Aws.S3.Inventory("testInventory", new Aws.S3.InventoryArgs
        {
            Bucket = testBucket.Id,
            Destination = new Aws.S3.Inputs.InventoryDestinationArgs
            {
                Bucket = new Aws.S3.Inputs.InventoryDestinationBucketArgs
                {
                    BucketArn = inventory.Arn,
                    Format = "ORC",
                },
            },
            IncludedObjectVersions = "All",
            Schedule = new Aws.S3.Inputs.InventoryScheduleArgs
            {
                Frequency = "Daily",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        testBucket, err := s3.NewBucket(ctx, "testBucket", nil)
        if err != nil {
            return err
        }
        inventory, err := s3.NewBucket(ctx, "inventory", nil)
        if err != nil {
            return err
        }
        _, err = s3.NewInventory(ctx, "testInventory", &s3.InventoryArgs{
            Bucket: testBucket.ID(),
            Destination: &s3.InventoryDestinationArgs{
                Bucket: &s3.InventoryDestinationBucketArgs{
                    BucketArn: inventory.Arn,
                    Format:    pulumi.String("ORC"),
                },
            },
            IncludedObjectVersions: pulumi.String("All"),
            Schedule: &s3.InventoryScheduleArgs{
                Frequency: pulumi.String("Daily"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test_bucket = aws.s3.Bucket("testBucket")
inventory = aws.s3.Bucket("inventory")
test_inventory = aws.s3.Inventory("testInventory",
    bucket=test_bucket.id,
    destination={
        "bucket": {
            "bucketArn": inventory.arn,
            "format": "ORC",
        },
    },
    included_object_versions="All",
    schedule={
        "frequency": "Daily",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testBucket = new aws.s3.Bucket("test", {});
const inventory = new aws.s3.Bucket("inventory", {});
const testInventory = new aws.s3.Inventory("test", {
    bucket: testBucket.id,
    destination: {
        bucket: {
            bucketArn: inventory.arn,
            format: "ORC",
        },
    },
    includedObjectVersions: "All",
    schedule: {
        frequency: "Daily",
    },
});

Add inventory configuration with S3 bucket object prefix

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Aws.S3.Bucket("test", new Aws.S3.BucketArgs
        {
        });
        var inventory = new Aws.S3.Bucket("inventory", new Aws.S3.BucketArgs
        {
        });
        var test_prefix = new Aws.S3.Inventory("test-prefix", new Aws.S3.InventoryArgs
        {
            Bucket = test.Id,
            Destination = new Aws.S3.Inputs.InventoryDestinationArgs
            {
                Bucket = new Aws.S3.Inputs.InventoryDestinationBucketArgs
                {
                    BucketArn = inventory.Arn,
                    Format = "ORC",
                    Prefix = "inventory",
                },
            },
            Filter = new Aws.S3.Inputs.InventoryFilterArgs
            {
                Prefix = "documents/",
            },
            IncludedObjectVersions = "All",
            Schedule = new Aws.S3.Inputs.InventoryScheduleArgs
            {
                Frequency = "Daily",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        test, err := s3.NewBucket(ctx, "test", nil)
        if err != nil {
            return err
        }
        inventory, err := s3.NewBucket(ctx, "inventory", nil)
        if err != nil {
            return err
        }
        _, err = s3.NewInventory(ctx, "test_prefix", &s3.InventoryArgs{
            Bucket: test.ID(),
            Destination: &s3.InventoryDestinationArgs{
                Bucket: &s3.InventoryDestinationBucketArgs{
                    BucketArn: inventory.Arn,
                    Format:    pulumi.String("ORC"),
                    Prefix:    pulumi.String("inventory"),
                },
            },
            Filter: &s3.InventoryFilterArgs{
                Prefix: pulumi.String("documents/"),
            },
            IncludedObjectVersions: pulumi.String("All"),
            Schedule: &s3.InventoryScheduleArgs{
                Frequency: pulumi.String("Daily"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test = aws.s3.Bucket("test")
inventory = aws.s3.Bucket("inventory")
test_prefix = aws.s3.Inventory("test-prefix",
    bucket=test.id,
    destination={
        "bucket": {
            "bucketArn": inventory.arn,
            "format": "ORC",
            "prefix": "inventory",
        },
    },
    filter={
        "prefix": "documents/",
    },
    included_object_versions="All",
    schedule={
        "frequency": "Daily",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.s3.Bucket("test", {});
const inventory = new aws.s3.Bucket("inventory", {});
const test_prefix = new aws.s3.Inventory("test-prefix", {
    bucket: test.id,
    destination: {
        bucket: {
            bucketArn: inventory.arn,
            format: "ORC",
            prefix: "inventory",
        },
    },
    filter: {
        prefix: "documents/",
    },
    includedObjectVersions: "All",
    schedule: {
        frequency: "Daily",
    },
});

Create a Inventory Resource

def Inventory(resource_name, opts=None, bucket=None, destination=None, enabled=None, filter=None, included_object_versions=None, name=None, optional_fields=None, schedule=None, __props__=None);
func NewInventory(ctx *Context, name string, args InventoryArgs, opts ...ResourceOption) (*Inventory, error)
public Inventory(string name, InventoryArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args InventoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args InventoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args InventoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Inventory Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Inventory resource accepts the following input properties:

Bucket string

The name of the bucket where the inventory configuration will be stored.

Destination InventoryDestinationArgs

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

IncludedObjectVersions string

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

Schedule InventoryScheduleArgs

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

Enabled bool

Specifies whether the inventory is enabled or disabled.

Filter InventoryFilterArgs

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

Name string

Unique identifier of the inventory configuration for the bucket.

OptionalFields List<string>

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

Bucket string

The name of the bucket where the inventory configuration will be stored.

Destination InventoryDestination

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

IncludedObjectVersions string

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

Schedule InventorySchedule

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

Enabled bool

Specifies whether the inventory is enabled or disabled.

Filter InventoryFilter

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

Name string

Unique identifier of the inventory configuration for the bucket.

OptionalFields []string

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

bucket string

The name of the bucket where the inventory configuration will be stored.

destination InventoryDestination

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

includedObjectVersions string

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

schedule InventorySchedule

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

enabled boolean

Specifies whether the inventory is enabled or disabled.

filter InventoryFilter

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

name string

Unique identifier of the inventory configuration for the bucket.

optionalFields string[]

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

bucket str

The name of the bucket where the inventory configuration will be stored.

destination Dict[InventoryDestination]

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

included_object_versions str

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

schedule Dict[InventorySchedule]

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

enabled bool

Specifies whether the inventory is enabled or disabled.

filter Dict[InventoryFilter]

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

name str

Unique identifier of the inventory configuration for the bucket.

optional_fields List[str]

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

Outputs

All input properties are implicitly available as output properties. Additionally, the Inventory resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Inventory Resource

Get an existing Inventory resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: InventoryState, opts?: CustomResourceOptions): Inventory
static get(resource_name, id, opts=None, bucket=None, destination=None, enabled=None, filter=None, included_object_versions=None, name=None, optional_fields=None, schedule=None, __props__=None);
func GetInventory(ctx *Context, name string, id IDInput, state *InventoryState, opts ...ResourceOption) (*Inventory, error)
public static Inventory Get(string name, Input<string> id, InventoryState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Bucket string

The name of the bucket where the inventory configuration will be stored.

Destination InventoryDestinationArgs

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

Enabled bool

Specifies whether the inventory is enabled or disabled.

Filter InventoryFilterArgs

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

IncludedObjectVersions string

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

Name string

Unique identifier of the inventory configuration for the bucket.

OptionalFields List<string>

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

Schedule InventoryScheduleArgs

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

Bucket string

The name of the bucket where the inventory configuration will be stored.

Destination InventoryDestination

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

Enabled bool

Specifies whether the inventory is enabled or disabled.

Filter InventoryFilter

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

IncludedObjectVersions string

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

Name string

Unique identifier of the inventory configuration for the bucket.

OptionalFields []string

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

Schedule InventorySchedule

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

bucket string

The name of the bucket where the inventory configuration will be stored.

destination InventoryDestination

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

enabled boolean

Specifies whether the inventory is enabled or disabled.

filter InventoryFilter

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

includedObjectVersions string

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

name string

Unique identifier of the inventory configuration for the bucket.

optionalFields string[]

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

schedule InventorySchedule

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

bucket str

The name of the bucket where the inventory configuration will be stored.

destination Dict[InventoryDestination]

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

enabled bool

Specifies whether the inventory is enabled or disabled.

filter Dict[InventoryFilter]

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

included_object_versions str

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

name str

Unique identifier of the inventory configuration for the bucket.

optional_fields List[str]

List of optional fields that are included in the inventory results. Valid values: Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier.

schedule Dict[InventorySchedule]

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

Supporting Types

InventoryDestination

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Bucket InventoryDestinationBucketArgs

The S3 bucket configuration where inventory results are published (documented below).

Bucket InventoryDestinationBucket

The S3 bucket configuration where inventory results are published (documented below).

bucket InventoryDestinationBucket

The S3 bucket configuration where inventory results are published (documented below).

bucket Dict[InventoryDestinationBucket]

The S3 bucket configuration where inventory results are published (documented below).

InventoryDestinationBucket

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

BucketArn string

The Amazon S3 bucket ARN of the destination.

Format string

Specifies the output format of the inventory results. Can be CSV, ORC or Parquet.

AccountId string

The ID of the account that owns the destination bucket. Recommended to be set to prevent problems if the destination bucket ownership changes.

Encryption InventoryDestinationBucketEncryptionArgs

Contains the type of server-side encryption to use to encrypt the inventory (documented below).

Prefix string

The prefix that is prepended to all inventory results.

BucketArn string

The Amazon S3 bucket ARN of the destination.

Format string

Specifies the output format of the inventory results. Can be CSV, ORC or Parquet.

AccountId string

The ID of the account that owns the destination bucket. Recommended to be set to prevent problems if the destination bucket ownership changes.

Encryption InventoryDestinationBucketEncryption

Contains the type of server-side encryption to use to encrypt the inventory (documented below).

Prefix string

The prefix that is prepended to all inventory results.

bucketArn string

The Amazon S3 bucket ARN of the destination.

format string

Specifies the output format of the inventory results. Can be CSV, ORC or Parquet.

accountId string

The ID of the account that owns the destination bucket. Recommended to be set to prevent problems if the destination bucket ownership changes.

encryption InventoryDestinationBucketEncryption

Contains the type of server-side encryption to use to encrypt the inventory (documented below).

prefix string

The prefix that is prepended to all inventory results.

bucketArn str

The Amazon S3 bucket ARN of the destination.

format str

Specifies the output format of the inventory results. Can be CSV, ORC or Parquet.

account_id str

The ID of the account that owns the destination bucket. Recommended to be set to prevent problems if the destination bucket ownership changes.

encryption Dict[InventoryDestinationBucketEncryption]

Contains the type of server-side encryption to use to encrypt the inventory (documented below).

prefix str

The prefix that is prepended to all inventory results.

InventoryDestinationBucketEncryption

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

SseKms InventoryDestinationBucketEncryptionSseKmsArgs

Specifies to use server-side encryption with AWS KMS-managed keys to encrypt the inventory file (documented below).

SseS3 InventoryDestinationBucketEncryptionSseS3Args

Specifies to use server-side encryption with Amazon S3-managed keys (SSE-S3) to encrypt the inventory file.

SseKms InventoryDestinationBucketEncryptionSseKms

Specifies to use server-side encryption with AWS KMS-managed keys to encrypt the inventory file (documented below).

SseS3 InventoryDestinationBucketEncryptionSseS3

Specifies to use server-side encryption with Amazon S3-managed keys (SSE-S3) to encrypt the inventory file.

sseKms InventoryDestinationBucketEncryptionSseKms

Specifies to use server-side encryption with AWS KMS-managed keys to encrypt the inventory file (documented below).

sseS3 InventoryDestinationBucketEncryptionSseS3

Specifies to use server-side encryption with Amazon S3-managed keys (SSE-S3) to encrypt the inventory file.

sseKms Dict[InventoryDestinationBucketEncryptionSseKms]

Specifies to use server-side encryption with AWS KMS-managed keys to encrypt the inventory file (documented below).

sseS3 Dict[InventoryDestinationBucketEncryptionSseS3]

Specifies to use server-side encryption with Amazon S3-managed keys (SSE-S3) to encrypt the inventory file.

InventoryDestinationBucketEncryptionSseKms

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

KeyId string

The ARN of the KMS customer master key (CMK) used to encrypt the inventory file.

KeyId string

The ARN of the KMS customer master key (CMK) used to encrypt the inventory file.

keyId string

The ARN of the KMS customer master key (CMK) used to encrypt the inventory file.

key_id str

The ARN of the KMS customer master key (CMK) used to encrypt the inventory file.

InventoryFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Prefix string

The prefix that an object must have to be included in the inventory results.

Prefix string

The prefix that an object must have to be included in the inventory results.

prefix string

The prefix that an object must have to be included in the inventory results.

prefix str

The prefix that an object must have to be included in the inventory results.

InventorySchedule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Frequency string

Specifies how frequently inventory results are produced. Valid values: Daily, Weekly.

Frequency string

Specifies how frequently inventory results are produced. Valid values: Daily, Weekly.

frequency string

Specifies how frequently inventory results are produced. Valid values: Daily, Weekly.

frequency str

Specifies how frequently inventory results are produced. Valid values: Daily, Weekly.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.