A2 CC (Assi4)
A2 CC (Assi4)
A2 CC (Assi4)
Theory :
1. AWS S3 Service:
Amazon Simple Storage Service (S3) is a scalable object storage service offered by
Amazon Web Services (AWS). It allows users to store and retrieve any amount of
data from anywhere on the web, providing a highly durable and available storage
infrastructure. S3 is designed to deliver 99.999999999% durability and offers
various features such as versioning, encryption, lifecycle management, and access
control to securely manage data storage needs for a wide range of applications.
• Set Permissions: After uploading the files, select them in the bucket and click
on the "Actions" dropdown menu. Choose "Make public" or configure the
appropriate permissions to ensure that the web application files are publicly
accessible.
• Configure Static Website Hosting: Once the files are uploaded, navigate to
the "Properties" tab of the bucket and click on "Static website hosting."
Enable static website hosting and specify the index document (e.g.,
index.html) and error document if required.
• Access Web Application: After configuring static website hosting, AWS will
provide you with a website endpoint URL (e.g., http://your-bucket-
name.s3website-us-east-1.amazonaws.com/). Use this URL to access your
static web application hosted on AWS S3.
• Testing: Test the accessibility and functionality of your static web application
by accessing the provided URL in a web browser. Ensure that all elements
and features of the application work as expected.
• Monitoring and Management: Monitor the performance and usage of your
web application using AWS CloudWatch metrics and logs. Manage the S3
bucket and its contents as needed, including updating files, configuring
access permissions, and setting up lifecycle policies for data management.
1. Create an S3 Bucket:
• Navigate to the Amazon S3 service.
• Click the "Create bucket" button.
• Choose a unique and meaningful name for your bucket (e.g., "my-
static- website").
• Select the AWS region where you want to create the bucket and click
"Next."
2. Enable Static Website Hosting:
• After creating your S3 bucket and navigating to the bucket's overview
page:
• Click on the bucket name to open the bucket's settings.
• In the top navigation tabs, locate and click on the "Properties" tab.
• Scroll down to find the "Static website hosting" card.
• Click on it, and in the "Static website hosting" section, select the
"Enabled" option.
• Specify the "Index document" (usually "index.html") as the default page
for your website.
• Optionally, specify an "Error document" if you have a custom error page
(e.g., "error.html").
• Click the "Save changes" button to save your settings.
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::Bucket-Name/*"
]
]
}
5. Access Your S3 Bucket Website:
• In the S3 bucket's overview page, scroll down to the "Permissions" tab.
• Under the "Static Website Hosting" card, Copy ARN
• bucket's ARN (Amazon Resource Name). This ARN is your static
website's URL.
• In the address bar of your web browser, paste the ARN or URL you
copied.
• Press "Enter" or click "Go."
Conclusion:
• Thus, we have deployed static website on cloud using ASW S3 bucket
service.