How to Configure an Amazon S3 Bucket

Description

Amazon S3 Buckets can be used to store files, such as images or documents. S3 Buckets can also be used with AlphaLaunch to host application installation files.

 Setting the CORS Policy

Before you can upload files to Amazon S3, you must configure your Amazon bucket to allow CORS support. CORS (Cross-Origin Resource Sharing) allows you to make callbacks to a different server than the server from which the page was originally loaded (your Alpha server). To configure your bucket you will need to open the AWS console.

To configure the CORS policy on an Amazon S3 Bucket, open the Amazon Web Services Management Console, select the bucket, then click the Properties button. From the Properties screen, open the Permissions section. Then, click the Edit CORS Configuration button.

Below is a sample configuration that can be pasted into the configuration dialog:

<CORSConfiguration>
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>PUT</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Content-Type</AllowedHeader>
        <AllowedHeader>x-amz-acl</AllowedHeader>
        <AllowedHeader>origin</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

 Setting a Bucket Policy

The S3 buckets used with Alpha Anywhere must have a CORS policy set. They also need a bucket policy to allow public read for objects in the Bucket - especially if you are using the Bucket to publish applications to AlphaLaunch. The Bucket policy can be set in the Amazon AWS management console and it will look something like this:

{
    "Id": "Policy1513279106848",
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1513279094040",
            "Action": [
                "s3:GetObject"
            ],
            "Effect": "Allow",
            "Resource": "arn:aws:s3:::your-bucket-name/*",
            "Principal": "*"
        }
    ]
}

 Additional Resources

For more information on how to create and configure Amazon S3 Buckets, refer to Amazon's documentation.

See Also