Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

A2 CC (Assi4)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Assignment No – 04

Name : Atharva Ram Pardeshi


Roll No : 321049
PRN : 22110917
Div : TY – A
Aim : Deploy static website on cloud using S3 bucket

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.

2. Step-by-Step Guide to Upload Static Web Application on AWS Cloud using S3


Service:

• Sign in to AWS Console: Go to the AWS Management Console


(https://aws.amazon.com/console/) and sign in to your AWS account using
your credentials.
• Navigate to S3 Service: Once logged in, navigate to the Amazon S3 service by
clicking on "Services" in the top-left corner of the console and selecting "S3"
under the "Storage" category.
• Create a New S3 Bucket: Click on the "Create bucket" button to create a new
bucket for storing your static web application files. Enter a unique bucket
name and choose the AWS region for your bucket.
• configure Bucket Properties: Configure the bucket properties as per your
requirements, including versioning, logging, encryption, and permissions.
Click on "Create bucket" to create the bucket with the specified settings.
• Upload Web Application Files: Select the newly created bucket from the list
of buckets and click on the "Upload" button. Use the file upload dialog to
select the static web application files (HTML, CSS, JavaScript, images, etc.)
from your local machine and upload them to the bucket.

• 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.

Steps to deploy static website on cloud using s3 bucket :

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.

3. Upload Files in S3 Bucket:


• Click on the S3 bucket where you want to upload files. This will open the
bucket's overview page
• On the bucket's overview page, click the "Upload" button.
• Click the "Add files" button to select the files you want to upload from
your local file system.
4. Add a bucket policy:
• Under Buckets, choose the name of your bucket.
• Choose Permissions.
• Under Bucket Policy, choose Edit.
• To grant public read access for your website, copy the following bucket
policy, and paste it in the Bucket policy editor. Change bucket
{

"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.

You might also like