So let's go to the point and in here I'm going to create our first application.
You have to get a name salt.
Call it could deploy demo.
And we need to choose a compute platform as I said for now we'll go easy to an on premise but later
on we'll deal with a lambda and easy s so let's choose these two on premise and create our first application.
It says in order to create a new deployment you first must create a deployment group.
So let's create our first deployment group a deployment group represents a set of easy two instances.
So I'll call it my development instances and they will represent all the instances in E2 that are from
the deploy at the development environments.
I need to create a service role for could deploy that will allow it to.
Targets are easy to instances.
So for this let's go back to you.
I am and will create a roll and scroll down.
This is a role for code deployed and we'll choose code deployed the first one because we want to call
it with services such as ODA scaling if we dealt with E yes or lambda we would create a different set
of rules.
Next for permissions.
There's only one role we should attach which is a double U.S. Code to play a role.
So we'll create it and then review and then I'll call it code deploy wrote create the role the role
has been created.
So if we go back you could deploy now I should be able to refresh this page and I'll rename my group
my development instances and choose a service role we just created.
Excellence.
Now we need to choose a deployment type for that deployment group.
So for now we'll deal with in place in place.
It means that the taking the instances will be taken offline for the upgrade and then put back up online
after they've been upgraded.
Blue green is a different kind of deployments and they're very helpful.
If you have an amazon issue to discussion group or Amazon issue two instances where the current application
revision is deployed so for now which is due in place and we'll go back to these differences between
in placing blue green to understand really how they work with code deployed because this is something
that you should master.
So let's scroll down for not we should select a combination of easy to orders giving groups you see
two instances an on premise instances for this configuration.
So I will just choose Amazon issued two instances and we will see easy to orders killing groups in great
details in the very last section of this course when we deal with orders killing groups in general.
So for now let's just select Amazon as two instances and we should match these instances based on tags.
So we didn't you create tag groups.
And so we need you to choose a tag for example environment and the value would be developments.
And so as you can see here one unique matched instance has been matched based on these tags.
This is because we just tagged our easy to instance in the previous lecture and added the environment
and the name tag to it.
Okay so we're targeting all the E2 instances to have the environment development excellence and then
we scroll down and we do choose a deployment configuration.
We'll see what that means in great detail as well.
But for now let's just choose could deploy default all at once.
Finally is there a load balancer for us.
And right now there is no bouncer.
So our web server should be accessible directly on port 80 and we've we haven't done that will edit
the security group later on but so for now we'll disable load balancing to make things a little bit
more simple and create the deployment group.
This is just to get started.
Don't worry we'll go in great depth in the fight.
OK.
So the deployment group has been created and it represents one easy to instance.
So now what we should do is create a deployment for this group.
So we'll create a deployment and we need to target the deployment group and then we need to choose a
revision of our application.
So this is where our application lives in and Amazon has three buckets.
But currently we do not have an three buckets where we have our revision.
So what we should do is deploy our revision to s three buckets.
So let's go back to our code and this is the script.
So first thing we have to do is to create buckets and will enable versioning for that buckets just to
make sure we can have multiple versions of our application in our three buckets.
So I'll just use the sea life for that I use it obvious as three and B four make buckets and I reference
the bucket here called Ada based of course defined here the region is a US one and the profile to do
it s is something that I did set my still eye with called it was dev ops so please adopt this command
based on your environment and so on.
So I will go ahead and run this command right here and this does not work.
So I guess it's a great time to show you how to reconfigure my ideas Eli.
So let's go back to them and go to users.
I'll go to defend and I'll select security credentials and I'll make inactive these ones because I don't
need them anymore.
Apparently they don't work and I'll actually delete them and I'll create new access keys.
So here's my access code and my secret access key I would say we'll deactivate them after the course
is done.
So I'll go into here and click on a W.S. configure minus minus profile.
It obvious that UPS so he should enter an access code.
Then a secret access key.
So let's go ahead and enter this part of the key then I should select a default region name so EU w
1 will be great and then default I would format Jason.
Here we go.
So now if I run again my errors as three make bucket comments this one should work and yes they worked.
Excellent then will enable versioning for a bucket so we'll do it using the CLIA but you could do it
using the console if you wanted to and now versioning has been enabled.
So let's go back into our as three buckets.
So this quarter is three and see if that bucket has been created.
So yes that bucket has been created.
It obvious dev ops course Stefan.
And it seems like if you go to properties that versioning is enabled.
All right.
Step one.
Done.
Now let's keep on going.
We need to deploy this entire folder right here into S3 and this folder contains this file called aspect
of Yemen.
And we'll spend a lot of time on a perspective in the future but for now this is something that's needed
by code deployed to deploy our application.
So what we'll do is that we'll meet you zip this entire file and put it into S3 but thankfully there
is a little command called either us deploy push which does that for us.
So we just need to change the application name to make sure that things work.
So let's change the application name to what's relevant for me.
So here my application name is could deploy a demo like this or change this right here it could deploy
demo and I will run this comment and you have to run it from within the directory that contains this
ASP expect that will file.
So excellence.
Let me just copy the command and run it.
And so what this will do is that it will zip up all the files in here make sure that we do have an app
spent their email file and then he will upload it to S3.
So if we go to s three now and refresh the page for S3 we can see there is it could deploy them with
directory that's been created and an app the zip file that has been created as well.
So excellent.
This app contains all we need to do.
And so let's go back.
You could deploy and I will refresh this page let's choose again.
My development instances as my deployment group.
And here I can click and find that there is a revision that has been detected by could deploy for me.
Excellent.
So I click here and has the entire revision location.
It notice the zip file.
And for now we're not overwriting anything.
We'll just go ahead and create the deployments.
So the deployment has been created.
And this is the status and we should just see as it happens in the lifecycle events.
So right now the download bundle is in progress and we can view all the events in here so I'll just
wait a few seconds until everything happens.
And everything worked.
So it says succeeded.
I can click on view events to see all the events that happened and we'll have a deep dive at those in
the second.
But applications stop download bundle before install install after install applications start and finally
validate service.
All of these have worked.
And so if I go to my easy to instance and open up the ports 80 so I'll go to my security group and I
will open up the port Eddy just to make sure that I can access my instance onto the HDP protocol.
So I'll choose HP and I'll say from anywhere.
Okay.
Safe.
Now if I got your message for instance and use the public DNS right here I should be saying yes.
Congratulations v 5 and this application was deployed on this.
This is my instance I.D. I'll show you how I got it later on.
And then here is the easy the instance was deployed into.
So perfect.
We have a lot of information and could deploy it did deploy my application onto our easy to instance
which is quite cool.
Obviously there is a lot of things we haven't covered yet but this is our first deploy and this is quite
nice to have.
And I will see you in the next lecture.