Skip to content

Instantly share code, notes, and snippets.

@markusl
Created August 7, 2019 10:17
Show Gist options
  • Save markusl/6d01d6bce4c8c005832876cb6a3dcf0c to your computer and use it in GitHub Desktop.
Save markusl/6d01d6bce4c8c005832876cb6a3dcf0c to your computer and use it in GitHub Desktop.
AWS CDK S3 Example
#!/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