How to make CodePipe public index.html pages to web s3

0

Hello-
Trying to send index.html files to a public S3 bucket for public-web-hosting. Is there a way to automatically make public these files that deposited into the public bucket? Because these files are being set to default/private when deposited into the bucket.

My goal is to create a pipeline that deposits index.html files into a public S3 bucket. The tutorial is at:
https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-s3deploy.html?shortFooter=true

I’m successfully using git-commands to push and commit files (such as index.html) from my laptop to the CodeCommit Repository.

I created a CodePipeline that uses CodeCommit to “send” and “deploy” the web files to the public bucket; which again is triggered by my git push. Web files are definitely sent to the bucket; but I have to select “Make Public” to each file to have the bucket host out that index.html (Otherwise the common / infamous XML, Access Denied error message).

Due to this simplicity (or the simplicity I was hoping for) I am not using CodeBuild nor CodeDeploy. Simply sending out an index.html file.

Is there a configuration I am missing? Thank you.

gefragt vor 5 Jahren230 Aufrufe
1 Antwort
0

Solution:
There must be a bucket policy to AllowPublicRead.
And this is in addition to enabling bucket for web hosting.
{"Version": "2008-10-17",
"Statement": [{"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": ""
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/
"
}]}

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen