bin/deploy uploads the static website files to S3 and invalidates the
whole CloudFront distribution.
brew install awscliAWS credentials in ~/.aws/credentials:
[petafox.com]
aws_access_key_id = MY_ACCESS_KEY_ID
aws_secret_access_key = MY_SECRET_ACCESS_KEYCreate ~/.aws/config:
[profile petafox.com]
region = eu-north-1
output = jsonDeploy [using an optional AWS profile name]:
./bin/deploy [aws_profile_name]Create a dedicated IAM user for this deploy script, for example petafox-com-deploy.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DeployWebsiteBucketObjects",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::www.petafox.com/*"
},
{
"Sid": "ListWebsiteBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::www.petafox.com"
},
{
"Sid": "InvalidateWebsiteDistribution",
"Effect": "Allow",
"Action": "cloudfront:CreateInvalidation",
"Resource": "arn:aws:cloudfront::AWS_ACCOUNT_ID:distribution/CLOUDFRONT_DISTRIBUTION_ID"
}
]
}