now if you recall the cafe scenario there is a Frank and m they just set up a cafe and
in this particular lab we are going to use our skills to make a static website for the cafe and
host it in amazon S3 then we will do implement a method to protect our data using a lifecycle
policy and data replication and also with one of the features of S 3 which is S3 version
then we want to implement a disaster recovery strategy in amazon S3 and basically at the end
of the lab we will have the cafe website similar to this page here and we have the main S3 bucket
which is going to be hosted in the first region and a second asset three bucket which is going
to be hosted as a replication in another region the first step is going to stop the lab i have
already started my lab so feel free to start the lab by now and in the task one we want to download
this zip file to our computer and once i open it it's going to contain a static website which has
an index.html with a css file and with images for the cafe first thing first is to access the aws
console and here it's just complaining that i have another user in currently accessing editorials
so just let me make them two tabs i could easily navigate to between them
you could also put them side by side if you like so the first thing is going to be
a c3 and in the first task we are going to create a network bucket and enable and clear
look all public access or enabling public access and then we want to enable the
static website so i'm going to do that just now i'm calling my bucket website
and let me call it based on the date of today and i will add main and i will explain why i
call this main later on when we do the data replication allow public access and then i
will create the docking there is a knowledge for public access create a bucket then we want to go
to the bucket itself go to the properties go back to the steps and we want to have a
static website hosting enabled so we go all the way down edit and enable
in the main index it's going to be called index.html how i know that because the s3
has index.html copy this name of the file here and then i will save the changes we want to
upload the content of the ss3 to the bucket so we are going to upload so you can add files or you
drag and drop your files here this much easier i will drag and drop them here and then upload
now this should upload the two folders i have and the index.html file that i do
have while this finish uploading let's go back and now asking us to answer the first
question in the multiple choice to access them you need to go to the details
show and from the show you will have an access to the multiple choice question and the question now
is when if you're in the website after task 3 do you see the page in a browser
how we can verify go back to your packet finish uploading now go to the properties
and this is our website url open it you can see 403 error so the answer to this is going to be no
and submit go back again to my tasks and we want now to create a bucket policy
now this sounds complicated because we want to allow people to access our main
website in this packet so we have to go to read about this in the adler documentation
let me open this in a new tab and one of the things you want to do is to grant lead
only permission to any user and this is an example of that bucket policy that we can use
if you read the lab instruction it's asking you as well to do just that grant read only permission to
public anonymous users and this is what we are going to do we will go back to our aws console
and from the aws console properties and you have in the properties
account for permission we want to edit public policy so we are going to do edit and this
basically guys is a resource race policy or what sometimes we call it inline policy we want to
paste the policy that we copy from the documentation and we change the arn which
is the amazon resource identifier with our example packet you could change the date
if you want for the version and then we can save changes all good now go back to your website for
the packet url refresh you will be able to see the the website is functional and active for the cafe
the other challenge is to protect the website data and protecting the website data is going
to be happened by enabling versioning and when you enable versioning in your bucket this makes sure
any old version will be kept and we can use lifecycle policy to co to copy it to another
tier or another class of s3 or we can also replicate it to our dark accessory
button so in this task we are going to enable versioning so let me go to the console again
and from the properties this is how you enable functioning you do bucket versioning enable
and then save changes now the next thing they want us to open the content of the website i'm
going to use visual studio here and we'll add and update a few files here so we are going to update
the first thing we need to update is the background color in the index.html file
so you can use notepad you can use any text editor for that so we are going to change the
color from aqua marine to gain borrow and so on from orange and so on you can easily find this
colored which is here i'm going to change it to this lovely one and the orange here
it's going to be changed with this color i'm just copying and pasting them because
just to save time and the last thing we are going to change is this color in this tab
which basically i'm going to change the color that we have here in this table in those rows
go back to visual studio and save the file then if you go back to the instruction they are going to
ask us to upload the index.html file to our acetary bucket again so let me go to my
aws console to objects and then upload add a file add index.html and open then upload
the file is successfully uploaded i just enable versioning so you can see now this is the
existing the first version of the file and this is the second one which i just
upload now if i refresh the page i should be able to see the difference in the color
now if you want you can answer question number two go back to the multiple choice
url and if you notice what is another way to ensure maximum protection and prevent accidental
deletion of a preserved version it is going to be via multi-factor authentication how we know that
go back to the console go back to the properties and you can see multi-factor authentication
for deletion protection so you can enable it here from the properties of the bucket submit this one
and let's go back to the the lab the third challenge is to set up a life cycle policy
using two rules the first rule we want to move a previous version of all cells started to
ascertain standard and frequent after 30 days so to do so let's do them one at a time we go
to the management we have a life cycle rules we create a live cycle rule and we can call it first
now i want to apply this to all objects in the bucket i'm not going to move the current
version i'm going to move the non-current version to standard any frequent axis after
30 days and then create that rule go back to the instruction in the second one we want to delete
all the previous rules the previous version of the object after 365 days so we're going to create
another one i will call it second scroll apply and this is going to be delete expired object
permanently delete a non-current version of the object after 365 days and then create a rule
so we have now two lifecycle rules the first one is going to move the previous version of
any file to standard infrequent access after 30 days and the second one to delete any previous
version of any file permanently will be deleted after 365 days could confirm that you have this
is what exactly you did in your asset 3 bucket lifecycle policy by reading this paragraph here
you can also now read about the will arcane framework and one of the things we want to achieve
in any architecture is basically to achieve high level of your ability how we can do that
to achieve the maximum level of disaster recovery just in case if our first bucket in our first
region deleted accidentally damaged crashed we can have a copy of our website in a second one to
complete task 7 successfully we need to go back to our bucket a c3
and now we need to create a new backlink i'm going to call this website replication the date of today
and i'm going to create this one in the iris region i want to enable version
pair instruction if you go here they are saying we need to create a new bucket
and we need to enable versioning in it and then we need to create a replication for that bucket
so we create it now go back to assettree select the original main bucket that you have
and then from the management create a replication rule
in the replication rule we need to enter a role name so this is the replication rule
by default is going to be enabled now this is our source bucket so we choose the scope
it's going to apply for all objects and our destination we can select it from the list here
so our replication rule in the irish region is going to be the destination of our replication
we need to select the cafe roll and as you can see in the instruction this basically
allow us to move all objects from the source bucket to the destination bucket and be careful
here because this only applies to any modification we do after the role is acted in the source market
the next thing is going to be safe and if you go back to the instruction
now we want us to answer question number three any question number three do you see the objects from
your packet in the destination bucket you can verify but the answer is going to be no because
we have done no modification to the source bucket yet so if you open you can't see any modification
so go back to the question answer question three and now go back and we need to make minor changes
in the index.html i'm going to go to visual studio and i will make a small paragraph here
above the table
after replication is enabled
save and then go back to the console to the main replication to the main
bucket i'm going to upload the index.html file again close verify you can see my changes here
now once we activate this with the replication what will happen is the destination bucket of
our replication it will receive the new version of the file in the statistic
you could also verify this by deleting some files deleting some images or adding a new content to
your source bucket until you manage to see it in the replication so you can see now the new content
of index.html is here in the replication file okay so let's go back and we need to answer question
number four which is what's the version that you just deleted from your source packet also delete
from the destination bucket answer is yes what's the version that you just delete from your source
packet also do it from your destination bucket yes because the replication means if we delete
this object here in our asset tree bucket let's try that before we can judge delete this file
i'm going to just delete the cafe owner image now if you go back to your st3
to the replication refresh
you can't see this image here what you could do to verify it's going to back to the images
and upload it again the image we just delete this is the cafe owner i'm going to upload it
to the packet and you will see that this image now after it will be uploaded
it will appear now in the replication
so go back sorry another three go to the application
and this make sometimes it takes few times to the application to appear
just verify that the website is still active so this is the image i delete
be obvious to see it here and you can see now in the images i can see the cafe on it
so if you want was the version that you just deleted from your source bucket also deletes
from your destination bucket the answer for this is going to be no that's okay
you can feel free to submit your work and that's
all of the challenge lab for creating static website thank you very much