{"id":3945,"date":"2023-11-04T23:13:57","date_gmt":"2023-11-04T23:13:57","guid":{"rendered":"http:\/\/localhost:10003\/deploying-a-static-website-using-s3-bucket\/"},"modified":"2023-11-05T05:48:26","modified_gmt":"2023-11-05T05:48:26","slug":"deploying-a-static-website-using-s3-bucket","status":"publish","type":"post","link":"http:\/\/localhost:10003\/deploying-a-static-website-using-s3-bucket\/","title":{"rendered":"Deploying a Static Website using S3 Bucket"},"content":{"rendered":"
Amazon Simple Storage Service (S3) is a highly scalable, secure, and durable object storage service that can be used to store and retrieve any type of data, including static website files like HTML, CSS, and JavaScript. In this tutorial, we’ll explore how to deploy a static website using S3 bucket.<\/p>\n
Before deploying a static website, we need to create an S3 bucket. To create an S3 bucket, follow these steps:<\/p>\n
Once you have created the S3 bucket, it’s time to upload your website files to the bucket. To upload website files to the S3 bucket, follow these steps:<\/p>\n
By default, objects stored in S3 buckets are private and can’t be accessed by the public. To make the S3 bucket publicly accessible, follow these steps:<\/p>\n
To host a static website on an S3 bucket, we need to enable static website hosting. To enable static website hosting, follow these steps:<\/p>\n
To allow public access to the website hosted on the S3 bucket, we need to configure a bucket policy. A bucket policy is a JSON-based policy document that defines permissions for objects in a bucket. To configure the bucket policy, follow these steps:<\/p>\n
your-bucket-name<\/code> with your bucket name.<\/li>\n<\/ol>\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Principal\": \"*\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": [\n \"arn:aws:s3:::your-bucket-name\/*\"\n ]\n }\n ]\n}\n<\/code><\/pre>\n\n- Click the “Save” button to save the bucket policy.<\/li>\n<\/ol>\n
6. Test the Website<\/h2>\n
Now that you have deployed your static website on the S3 bucket, it’s time to test it. To test the website, follow these steps:<\/p>\n
\n- Copy the endpoint URL from the “Static website hosting” card on the “Properties” tab of your S3 bucket. The URL should look like this: `http:\/\/your-bucket-name.s3-website.your-region.amazonaws.com\/`<\/li>\n
- Open a web browser and paste the endpoint URL in the address bar.<\/li>\n
- Press Enter to load the website.<\/li>\n
- If the website loads successfully, congratulations! Your website has been successfully deployed on the S3 bucket.<\/li>\n<\/ol>\n
Conclusion<\/h2>\n
Amazon S3 is a simple and cost-effective solution for deploying static websites. With S3, you can store and serve files, and it also provides a secure and scalable infrastructure. By following the steps outlined in this tutorial, you can easily deploy your static website on an S3 bucket.<\/p>\n","protected":false},"excerpt":{"rendered":"
Deploying a Static Website using Amazon S3 Bucket Amazon Simple Storage Service (S3) is a highly scalable, secure, and durable object storage service that can be used to store and retrieve any type of data, including static website files like HTML, CSS, and JavaScript. In this tutorial, we’ll explore how Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[488,489,491,486,493,492,490,487,485],"yoast_head":"\nDeploying a Static Website using S3 Bucket - Pantherax Blogs<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n