Instructor: Alright,
so let's quickly talk about ChangeSets.
When you update a stack, maybe sometimes you wanna be sure
that the stack will update the way you want it.
So maybe you wanna have greater confidence.
And for this we use ChangeSets.
And ChangeSets will basically know what happens,
but it won't let us know if it will work or not.
So it's not a way to just QA and make sure,
yes, there won't be any failures.
ChangeSets don't work like this.
They just help you understand
that some things will change, some things will be deleted
and some things will be created.
So, let's take an example from the documentation.
We have our original stack.
We're going to create a ChangeSets.
And then we're going to view that ChangeSets,
so we're going to view what gets added, changed or deleted
and then maybe optionally
we can create additional ChangeSets
if we want to refine our methodology.
And then finally when we're ready,
we're going to execute that ChangeSets
and go get our updated confirmation templates.
So that's the idea though.
We've actually used ChangeSets without knowing beforehand,
but here we're just going to formalize this
in this lecture.
So for this example, we'll just use the 0-just-ec2
and then the 1-sg-with-ec2-with-sg-eip.yaml.
So let's go ahead.
First we're going to create a stack.
We're going to upload our templates,
and it's going to be our 0-with-just-ec2,
just like before in the very very beginning.
I call it stack-cs-demo and there's no parameters needed,
I'll go ahead and click on next.
And I'll go ahead and click on create stack.
So this will go ahead and create our EC2 instants for us.
Alright so our stack has now been created,
and so if I go to ChangeSets on the left hand side.
As you can see, there's no ChangeSets right now available.
So we can click on here and create a ChangeSets directly
for stak-cs-demo.
So another way we could do this,
is go to stacks, then we click on stak-cs-demo, action,
create change set for current stack.
So two ways of doing it.
Now, we can basically say,
either we reuse the current template
and we'll just change some parameters,
or we're going to replace the current template
with something new or edit in designer.
We'll replace the current template with something new,
and we'll upload what the new is.
The new is this one.
1-ec2-with-sg-eip.
So now we want to know what would happen,
if I were to apply this update to my template.
So, I'll just create a description,
I'll call it foobar, cause I wanna be quick.
Okay, then we click on next and here we go,
we have specified the template,
and the parameters is foobar for security description.
And I will go ahead in vellum and say create ChangeSets,
so we can describe it, we can name it if we wanted to,
I'll click on create ChangeSets and here we go.
Our ChangeSets is now created,
so if you go to ChangeSets on the left hand side,
as we can see, it says create complete,
but it hasn't been applied yet.
Now let's have a look at the input.
The input is all the parameters and the things we sent
from before.
The template is what we just uploaded,
and the JSON changes represent what is going to change.
So the JSON changes are quite hard to read to be honest,
there's very very verbose,
but if you go to changes tab
and actually scroll at the bottom,
we can see that it is going to add a ServerSecurityGroup.
Add an SSHSecurityGroup is going to modify my EC2Instance,
it's actually going to replace it, so say Replacement True
so we'll lose our current EC2-Instance
and a new one will be created,
and then we will add an EIP.
And so the cool thing about this is that we can see
beforehand if we are willing to do this change.
Maybe I didn't want my EC2Instance to get replaced,
so maybe I don't want to apply this.
In my case I don't mind, so I'll apply it,
but this is why a ChangeSets will be helpful.
So when you're ready you can either delete it
or execute it, I will execute it.
And basically, it just triggers a update
that we already know,
and so I'll just wait for the update to be complete,
but no surprises here.
The cool thing though
is that if you go back to your ChangeSets,
now it will show you the last executed ChangeSets,
but there is no new ChangeSets you applied,
so you have to create a new one if you want to update it.
So that's it.
I'll just wait a little bit and then delete that stack,
but I won't film that.
I hope you understand how ChangeSets work now
and I will see you in the next lecture.