> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hosting a static website - Amazon S3 Challenge

> Hands-on lab · 45m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/hosting-a-static-website-amazon-s3-challenge" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

This week's lab challenge is about website hosting in AWS Cloud. Website hosting is a service that allows you to publish a website on the Internet. The Cloud provides all the latest technologies and fully managed services for web hosting. You will face a real time hosting Challenge in which you have to host a static website using S3 Service. This challenge will test your knowledge on S3 in depth. All the best!

### Prerequisites

1. Good knowledge of AWS services

   * Amazon S3
2. Laptop/Desktop
3. Internet Browser
4. Internet connection

### Challenge Instructions

1. **Region** : Make sure to use **us-east-1** region to create all the resources.
2. You will be provided with the requirements of the challenge. If you are new to AWS Cloud, we recommend you go through our hands-on Labs before taking this challenge.
3. Challenge Duration: **45 minutes**

### How to submit the challenge

1. After building the infrastructure, click on the **Check my work** button, to validate if you have built the required infrastructure and completed the challenge successfully.
2. Validation status

   * **Success** - You have completed the challenge successfully.
   * **Failed** - You have failed to complete the challenge.
3. Once you have successfully validated the challenge, click on **End lab** button.

### Launching Challenge Environment

1. To launch the challenge environment, Click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the challenge is started, you will be provided with **IAM user name**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

<Note>
  You can only start one challenge at any given time
</Note>

## Files you need

Download these before you start — the lab cannot be completed without them.

* [Download Zip](/images/labs/downloads/hosting-a-static-website-amazon-s3-challenge/download-zip.zip)

## Lab guide

### Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.
2. On the AWS sign-in page,

* Leave the Account ID as default. Never edit/remove the 12 digit Account ID present in the AWS Console. otherwise, you cannot proceed with the lab.
* Now copy your **User Name** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign in** button.

5. Once Signed In to the AWS Management Console, Make the default AWS Region as **US East (N. Virginia) us-east-1.**

### Cloud Challenge Details

In this lab challenge, your Amazon S3 skill is put to the test. You'll be given a requirement and you have to reach it using your knowledge of Amazon S3 and other AWS services. The Lab Challenge helps you understand the real-time scenarios.

**A company XYZ needs to host a web application as a part of their infrastructure. Now your challenge is to create a static HTML website using Amazon S3 and make it accessible from the internet.**

**Follow the below instructions to complete this challenge.**

1. Create a **Bucket** and uncheck **Block all Public access**.
2. [**Click here**](/images/labs/downloads/hosting-a-static-website-amazon-s3-challenge/download-zip.zip) to download the zip file and unzip it to find two html files. Index.html and error.html files.
3. Add the below policy as the bucket policy and replace **S3\_BUCKET\_ARN** with your buckets Arn.

\{

"Id": "Policy1",

"Version": "2012-10-17",

"Statement": \[

\{

"Sid": "Stmt1",

"Action": \[

"s3:GetObject"

],

"Effect": "Allow",

"Resource": "S3\_BUCKET\_ARN/\*",

"Principal": "\*"

}

]

}

4. Upload the **index.html** and **error.html** files to your S3 bucket.
5. Enable Static Website hosting:

   1. Choose **index.html** as Index Document
   2. Choose **error.html** as Error Document
6. Test the website by accessing the S3 Endpoint in your browser.
7. Test the error page by adding some random characters at the end of the URL.

#### End lab

1. Sign out of the AWS Account
2. You have successfully completed the challenge.
3. Click on **End lab** button in the IP Lab Portal and wait till the process gets completed.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Create an AWS S3 Bucket with Policy** — Check whether S3 bucket is created and bucket policy added or not
* **Enable S3 Static Website Hosting** — Check whether S3 Static website hosting is enabled or not
