Come back with a deployment management and we start with cloud formation.
So what is code for mission.
Basically what you want to do is you would like to have your infrastructure as code.
So if you hear any time in any scenario that the customer wants to have the infrastructure managed as
code then clutterer mission must be one of the choices that you have in your mind if not the only choice.
So it is a service that helps you model and set up your Amazon Web services and resources.
So instead of you going manually to set up all the resources that easy to and inside their blocks and
subnets on AGW and all that you can configure that as code in cloud formation in Jasen or YAML and that
template when you run it through the cloud formation engine is going to translate that to it's going
to do all that on your behalf.
If the template is correct so it will allow you to spend less time managing the resources that you need
in your infrastructure ass and more time focusing on the application that turn in it.
So don't worry about the PC subnet Security Group Nikhil's AGW VZW VPN and all that.
An easy to instance launch.
Leave that and focus on your application.
You can model your contribution templates using either Jason or Yamhill you create the template that
describes the resources that you need and it will take care of provisioning and configuring those resources
for you according to the template that you have created and the result of running your template through
the cloud formation engine is called a stack.
So the stack would have VBC in multi Asie multiple of anybody's on subnets easy to instances of just
kidding Elby so on and so forth and we don't anymore individually need to create and configure the sources
and figure out dependencies between them how can it be a template if you know what Jason and yemo.
Well then you can do that or you can have that information designer which will enable you to draw your
infrastructure and then it's going to give you the template that you need.
So benefits of confirmation simplify infrastructure management using a machine you can create update
since you are going to manage your infrastructure as code then you can maintain versions of your infrastructure
and delete your stacks and cloud formation will take care of all that.
Anything that you need to do is create update templates and delete if you don't want the stack anymore
clutter mission will allow you also to quickly replicate your infrastructure.
So let's say you are doing some testing and you do it in one region.
Testing is done.
Results are there.
You have saved the results and all that.
And then you know you need to deploy that in another region and that test included a lot of multiple
of anybody's on route 53 it'll be easy to instances so on and so forth like all the infrastructure instead
of doing all that manually you have the code for that infrastructure and then now we can deploy it in
another one and you take that template and there are some dependencies on the region that you need to
adjust.
If not there and then you can deploy it in a different region save you a lot of time lot of hassle and
you're testing or development environment can be up and running in almost no time.
So what you need to do is describe your resources once in a template and then provision the same resources
over and over again in multiple regions as many as you want.
The other benefit is easier to track changes to your infrastructure.
Remember when you're talking about version control that is called now change your resources upgrade
update or rollback changes basically manager infrastructure as code.
And that's why when you hear about infrastructure as code then you need to think platform how it works.
Let's look at that.
So you create the template and then you save the template locally on your computer not book or you can
use it in an SD bucket then use it as club formation to create a stack based on your template and it
constructs and configures your stack resources according to your template.
So in a nutshell clutterer mission template executed or when you run it it becomes a stack.
When you create a stack confirmation mix link service API calls to you as to provision and configure
your resources.
One good thing here to note confirmation integrates with cloud.
So if I enable logging what happens my template which includes two instances includes three buckets
includes route 53 Elby subnets creating the PCs and all that.
So what will be logged in my cloud trail.
What will be logged in your country logs will be all the API calls to all the services that the cloud
formation will do on your behalf when you execute the template.
So what happens is all the different API calls that cloud formation will do on your behalf to all the
different services including in the template.
All of that will be logged so you can track it you can know what happens next is really what completed
what failed and on.
Also one important note what if I am running a cloud formation template to create a stack but then there
are some errors when errors happen.
Cloud formation is going to roll back and delete everything that happened or that was created.
Preceding that error that happened it will clean everything and nothing will be left omission can perform
only actions that you who created the template have permission to do so when you do a mission template
either you assign.
And I am wrong that has all the permissions that you need for cloud formation to create and do and all
that or it will take you.
I am a user permissions and that will be the limit of what it can and cannot do.
If you specify a template file stored locally locally means and your computer will upload it to an extreme
bucket in your account.
Clutter will create a bucket for each region in which you upload a template.
Those markets will be accessible to anyone with areas as the permissions in your account.
And if a bucket is created by alteration is already present the template will be added to that bucket.
It cannot create anyone.
You can use your own bucket and you upload the templates for that.
So bucket then only what you need to do then is to see if you are in there as you are.
All of that template file when you are configuring the cloud formation to whenever you need to create
or update your stack.
All they need to do is to provide the three or four where the template is after everything has been
completed successfully.
Only then permission will report that everything has been created successfully.
And if it fails then confirmation will run back all your changes and delete the resources that were
created.
All right so how about updating the stack if I have created already the stack and now I need to update
it.
Before that let's take a step back if I have created an infrastructure that includes two instances it'll
be route 53 and all that through cloud formation.
After creating that infrastructure can I go ahead and play a little bit with two instances or play a
little bit changes for the infrastructure or should I do it and update it through the stack.
Of course it's the second one through the stack white cloud formation will maintain the status and manage
the stack for you.
So when you do the changes through club formation then it is in sync with what exactly is an infrastructure
but if you do management changes what will happen is the minimal changes that you have done with the
next update mission is going to wipe out whatever it is you have done because it doesn't know anything
about it when you run the updated stack or that template it's going to do only what is in the template
and it doesn't know anything about the things you have done.
So avoid changing resources created by cloud formation manually away from cloud formation.
So one thing we learn here is we can update the stack resources by updating the template and the template.
And when you try to executed it yes it's going to take that and it's going to show you what changes
will be done that is called changeset.
So the change set it will be presented to you then you can decide either to forget about these changes
and obliterate them but again if there's anything wrong or go ahead and deploy that sort of to stack
create a change set by submitting a unified version of the original stack template different input parameter
values or both depending on what changes you want to make as well compare the modified template with
the original template and generates a change set.
So the delta between that and the change that will list the proposed changes after review the changes
an understanding confirming what will change you can execute or you can create a new change set.
If you don't like or if you think that one was writing editing that template saving the updated template
and then you can use eeriest got permission to produce or generate a change set based on these changes.
Then you need to validate the changes and find out if this is what you want or not.
Lastly if everything is OK then you can execute the change set to update the stack.
You need to be careful what updates are you making and what interruptions they may have and depending
on the resource and properties that you operating and it might interrupt or even replace an existing
resource.
One of the changes could be I had a somewhat odious instance.
Now I need to move to a larger audience instance of course that will disrupt the existing audience instance
for the transition.
Deleting a stack can I delete a stack of course you can.
You can create a date and delete when you do need a stack you specify the stack that you want to delete
and cloud formation will delete the stack and all the resources in that stack are the exceptions.
Yes sometimes we do what we call stacks that are dependent on one another.
So let's say I have a network team that creates PCs and tablets and all that and application teams that
will create in that same Ribisi will create two instances upload applications and all that.
Now there are different stacks.
Can I delete the underlying VPC without the application first deleting.
There are only two instances you can.
There are dependencies there so away from the dependencies.
The fact that you are you are you should be able to delete a stack.
Yes you can but there could be some dependencies that you need to take care of first before doing that.
You can do it stacks by using it for Mission Control Selye or API.
After the resources have been deleted from Mission signals that your stack has been successfully deleted
so it gives you an acknowledgment that there is good for mission cannot delete a resource if it cannot
read the resource.
What will happen.
The stack will not be deleted and any resources that haven't been deleted will remain until you successfully
the stack.
So if it started deleting and then at one resource it was not able to delete it then you would be stuck
with that until you are successfully able to do that so that there might be some dependencies you need
to take care of them and then you can delete the stack if you want to delete a stack but want to remain
to retain some resources in that stack.
You can use a deletion policy to retain those resources and we look at that.
Give me an example quick one.
I have an ebook as volume that I don't want to use that that end up as volume when I delete the stack
to create a snapshot.
Yes you can have an audience instance in a stack and I would like to maintain it.
So what I need to do is I need to create what we call a deletion policy for the resource and define
that when whenever the stack is going to be removed either retain it deleted or snapshot the cloud formation
designer.
As I mentioned if you don't know much about Jason or Yamla you're not comfortable to write the template
into and on your own then you can use the classification designer which is a graphical tool for creating
viewing and modifying cloud formation templates.
So how does it work that designer only to do is you need in a canvas that you will be presented where
you need to build the diagram for the template the resources using drag and drop interface.
So you have navigation pane and then you have the compass.
All you need to do is you need to pick easy to instance drag it and drop it.
You need a subnet drag and drop in a gateway drug and drop it.
And as you are drawing your infrastructure underneath there will be a choice that you can do Yamla you
can do adjacent and then your code is being done here.
Jason or the YAML based template.
All right so that was quickly an introduction to conformational still have a lot to do without permission
so let's take a break come back and continue.
I'll see you after the break.
Thank you.