0% found this document useful (0 votes)
13 views15 pages

Cloud Computing

The document provides a step-by-step guide on hosting a static website using AWS S3, allocating and associating an Elastic IP to an EC2 instance, and implementing versioning on S3 buckets to protect data. It includes instructions for creating an S3 bucket, enabling static website hosting, uploading files, setting public permissions, and managing Elastic IPs. Additionally, it details how to enable versioning, upload and modify files, view object versions, and recover previous versions in S3.

Uploaded by

akm045402
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

Cloud Computing

The document provides a step-by-step guide on hosting a static website using AWS S3, allocating and associating an Elastic IP to an EC2 instance, and implementing versioning on S3 buckets to protect data. It includes instructions for creating an S3 bucket, enabling static website hosting, uploading files, setting public permissions, and managing Elastic IPs. Additionally, it details how to enable versioning, upload and modify files, view object versions, and recover previous versions in S3.

Uploaded by

akm045402
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Name – Ankit Kumar

Mishra
Class - CS (7A)
Uni roll no - 2100290120030

Cloud Computing

Question-2: Host a Static Website Using AWS S3

Create an S3 Bucket:

● Log in to the AWS Management Console.


● Go to the S3 Service and click Create Bucket.
● Enter the bucket name matching your domain (e.g., example.com).
● Leave other settings as default and click Create Bucket.
Enable Static Website Hosting:

● Click on your bucket name, go to the Properties tab.


● Under Static Website Hosting, select Enable.
● Specify the index document (e.g., index.html) and error document (optional).
Upload Website Files:

● Go to the Objects tab and click Upload.


● Select all your HTML, CSS, and JavaScript files and upload them.
Set Public Permissions:

● Update the bucket policy to allow public access to files.


● Go to Permissions -> Bucket Policy, and add the following policy:
Question-6: Allocate and Associate an Elastic IP to an EC2 Instance

Allocate an Elastic IP:

● Navigate to the EC2 Dashboard.


● Click on Elastic IPs under the Network & Security section.
● Click Allocate Elastic IP Address and confirm the allocation.

Allocate an Elastic IP Address (if not already done)

1. On the left-hand menu, click Elastic IPs under the "Network & Security" section.
2. Click the Allocate Elastic IP address button.
3. Choose an Elastic IP pool (usually the default Amazon pool).
4. Click Allocate.
5. Note the Elastic IP allocated to you.
Associate the Elastic IP Address

1. With the Elastic IP selected, click the Actions drop-down at the top right.
2. Choose Associate Elastic IP address from the menu.

Choose the EC2 Instance

1. Under Resource type, ensure Instance is selected.


2. From the Instance drop-down, select the running EC2 instance you want to
associate the Elastic IP with.
○ Alternatively, you can enter the instance ID manually.
3. Ensure the Private IP address field matches the private IP of your EC2 instance.

Confirm the Association

● Review your selections and click Associate.


● A confirmation message will appear once the Elastic IP is successfully associated.
Question 31: You want to protect critical data stored in S3 from accidental deletion or
modification. Implement versioning on the S3 bucket and demonstrate how to recover a previous
version of an object.

1. Enable Versioning

1. Go to the S3 Console:
○ Log in to your AWS Management Console and navigate to Amazon S3.
2. Select Your Bucket:
○ Locate and click on the bucket you want to enable versioning for.
3. Enable Versioning:
○ Go to the Properties tab of the bucket.
○ Under the Bucket Versioning section, click Edit.
○ Choose Enable, and save changes.
2. Upload and Modify Files

● Upload the Initial File:


○ In your bucket, go to the Objects tab.
○ Click Upload and add a file (e.g., example.txt).
○ Complete the upload process.
● Modify the File:
○ Upload a new version of the same file:
■ Ensure the file name is identical (e.g., example.txt).
■ This will automatically create a new version.
3. View Object Versions

Enable Version View:

○ In the bucket, click List versions from the Objects tab (this might appear as a
toggle).
○ You’ll see all versions of example.txt listed with their version IDs.
○ Each version will have a unique Version ID.
4. Recover a Previous Version

1. Download an Older Version:


○ Locate the previous version in the versions list.
○ Select it and click Download to retrieve it locally.
2. Restore as Current Version:
○ If you want to make an older version the current version:
■ Download the desired version.
■ Re-upload it with the same name (example.txt).

5. Test Deletion

1. Delete an Object:
○ Select the current version of example.txt and delete it.
○ S3 will create a Delete Marker, which becomes the "current version."
2. View Remaining Versions:
○ Toggle List versions again to view all previous versions.
○ The previous versions will still be intact.
3. Recover the Object:
○ To restore the object:
■ Delete the Delete Marker, which will make the most recent version the
current version again.

You might also like