3 hours 27 minutes
In this video
we will create a static s3 website
we will create a bucket policy for our website.
In our last video,
we enabled version ing on our bucket
and we walked through a version ing example
In this lesson, we will create a static s3 website
and we will walk through adding a bucket policy.
We can hold static web sites on Amazon s three
we mean simply individual web pages that contain Onley static content.
That means that our site
will not be able to run any server side scripts as dynamic pages would
Jsp or SP
to host the static Web site.
We will configure our s three bucket
for website hosting and then upload are content to our bucket.
Then we will add a bucket policy to grant the world read access to our bucket.
Our website will then be available
at the AWS Region specific website en pointe
for our bucket.
These concepts are best learned by a demonstration So
let's create our site.
So from the AWS council, we type s three and then enter
we will create a new bucket.
We will give the bucket the name.
First Dash Library
Bash s three dash site.
Then we click Create bucket.
now we see that our new bucket has been created.
So let's click it
then let's select properties
click Static website hosting.
We will select
Use this bucket to host a static Web site.
Next, we will create a landing page for our site.
We will type
index dot html
Then we will create an error dot ht ml page that will display an error message.
If a website visitor request a page that doesn't exist,
then we click Save.
Now we could see that static website hosting is enabled on our bucket.
And here is our in point,
which is derived from our bucket name
and the region of Rs three bucket.
So now let's exit to the S three page
noticed that our bucket is not yet public.
Remember that all buckets are private by default.
let's edit our public access settings.
Just as in the previous lesson, we click, save and type confirm
Now notice that our objects can be public.
Next, we will need to add a bucket policy to grant re permission to our site.
Let's select permissions,
then bucket policy.
This takes us to the Bucket Policy editor screen.
Our bucket policy will be a Jason document.
I have one that I already created.
I will paste it in and then explain what it's doing.
is the version of Jason that we're running
lines four through eight are essentially the policy that says that anyone is allowed, get
or read permission to the objects within our bucket.
So let's click. Save
A W s informs us
that our bucket now has public access.
Let's exit back to the S three page
notice now that our bucket is featuring the public icon.
Let's click on our bucket again
and upload our content.
I have already created documents off line called Index that HTML
and error that HTML
These are just simple HTML files that will serve as our demonstration index and our pages
again. We will need to make both of these files public
or else we will receive that access denied XML air.
So now both of our files are public.
Let's exit to our bucket to ensure that everything looks as we expect.
All appears to be in order
So now let's test our site to see if it works.
Click on the end point
There is Rs three landing page.
let's test to see if our air pages working as expected.
I will request a file
that doesn't exist within our bucket.
Our air pages being served up properly.
What steps are involved? To create a static As three website,
we sign into the
A. W s management console.
Then we create a bucket.
We opened the bucket properties paying.
Then we choose static website hosting.
Then we choose
Use this bucket to host a website
in the index document box
we typed the name of our index document.
The name is usually index dot html.
Then we create an error dot html file to catch potential errors and serving up our website.
We choose safe to save the website configuration
and then we copy the in point to a text file.
In this video,
we created a static s3 website
we created a bucket policy
for our website