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.

feita há 5 anos230 visualizações
1 Resposta
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/
"
}]}

respondido há 5 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas