Skip to content

Instantly share code, notes, and snippets.

@rizerzero
Forked from ultimagriever/create-s3-bucket.sh
Created January 8, 2019 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rizerzero/8f07a55931b1323bba1fc26729594fad to your computer and use it in GitHub Desktop.
Save rizerzero/8f07a55931b1323bba1fc26729594fad to your computer and use it in GitHub Desktop.
APP_DEV=static.intermail.dev.$1.jp7.com.br
echo "Creating S3 development bucket " $APP_DEV"...\n"
aws s3api create-bucket --bucket $APP_DEV --region us-east-1
echo "Setting Static Web Hosting...\n"
aws s3api put-bucket-website --bucket $APP_DEV --website-configuration file://website-config.json
echo "Bucket" $APP_DEV "created, visit AWS Console to create IAM user for said bucket.\n"
APP_QA=static.intermail.qa.$1.jp7.com.br
echo "Creating S3 Quality Assurance bucket " $APP_QA"...\n"
aws s3api create-bucket --bucket $APP_QA --region us-east-1
echo "Setting Static Web Hosting...\n"
aws s3api put-bucket-website --bucket $APP_QA --website-configuration file://website-config.json
echo "Bucket" $APP_QA "created, visit AWS Console to create IAM user for said bucket.\n"
APP=static.intermail.$1.jp7.com.br
echo "Creating S3 production bucket " $APP"...\n"
aws s3api create-bucket --bucket $APP --region us-east-1
echo "Setting Static Web Hosting...\n"
aws s3api put-bucket-website --bucket $APP --website-configuration file://website-config.json
echo "Setting Versioning...\n"
aws s3api put-bucket-versioning --bucket $APP --versioning-configuration Status=Enabled
echo "Bucket" $APP "created, visit AWS Console to create IAM user for said bucket.\n"
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "404.html"
}
}
@rizerzero
Copy link
Author

rizerzero commented Jan 8, 2019

config file syntax and space is imporant to avoid errors ✔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment