Home > Mobile >  How to manage s3 bucket for files and app?
How to manage s3 bucket for files and app?

Time:03-18

Can someone answer my these two questions plz

  1. Do I need to create seprate s3 buckets like one for react app and other for Images and files ?

  2. When I deploy my app like this:

    new s3Deployment.BucketDeployment(this, "deployStaticWebsite", {
     sources: [s3Deployment.Source.asset("../frontEnd/build")],
     destinationBucket: myBucket,
     distribution: distribution,
     // destinationKeyPrefix:"build",
     });
    

It replaces all the content of the bucket on every deploy. what is the best solution to avoid this.

CodePudding user response:

Yes you should have a separate bucket for website deployment and data storage. The bucket you use for website will usually be a public one (unless you are using it with cloudfront).

  • Related