@aws-cdk/aws-s3
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -256,2 +256,17 @@ import actions = require('@aws-cdk/aws-codepipeline-api'); | ||
lifecycleRules?: LifecycleRule[]; | ||
/** | ||
* The name of the index document (e.g. "index.html") for the website. Enables static website | ||
* hosting for this bucket. | ||
*/ | ||
websiteIndexDocument?: string; | ||
/** | ||
* The name of the error document (e.g. "404.html") for the website. | ||
* `websiteIndexDocument` must also be set if this is set. | ||
*/ | ||
websiteErrorDocument?: string; | ||
/** | ||
* Grants public read access to all objects in the bucket. | ||
* Similar to calling `bucket.grantPublicAccess()` | ||
*/ | ||
publicReadAccess?: boolean; | ||
} | ||
@@ -330,2 +345,3 @@ /** | ||
private parseLifecycleConfiguration; | ||
private renderWebsiteConfiguration; | ||
} | ||
@@ -332,0 +348,0 @@ /** |
{ | ||
"name": "@aws-cdk/aws-s3", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "CDK Constructs for AWS S3", | ||
@@ -55,16 +55,16 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@aws-cdk/assert": "^0.12.0", | ||
"cdk-build-tools": "^0.12.0", | ||
"cdk-integ-tools": "^0.12.0", | ||
"cfn2ts": "^0.12.0", | ||
"pkglint": "^0.12.0" | ||
"@aws-cdk/assert": "^0.13.0", | ||
"cdk-build-tools": "^0.13.0", | ||
"cdk-integ-tools": "^0.13.0", | ||
"cfn2ts": "^0.13.0", | ||
"pkglint": "^0.13.0" | ||
}, | ||
"dependencies": { | ||
"@aws-cdk/aws-codepipeline-api": "^0.12.0", | ||
"@aws-cdk/aws-iam": "^0.12.0", | ||
"@aws-cdk/aws-kms": "^0.12.0", | ||
"@aws-cdk/aws-s3-notifications": "^0.12.0", | ||
"@aws-cdk/cdk": "^0.12.0" | ||
"@aws-cdk/aws-codepipeline-api": "^0.13.0", | ||
"@aws-cdk/aws-iam": "^0.13.0", | ||
"@aws-cdk/aws-kms": "^0.13.0", | ||
"@aws-cdk/aws-s3-notifications": "^0.13.0", | ||
"@aws-cdk/cdk": "^0.13.0" | ||
}, | ||
"homepage": "https://github.com/awslabs/aws-cdk" | ||
} |
@@ -58,20 +58,28 @@ ## AWS S3 Construct Library | ||
### Bucket Policy | ||
### Permissions | ||
By default, a bucket policy will be automatically created for the bucket upon the first call to `addToPolicy(statement)`: | ||
A bucket policy will be automatically created for the bucket upon the first call to | ||
`addToResourcePolicy(statement)`: | ||
```ts | ||
const bucket = new Bucket(this, 'MyBucket'); | ||
bucket.addToPolicy(statement); | ||
// we now have a policy! | ||
bucket.addToResourcePolicy(new iam.PolicyStatement() | ||
.addActions('s3:GetObject') | ||
.addAllResources()); | ||
``` | ||
You can bring you own policy as well: | ||
Most of the time, you won't have to manipulate the bucket policy directly. | ||
Instead, buckets have "grant" methods called to give prepackaged sets of permissions | ||
to other resources. For example: | ||
```ts | ||
const policy = new BucketPolicy(this, 'MyBucketPolicy'); | ||
const bucket = new Bucket(this, 'MyBucket', { policy }); | ||
const lambda = new lambda.Function(this, 'Lambda', { /* ... */ }); | ||
const bucket = new Bucket(this, 'MyBucket'); | ||
bucket.grantReadWrite(lambda.role); | ||
``` | ||
Will give the Lambda's execution role permissions to read and write | ||
from the bucket. | ||
### Buckets as sources in CodePipeline | ||
@@ -78,0 +86,0 @@ |
@@ -38,3 +38,8 @@ import { Test } from 'nodeunit'; | ||
}; | ||
'website configuration': { | ||
'only index doc'(test: Test): void; | ||
'fails if only error doc is specified'(test: Test): void; | ||
'error and index docs'(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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
996707
6702
222
+ Added@aws-cdk/aws-codepipeline-api@0.13.0(transitive)
+ Added@aws-cdk/aws-events@0.13.0(transitive)
+ Added@aws-cdk/aws-iam@0.13.0(transitive)
+ Added@aws-cdk/aws-kms@0.13.0(transitive)
+ Added@aws-cdk/aws-s3-notifications@0.13.0(transitive)
+ Added@aws-cdk/cdk@0.13.0(transitive)
+ Added@aws-cdk/cx-api@0.13.0(transitive)
- Removed@aws-cdk/aws-codepipeline-api@0.12.0(transitive)
- Removed@aws-cdk/aws-events@0.12.0(transitive)
- Removed@aws-cdk/aws-iam@0.12.0(transitive)
- Removed@aws-cdk/aws-kms@0.12.0(transitive)
- Removed@aws-cdk/aws-s3-notifications@0.12.0(transitive)
- Removed@aws-cdk/cdk@0.12.0(transitive)
- Removed@aws-cdk/cx-api@0.12.0(transitive)
Updated@aws-cdk/aws-iam@^0.13.0
Updated@aws-cdk/aws-kms@^0.13.0
Updated@aws-cdk/cdk@^0.13.0