To setup AWS S3 for your CI/CD,
-
Create S3 buckets for deployment
-
Create an IAM user
aws iam create-user --user-name ci-bot
S3 permissions for update web content
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::BUCKET_FOR_DEVELOPMENT",
"arn:aws:s3:::BUCKET_FOR_STAGING",
"arn:aws:s3:::BUCKET_FOR_PRODUCTION"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::BUCKET_FOR_DEVELOPMENT/*",
"arn:aws:s3:::BUCKET_FOR_STAGING/*",
"arn:aws:s3:::BUCKET_FOR_PRODUCTION/*"
]
}
]
}
CloudFront permissions for invalidating cache
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cloudfront:CreateInvalidation",
"Resource": "*"
}
]
}