Advertisement
Javi

CDK: Uploading files to S3 bucket

Oct 8th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import s3deploy = require('@aws-cdk/aws-s3-deployment');
  2.  
  3. const appBucket = new s3.Bucket(this, 'assets');
  4.  
  5. new s3deploy.BucketDeployment(this, 'DeployFiles', {
  6. sources: [s3deploy.Source.asset('./assets')],
  7. destinationBucket: appBucket,
  8. });
  9. new cdk.CfnOutput(this, 'AppBucket', {
  10. value: appBucket.bucketName
  11. });
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement