My name is Erik Lundevall-Zara, I have worked for more than 25 years in the IT industry, as well as writing articles for magazines and teaching computer science topics in corporate and university settings. In 2012 I took my first steps into cloud computing with AWS, and since 2015 worked full-time with making cloud solutions.
I have a passion for learning and sharing knowledge, which this site is an expression of, and would love it if you want to be part of this journey with me.
In part 1 we introduced an AWS CloudFormation feature called Drift Detection, with which we can detect (uncontrolled) changes to the resources we manage via CloudFormation. We showed this in the AWS Management Console.
In this part, we are creating simple scripts to start the drift detection process on our CloudFormation stacks, as well as checking the result of detected drifts on the stacks. This will allow us not only to check on a single stack at a time but also on multiple stacks and multiple regions in one operation.
If you use the principles of infrastructure as code to provision your cloud infrastructure, you get many benefits from it - repeatable, quick, and consistent deployments. You also need to apply discipline in how you update the infrastructure - it has to be through the same infrastructure as code workflow. If anyone modifies the infrastructure through other means, like the AWS Management Console, then all bets are off and you may end up with a mess.
Fortunately, some tools can help to keep your cloud infrastructure tidy. If you use AWS CloudFormation, then you have a feature called Drift Detection which may help you detect when someone changes the infrastructure through other means than CloudFormation. Read further to see how you can use Drift Detection for your benefit.
Are you excited about using AWS Cloud Development Kit (AWS CDK) to define infrastructure-as-code?
Do you think that the AWS CDK project initialization is a bit clunky and does not give you what you need to hit the ground running with a new AWS CDK project?
Do you use Typescript? (by choice or by request)
If most of these have the answer yes, you do want to continue reading this article!