Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/aws-s3

Package Overview
Dependencies
Maintainers
5
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-s3 - npm Package Compare versions

Comparing version 1.56.0 to 1.57.0

test/integ.bucket-inventory.d.ts

135

lib/bucket.d.ts

@@ -599,2 +599,121 @@ import * as events from '@aws-cdk/aws-events';

}
/**
* All supported inventory list formats.
*/
export declare enum InventoryFormat {
/**
* Generate the inventory list as CSV.
*/
CSV = "CSV",
/**
* Generate the inventory list as Parquet.
*/
PARQUET = "Parquet",
/**
* Generate the inventory list as Parquet.
*/
ORC = "ORC"
}
/**
* All supported inventory frequencies.
*/
export declare enum InventoryFrequency {
/**
* A report is generated every day.
*/
DAILY = "Daily",
/**
* A report is generated every Sunday (UTC timezone) after the initial report.
*/
WEEKLY = "Weekly"
}
/**
* Inventory version support.
*/
export declare enum InventoryObjectVersion {
/**
* Includes all versions of each object in the report.
*/
ALL = "All",
/**
* Includes only the current version of each object in the report.
*/
CURRENT = "Current"
}
/**
* The destination of the inventory.
*/
export interface InventoryDestination {
/**
* Bucket where all inventories will be saved in.
*/
readonly bucket: IBucket;
/**
* The prefix to be used when saving the inventory.
*
* @default - No prefix.
*/
readonly prefix?: string;
/**
* The account ID that owns the destination S3 bucket.
* If no account ID is provided, the owner is not validated before exporting data.
* It's recommended to set an account ID to prevent problems if the destination bucket ownership changes.
*
* @default - No account ID.
*/
readonly bucketOwner?: string;
}
/**
* Specifies the inventory configuration of an S3 Bucket.
*
* @see https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html
*/
export interface Inventory {
/**
* The destination of the inventory.
*/
readonly destination: InventoryDestination;
/**
* The inventory will only include objects that meet the prefix filter criteria.
*
* @default - No objects prefix
*/
readonly objectsPrefix?: string;
/**
* The format of the inventory.
*
* @default InventoryFormat.CSV
*/
readonly format?: InventoryFormat;
/**
* Whether the inventory is enabled or disabled.
*
* @default true
*/
readonly enabled?: boolean;
/**
* The inventory configuration ID.
*
* @default - generated ID.
*/
readonly inventoryId?: string;
/**
* Frequency at which the inventory should be generated.
*
* @default InventoryFrequency.WEEKLY
*/
readonly frequency?: InventoryFrequency;
/**
* If the inventory should contain all the object versions or only the current one.
*
* @default InventoryObjectVersion.ALL
*/
readonly includeObjectVersions?: InventoryObjectVersion;
/**
* A list of optional fields to be included in the inventory result.
*
* @default - No optional fields.
*/
readonly optionalFields?: string[];
}
export interface BucketProps {

@@ -722,2 +841,10 @@ /**

readonly serverAccessLogsPrefix?: string;
/**
* The inventory configuration of the bucket.
*
* @see https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html
*
* @default - No inventory configuration
*/
readonly inventories?: Inventory[];
}

@@ -760,2 +887,3 @@ /**

private readonly cors;
private readonly inventories;
constructor(scope: Construct, id: string, props?: BucketProps);

@@ -818,2 +946,8 @@ /**

addObjectRemovedNotification(dest: IBucketNotificationDestination, ...filters: NotificationKeyFilter[]): void;
/**
* Add an inventory configuration.
*
* @param inventory configuration to add
*/
addInventory(inventory: Inventory): void;
private validateBucketName;

