Skip to content

Instantly share code, notes, and snippets.

View ShubhamRasal's full-sized avatar
💻
Cooking software

Shubham Rasal ShubhamRasal

💻
Cooking software
View GitHub Profile
@ShubhamRasal
ShubhamRasal / create s3 bucket
Created October 18, 2020 15:50
create s3 bucket
$ aws s3api create-bucket --bucket shubham-demo-bucket --region us-east-1
@ShubhamRasal
ShubhamRasal / s3_bucket_policy
Created October 18, 2020 15:58
s3_bucket_policy
{
"Version": "2008-10-17",
"Id": "PolicyForPublicWebsiteContent",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@ShubhamRasal
ShubhamRasal / update-bucket-policy
Last active October 27, 2020 19:18
update-bucket-policy
$ aws s3api put-bucket-policy --bucket shubham-demo-bucket --policy file://s3_bucket_policy.txt
@ShubhamRasal
ShubhamRasal / website_configuration
Created October 18, 2020 16:05
website_configuration
{
"ErrorDocument": {
"Key": "index.html"
},
"IndexDocument": {
"Suffix": "index.html"
}
}
@ShubhamRasal
ShubhamRasal / put-bucket-website
Created October 18, 2020 16:09
put-bucket-website
$ aws s3api put-bucket-website --bucket shubham-demo-bucket --website-configuration file://website_configuration.txt
@ShubhamRasal
ShubhamRasal / create-distribution --generate
Last active October 18, 2020 16:16
create-distribution --generate
$ aws cloudfront create-distribution --generate-cli-skeleton > cf_config.json
{
"CallerReference": "cli-example",
"Aliases": {
"Quantity":0
},
"DefaultRootObject": "index.html",
"Origins": {
"Quantity": 1,
"Items": [
{
@ShubhamRasal
ShubhamRasal / create-distribution
Created October 18, 2020 16:44
create-distribution
aws cloudfront create-distribution --distribution-config file://cf_config.json
@ShubhamRasal
ShubhamRasal / s3 cp
Last active October 18, 2020 17:03
s3 cp
aws s3 cp dist/angular-demo s3://shubham-demo-bucket --recursive --exclude "*.svg" --cache-control public,max-age=86400
@ShubhamRasal
ShubhamRasal / s3 cp svg
Last active October 18, 2020 17:09
s3 cp svg
$ aws s3 cp dist/angular-demo s3://shubham-demo-bucket --recursive --exclude "*" --include "*.svg" --no-guess-mime-type --content-type "image/svg+xml" --cache-control public,max-age=86400