ICT507 Week 9 Lab 4 - 6 Marks
ICT507 Week 9 Lab 4 - 6 Marks
Create Bucket:
1. Click on the bucket name in the S3 dashboard and, on the new screen that loads, navigate to
the Proper es tab.
2. Scroll down to the Sta c website hos ng sec on and click on the Edit bu on. This will open
the sta c website hos ng configura on screen.
3. Enable it and leave the Hos ng type as default. A note on this screen says: “For your
customers to access the content at the website endpoint, you must make all your content
publicly readable…”. This is why it was necessary to allow public access when crea ng the
bucket earlier.
4. The Index document field is where you specify your website’s index file which is usually
index.html. The Error document is the page you want to display whenever an error occurs,
such as a 404 error.
5. Save changes and return to the proper es screen. You should no ce a new Bucket website
endpoint in the Sta c website hos ng sec on. You’ll be able to use this URL to access your
website once you’ve finished se ng it up.
You now have your bucket configured and ready to host a sta c website. How then do you add your
website files to the bucket and view your website?
1. Make a customized index.html page with references to at least two jpeg images.
2. To host your sta c website in the cloud on S3, you need to upload your files and folders to
the configured S3 bucket. Navigate back to the objects tab and click any of the upload
bu ons to upload your website files.
3. The next screen is where you can add the files and folders you want to upload to the bucket.
Ensure you add your index.html file and every other file or folder associated with your
website here. The folders you might want to add are your CSS, JavaScript, and image folders.
4. You can add files and folders either by drag and drop or by using the “Add files” or “Add
folders” bu on. Once you have added all files and folders, click the upload bu on at the end
of the screen. Wait for the files to upload, and then you can click the close bu on to return
to the "Objects" screen.
At this stage, we’re almost done, and the website is almost ready for preview in a browser. The site
can’t open yet due to Amazon’s Iden ty and Access Management policies that prevent access to
resources in a bucket.
1. Navigate to the permissions tab on the bucket dashboard and edit the Bucket policy.
2. Copy and paste the code below and replace “website-name” with your bucket’s
name.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your bucket name/*"
}
]
}
3. Save changes and revisit the proper es tab once again to get the website URL from the
sta c website sec on.
4. Copy and paste the URL into a browser, and you’ll see your sta c website. (Take a
screenshot and submit it via Moodle) – 5 marks
Sample Index.html file
</body>
</html>