Amazon S3

S3 Transfer Acceleration

S3 Transfer Acceleration is a new option that can be enabled on S3 buckets to increase the download speed of objects stored in the bucket.

Please note that AWS charges an additional fee for this service.

Enabling S3 Transfer Acceleration

packagecloud:enterprise starting at version 1.0.33 supports S3 Transfer Acceleration.

To enable S3 Transfer Acceleration for use with packagecloud, you must first enable this feature for your packagecloud S3 bucket:

  1. Log into the AWS management console (https://console.aws.amazon.com) and click on the S3 bucket you are using with packagecloud.
  2. Click the Properties button at the top of the AWS console.
  3. Scroll down the list of options and click Transfer Acceleration.
  4. Click the enable button.

Once the feature is enabled for your bucket, you must modify your /etc/packagecloud/packagecloud.rb file to enable this option:

  1. Modify /etc/packagecloud/packagecloud.rb and set packagecloud_rails['aws_host'] = "s3-accelerate.amazonaws.com"

This option can be found in the S3 Repository Storage section of /etc/packagecloud/packagecloud.rb

Verifying S3 Transfer Acceleration

You can verify S3 Transfer Acceleration is working by using the command line tool curl to download a file from your packagecloud:enterprise install.

Simply copy the download link for a package and run curl -Lv [url] 2>&1 > /dev/null | grep accel which will display:

About to connect() to bucket-name.s3-accelerate.amazonaws.com port 443 (#1)

Example IAM policy

This example policy allows the IAM user to create buckets on S3 (needed if packagecloud_rails['aws_create_bucket'] is set to true) and all other necessary operations on the my_packagecloud_bucket bucket.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1446076395544",
      "Action": [
        "s3:CreateBucket",
        "s3:ListAllMyBuckets"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Sid": "Stmt1446076438706",
      "Action": [
        "s3:*""
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::my_packagecloud_bucket",
        "arn:aws:s3:::my_packagecloud_bucket/*"
      ]
    }
  ]
}

Related Pages: