Skip to content
v2.274.0

Inventory Struct ​

Specifies the inventory configuration of an S3 Bucket.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const inventory: s3.Inventory = {
  destination: {
    bucket: bucket,

    // the properties below are optional
    bucketOwner: 'bucketOwner',
    prefix: 'prefix',
  },

  // the properties below are optional
  enabled: false,
  format: s3.InventoryFormat.CSV,
  frequency: s3.InventoryFrequency.DAILY,
  includeObjectVersions: s3.InventoryObjectVersion.ALL,
  inventoryId: 'inventoryId',
  objectsPrefix: 'objectsPrefix',
  optionalFields: ['optionalFields'],
};

Properties ​

The destination of the inventory.
enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool= true#
Whether the inventory is enabled or disabled.
formatoptionalInventoryFormatformatoptionalInventoryFormatformatoptionalInventoryFormatFormatoptionalInventoryFormatFormatoptionalInventoryFormat= InventoryFormat.CSV#
The format of the inventory.
frequencyoptionalInventoryFrequencyfrequencyoptionalInventoryFrequencyfrequencyoptionalInventoryFrequencyFrequencyoptionalInventoryFrequencyFrequencyoptionalInventoryFrequency= InventoryFrequency.WEEKLY#
Frequency at which the inventory should be generated.
includeObjectVersionsoptionalInventoryObjectVersioninclude_object_versionsoptionalInventoryObjectVersionincludeObjectVersionsoptionalInventoryObjectVersionIncludeObjectVersionsoptionalInventoryObjectVersionIncludeObjectVersionsoptionalInventoryObjectVersion= InventoryObjectVersion.ALL#
If the inventory should contain all the object versions or only the current one.
inventoryIdoptionalstringinventory_idoptionalstrinventoryIdoptionalStringInventoryIdoptionalstringInventoryIdoptional*string#
The inventory configuration ID.

Default: generated ID.

Should be limited to 64 characters and can only contain letters, numbers, periods, dashes, and underscores.

objectsPrefixoptionalstringobjects_prefixoptionalstrobjectsPrefixoptionalStringObjectsPrefixoptionalstringObjectsPrefixoptional*string#
The inventory will only include objects that meet the prefix filter criteria.

Default: No objects prefix

optionalFieldsoptionalstring[]optional_fieldsoptionaltyping.List[str]optionalFieldsoptionalList<String>OptionalFieldsoptionalstring[]OptionalFieldsoptional*[]*string#
A list of optional fields to be included in the inventory result.

Default: No optional fields.