Skip to content

S3 Config Credentials

Steve Chung edited this page Aug 29, 2018 · 5 revisions

In the AWS Management Console, go to the S3 section and create a S3 bucket with a bucket name, we’ll call <S3_BUCKET>. I recommend calling the bucket your domain name (www.yourwebsite.com or yourwebsite.com to match the domain you're hosting).

Then go to Amazon IAM > Users. Add a new User and give him Programmatic Access and give him the following policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "gostaticaccess",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::<S3_BUCKET>/*",
                "arn:aws:s3:::<S3_BUCKET>"
            ]
        }
    ]
}

After, you'll receive a Access Key ID and Secret Access Key (you can’t retrieve the Secret Access Key later, so take care of them). Given your <S3_BUCKET>, Access Key ID and Secret Access Key, you can proceed making changes within the gostatic code.

Clone this wiki locally