@@ -842,2 +976,3 @@ /**

private allowLogDelivery;
private parseInventoryConfiguration;
}

@@ -844,0 +979,0 @@ /**

28

package.json
{
"name": "@aws-cdk/aws-s3",
"version": "1.56.0",
"version": "1.57.0",
"description": "CDK Constructs for AWS S3",

@@ -65,15 +65,15 @@ "main": "lib/index.js",

"devDependencies": {
"@aws-cdk/assert": "1.56.0",
"@aws-cdk/assert": "1.57.0",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "1.56.0",
"cdk-integ-tools": "1.56.0",
"cfn2ts": "1.56.0",
"cdk-build-tools": "1.57.0",
"cdk-integ-tools": "1.57.0",
"cfn2ts": "1.57.0",
"nodeunit": "^0.11.3",
"pkglint": "1.56.0"
"pkglint": "1.57.0"
},
"dependencies": {
"@aws-cdk/aws-events": "1.56.0",
"@aws-cdk/aws-iam": "1.56.0",
"@aws-cdk/aws-kms": "1.56.0",
"@aws-cdk/core": "1.56.0",
"@aws-cdk/aws-events": "1.57.0",
"@aws-cdk/aws-iam": "1.57.0",
"@aws-cdk/aws-kms": "1.57.0",
"@aws-cdk/core": "1.57.0",
"constructs": "^3.0.2"

@@ -83,6 +83,6 @@ },

"peerDependencies": {
"@aws-cdk/aws-events": "1.56.0",
"@aws-cdk/aws-iam": "1.56.0",
"@aws-cdk/aws-kms": "1.56.0",
"@aws-cdk/core": "1.56.0",
"@aws-cdk/aws-events": "1.57.0",
"@aws-cdk/aws-iam": "1.57.0",
"@aws-cdk/aws-kms": "1.57.0",
"@aws-cdk/core": "1.57.0",
"constructs": "^3.0.2"

@@ -89,0 +89,0 @@ },

@@ -227,2 +227,50 @@ ## Amazon S3 Construct Library

### S3 Inventory
An [inventory](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) contains a list of the objects in the source bucket and metadata for each object. The inventory lists are stored in the destination bucket as a CSV file compressed with GZIP, as an Apache optimized row columnar (ORC) file compressed with ZLIB, or as an Apache Parquet (Parquet) file compressed with Snappy.
You can configure multiple inventory lists for a bucket. You can configure what object metadata to include in the inventory, whether to list all object versions or only current versions, where to store the inventory list file output, and whether to generate the inventory on a daily or weekly basis.
```ts
const inventoryBucket = new s3.Bucket(this, 'InventoryBucket');
const dataBucket = new s3.Bucket(this, 'DataBucket', {
inventories: [
{
frequency: s3.InventoryFrequency.DAILY,
includeObjectVersions: s3.InventoryObjectVersion.CURRENT,
destination: {
bucket: inventoryBucket,
},
},
{
frequency: s3.InventoryFrequency.WEEKLY,
includeObjectVersions: s3.InventoryObjectVersion.ALL,
destination: {
bucket: inventoryBucket,
prefix: 'with-all-versions',
},
}
]
});
```
If the destination bucket is created as part of the same CDK application, the necessary permissions will be automatically added to the bucket policy.
However, if you use an imported bucket (i.e `Bucket.fromXXX()`), you'll have to make sure it contains the following policy document:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "InventoryAndAnalyticsExamplePolicy",
"Effect": "Allow",
"Principal": { "Service": "s3.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": ["arn:aws:s3:::destinationBucket/*"]
}
]
}
```
### Website redirection

@@ -229,0 +277,0 @@

@@ -32,2 +32,3 @@ import { Test } from 'nodeunit';

'static import(ref) allows importing an external/existing bucket'(test: Test): void;
'import does not create any resources'(test: Test): void;
'import can also be used to import arbitrary ARNs'(test: Test): void;

@@ -86,3 +87,4 @@ };

'Bucket Allow Log delivery changes bucket Access Control should fail'(test: Test): void;
'Defaults for an inventory bucket'(test: Test): void;
};
export = _default;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc