‫So let's talk about a service we haven't seen yet
‫which is called CloudFormation.
‫CloudFormation is going to be used to
‫deploy complex infrastructure using an API in AWS.
‫So with one CloudFormation template, for example
‫you can deploy an auto scanning group
‫a low balancer, a database, whatever you want.
‫And we'll see CloudFormation in depth in this course.
‫But I want to just introduce the concept to you right now
‫because it is very important within Code Pipeline.
‫So you can actually use CloudFormation within Code Pipeline.
‫And even though we don't know
‫exactly how CloudFormation works
‫I wanna show you its usage.
‫So let's say we have the first step
‫of our pipeline being to build an app using CodeBuild.
‫So we deploy the, we build the app, we have an artifact
‫and then out of it we're going to have CloudFormation.
‫And CloudFormation is going to be used to actually
‫deploy a whole new infrastructure and your application.
‫So for example, if we put CloudFormation
‫in the create or update mode
‫then it's going to create a CloudFormation stack.
‫And whatever you define as part of your stack
‫it could be a low balancer
‫it could be an auto scaling group.
‫Whatever we define as part
‫of our stack is going to be created by CloudFormation.
‫The point is, this is going to be our test stack
‫and is going to be deployed as part of your code pipeline.
‫When the stack is deployed, then we can go
‫into another CodeBuild stage to test our application
‫because CodeBuild can build an application
‫but you can also run test suites on CodeBuild, for example.
‫We can run a lot of HTP based calls
‫against our newly deployed application to make sure
‫that everything is working as expected
‫that there are no crushes and so on.
‫So all these tests can can happen
‫within CodeBuild and then if they're successful or not.
‫But anyway, we will have a CloudFormation step again
‫in our code pipeline and action.
‫And this time it's going to be
‫in delete only mode to delete the infrastructure
‫by deleting the CloudFormation stack.
‫And when you delete a CloudFormation stack
‫everything that was created as part
‫of your CloudFormation stack, is also going to be deleted.
‫So that means that we're going to have a clean slate.
‫But the benefit of this is that we were able to spin
‫up a test environment, test against it
‫and then delete the test environment.
‫Just say like nothing happens
‫and this is the power of the cloud relate.
‫So then if we delete the stack
‫we can then deploy to production.
‫And by deploying to production
‫we could again use CloudFormation in the create updates
‫but this time it's not going to create a stack.
‫Of course, it's going to update an existing stack to
‫deploy your new application version.
‫So that's it you've seen how
‫CloudFormation is used with Code Pipeline.
‫I hope you liked it
‫and I will see you in the next lecture.