aws-samples / aws-lex-web-ui

Sample Amazon Lex chat bot web interface
Other
745 stars 471 forks source link

S3 bucket ACLs issue, S3 buckets created by master.yaml are empty #680

Closed DeveloperXMA closed 6 months ago

DeveloperXMA commented 7 months ago

Hi, I have the exact similar issue as https://github.com/aws-samples/aws-lex-web-ui/issues/663

What I did was

  1. I go to the root folder's config file, change the env.mk line 8 to export BOOTSTRAP_BUCKET_PATH ?=mybootstrapbucketname/artifacts
  2. under root level build folder's upload-bootstrap.sh file, I removed the --acl public-read option in aws s3 cp command
  3. I followed the instructions here: https://github.com/aws-samples/aws-lex-web-ui?tab=readme-ov-file#building-and-deploying-your-own-lexwebui , run the commands
  4. After the commands run successfully, I have my bootstrapbucketname bucket with one folder called artifacts/ inside the artifacts folder, I have the custom-resources-v0.21.1.zip, initiate-chat-lambda-.....zip, src-v0.21.1.zip, streaming-lambda-v0.21.1.zip and a templates folder.
  5. I open the templates folder, download the mater.yaml file, go to cloud formation console using it.
  6. I enter the BootstrapBucket to bootstrapbucketname and the BootstrapPrefix to artifacts
  7. After the stack creation is complete, all the three S3 buckets created by this CF template is empty, which means, the webappbucket , lexwebuicloudfrontedistri, s3serveraccesslogs bucket are empty.

Please give some ideas where am I doing wrong.

What changes of the bot I made:

I just make a small dummy change to change the ./lex-web-ui/src/config/index.js some variables to have my own test, to do a POC, like I changethe textInputPlaceholder to This is the new Change and want to see if I will get my new changes with the master.yaml file I build and deployed.

My guess is this: in the read me, it says Note that "yourbootstrapbucket" (S3 bucket) must allow objects with public-read acl to be added.

But my S3 buckets has an account level Block Public Access settings for this account, so I guess when something try to read from my mybootstrapbucketname S3 bucket, it doesn't have access to read it?

Please advise or provide an example, what's the necessary settings to make S3 bucket allow objects with public-read acl while have account level block public access.

Or is there any steps I am missing, if I want to deploy my own bot, with a tiny change like I mentioned above.

Thanks,

atjohns commented 6 months ago

After speaking with the user this was a build issue that was deploying an empty src file to the S3 bucket, causing an error