Skip to content

Commit 4dc0809

Browse files
authored
Specify region for S3 bucket
downloads.typesafe.com is in us-east-1
1 parent 2f58fb1 commit 4dc0809

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ upload := {
2323
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain
2424
import com.amazonaws.services.s3.AmazonS3ClientBuilder
2525
import com.amazonaws.services.s3.model.{CannedAccessControlList, PutObjectRequest}
26+
import com.amazonaws.regions.Regions
2627

2728
// the publishing job runs on an EC2 instance that has access to the S3 bucket via its IAM instance profile
28-
val client = AmazonS3ClientBuilder.defaultClient
29+
val client = AmazonS3ClientBuilder.standard.withRegion(Regions.US_EAST_1).build
2930

3031
val log = streams.value.log
3132

3233
(mappings in upload).value map { case (file, key) =>
33-
log.debug("Uploading "+ file.getAbsolutePath() +" as "+ key)
34+
log.info("Uploading "+ file.getAbsolutePath() +" as "+ key)
3435

3536
// since the s3 bucket is in a separate account from where the EC2 CI instances are, must explicitly set acl as public-read
3637
client.putObject(new PutObjectRequest("downloads.typesafe.com", key, file).withCannedAcl(CannedAccessControlList.PublicRead))

0 commit comments

Comments
 (0)