Junior
How to deploy a simple static landing page on AWS?
sobes.tech AI
Answer from AI
Amazon S3 configured for a static website, with AWS CloudFront for CDN and SSL.
- Create an S3 bucket with public access.
- Upload static website files (index.html, CSS, JS, images).
- Enable "Static website hosting" in bucket settings.
- Specify index.html as the index document.
- (Optional) Configure an error document.
- Create a CloudFront distribution.
- Choose the created S3 bucket as the Origin Domain (from the list).
- Configure caching and behavior as needed.
- (Optional) Attach a custom domain and upload an SSL/TLS certificate from AWS Certificate Manager (ACM).
- Wait for the CloudFront distribution to deploy.
- Use the CloudFront domain name (or the custom domain if attached) to access the site.
Example of a bucket policy for public access:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*" // Replace YOUR_BUCKET_NAME
}
]
}