Skip to content

Instantly share code, notes, and snippets.

@AlexzanderFlores
Created June 19, 2020 18:43
Show Gist options
  • Save AlexzanderFlores/80aeda53f03cc2902cf0ddad1961e17c to your computer and use it in GitHub Desktop.
Save AlexzanderFlores/80aeda53f03cc2902cf0ddad1961e17c to your computer and use it in GitHub Desktop.
// Scripts for https://youtu.be/FEI-uEdb2y8
"deploy": "react-scripts build && aws s3 rm s3://wornoffkeys.com/ --recursive && aws s3 cp ./build s3://wornoffkeys.com/ --recursive --acl public-read"
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::wornoffkeys.com/*"
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>
@ankusht2307
Copy link

{ "Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": ""
},
"Action": "s3:
",
"Resource": [
"arn:aws:s3:::bucket-name",
"arn:aws:s3:::bucket-name/*"
]
}
]
}

@ankusht2307
Copy link

Updated Scripts as per latest version

    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::bucket-name",
                "arn:aws:s3:::bucket-name/*"
            ]
        }
    ]
}

missing { at the begining

@mdmehedyhassan
Copy link

"deploy": "react-scripts build && aws s3 rm s3://wornoffkeys.com/ --recursive && aws s3 cp ./build s3://wornoffkeys.com/ --recursive --acl public-read"

this command didn't work can you say how is a change in this command. I am changing this wornoffkeys.com but is need for any change?

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