Created
August 7, 2019 10:17
-
-
Save markusl/6d01d6bce4c8c005832876cb6a3dcf0c to your computer and use it in GitHub Desktop.
AWS CDK S3 Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
/** | |
* npm run build | |
* cdk deploy --profile demo BucketStack | |
* change code | |
* cdk diff --profile demo BucketStack | |
* cdk deploy --profile demo BucketStack | |
* cdk destroy --profile demo BucketStack | |
*/ | |
const myApp = new cdk.App(); | |
const stack = new cdk.Stack(myApp, 'BucketStack'); | |
new s3.Bucket(stack, 'ExampleBucket', { | |
removalPolicy: cdk.RemovalPolicy.DESTROY, | |
// encryption: s3.BucketEncryption.S3_MANAGED, | |
}); | |
myApp.synth(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment