Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making public s3 artifacts from AWS code build

How to make the artifacts uploaded to s3 as part of an aws code build public by default? I'm experimenting build automation. At present the build is successful; however, the artifact created isn't public and hence I can't share the link (as part of a mail). By default, the server side encryption is set at Using AWS KMS master key: aws/s3 (default). When tried removing the encryption key from the advanced settings section of the aws code build config, it gave an error. I'm planning to run an aws lambda function that will send a mail with link of the artifact at the end of the build as part of the aws code pipeline.

Edit: I tried adding the following as the permission but it didn't help:

{
  "Version":"2012-10-17",
  "Statement":[
   {
    "Sid":"AddPerm",
    "Effect":"Allow",
    "Principal": "*",
    "Action":["s3:GetObject"],
    "Resource":["arn:aws:s3:::examplebucket/*"]
   }
  ]
}

as mentioned here

From S3 if I manually go and select none as the encryption, the link does become downloadable. However I need a programmatic way to do this as I'm trying to automate the entire process as part of the build automation. So far I'm not able to achieve this via boto3 too.

Thanks in advance!

like image 882
ranjjose Avatar asked May 26 '17 15:05

ranjjose


1 Answers

OK! I got a reply in aws developer forum as follows:

Thank you for this feature request, I have passed it to the team for further review. Your feedback is very much appreciated.

Which means the feature is probably not present now.

This is the link to the AWS dev forum. Anyways, there's a workaround for the time being. You can see that too in the same link or here with more details.

like image 172
ranjjose Avatar answered Sep 23 '22 18:09

ranjjose