For deploying the frontend, I used AWS S3 static website hosting
- In AWS console search for S3
- Click on the Create bucket button. It will launch a new wizard.
- Provide the bucket-name and the region where you want to locate the bucket.
- Under public access settings, uncheck the Block all public access option
Make sure to check ✅ I acknowledge that the current settings might result in the his bucket and the objects within becoming public
- Disable Bucket Versioning for the sake of this project
- Click Create bucket
- After creation choose the bucket
- Choose 'Permission' tab
- In 'Bucket policy' section choose 'Edit'
- Add bucket policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::BUCKETNAME/*"
]
}
]
}
Make sure change
BUCKETNAMEto your bucket name and save changes
- Now go to 'Properties' tab
- In 'Static website hosting' section choose Edit
- choose Enable, *Host a static website, and provide index document e.g.
index.html - Save changes.
aws s3 cp --recursive ./www s3://BUCKETNAME/
