Instructor: Very, very quick lecture,
but if you wanted to protect your stacks
against this accidental deletes,
you can use something called TerminationProtection.
The same way we have it for EC2 instances,
we also have it for CloudFormation templates.
So let's this quickly how that works.
Alright, so I'm going to create a stack,
and I will upload this template file,
and I'll just upload the very first one.
Just EC2.yaml.
Click on Next, click on Next.
I'll just need to name it.
I'll name it test.
And the Next, and at the bottom Create stack.
So here we go, we are creating our stack,
and as we know already, this is going
to create yet another EC2 instance.
Okay, so now that our stack has been created,
and as we can see, we're in create complete.
So if I go back to my stack, I am able
to delete it, but I won't.
This time, I will edit the termination protection.
And I will say, right now it is disabled,
but I will enable my termination protection.
So I can't delete this accidentally.
So let's try to delete it right now.
I'll say Action, Delete stack.
And it says, you can't delete it
because termination protection is enabled.
So to delete this stack, I must first go ahead,
edit the termination protection, disable it,
and now after disabling it, I can go ahead
and delete my stack.
So that's it, that's all I wanted to show you.
A quick one, but I hope that was helpful.
And I will see you in the next lecture.