I frequently write about becoming AWS certified and try to provide some encouragement and a bit of humor in my blog posts. But this post is specific to the new course I’d been working on since the beginning of October 2017 and published in January: ‘AWS CloudFormation Deep Dive’.
There is a lot that goes into a course behind the scenes. ‘AWS CloudFormation Deep Dive ended up having over eleven hours of content, so I’m very thankful for the help I received from the Linux Academy leadership team, an outstanding Project Manager, the great assistance from the Development team, and several assists from my colleagues along the way.
My Time with CloudFormation
The core tenant of CloudFormation is infrastructure as code. CloudFormation really appeals to me because my background and nature dictate that code, at least to me, is another tool in my engineering toolbox. I spent a good amount of time in Web Application development and around Developers who I would describe almost as artists in what they can do with code. I’m the guy with the hammer, just trying to get something done quickly and concisely, and there’s a place for that in CloudFormation templates which allows you to detail your infrastructure in a template. While there’s certainly room for expression in your design, the template, and its elements, are very clean and concise (albeit lengthy at times).
CloudFormation and Templates
One of the strengths of CloudFormation is that it is relatively easy to get a start and begin producing usable templates in a short amount of time. Additionally, there are a great many sample templates in AWS which can be used right out of the box or used as a foundation for a more complex template. Templates are really the core of CloudFormation. I’d recommend gaining an understanding of templates and their anatomy as a first step in using CloudFormation. The ‘AWS CloudFormation Deep Dive‘ course puts a big emphasis on gaining this understanding upfront.
YAML vs JSON
Now templates can be written in either JSON or YAML, and while I have to admit that I was a JSON guy when I started the course, I knew I had to cover YAML equally, and it ended up winning me over. YAML is the definition of clean and concise, and the bigger your template is in lines of code, the shorter the same YAML template will be compared to JSON. YAML also allows in-line comments which is a huge advantage. So why JSON at all? Well, JSON is still used extensively throughout AWS, and you will be interacting with JSON whether you like it or not, which is why I tried to give equal coverage of JSON and YAML in the course.
‘AWS CloudFormation Deep Dive‘ begins with some introductory lessons that include JSON and YAML to get you started, so you will be able to understand the syntax of CloudFormation templates. I also included a lesson on CloudFormation and its interaction with IAM, because IAM is, of course, everywhere in AWS.
After the introductory section, it is time to dig into templates. Everything you do in CloudFormation involves templates, and a thorough understanding of templates will make life easier as you dive deeper into CloudFormation. So the template section of the course includes lessons on Template Format and Structure, Templates in-depth, and thorough coverage of Intrinsic Functions and Conditions. Intrinsic Functions are the key to getting more out of your templates, this is code after all, and Intrinsic Functions can make your templates reusable.
CloudFormation also has some features which assist in creating templates, and I included lessons on CloudFormation Designer and CloudFormer.
From Templates to Stacks
So what do you do with templates? You create Stacks! And with one template, you can create a stack which contains all of the resources in your entire architecture. These resources can be managed individually or as one unit. So the course provides thorough coverage on creating and managing stacks. Some of the newest AWS features related to CloudFormation are presented, such as using Rollback Triggers configured in CloudWatch and using AWS Config to monitor your stacks.
Updating stacks is a necessity, and there are multiple ways to update templates, so I devoted an entire section of the course to updating templates. Change Sets can be used to update templates and provide the additional feature of being able to preview your changes before executing. AWS will provide a summary of your proposed changes, giving you time to contemplate before clicking that Execute button.
I did not want to neglect the folks that prefer using the Command Line Interface, and the CLI for CloudFormation is another feature that I warmed up to more as I was creating the course. The commands are easy to learn, and it is lightning fast. The CloudFormation Management Console is great, but I certainly see the appeal of the CLI and intend to use it more going forward.
So by this point, I’ve really covered the foundation of CloudFormation, the student has a thorough understanding of templates and stacks, and it’s time for advanced topics. You can create your Web Servers in a template, but how do you provision them? The ‘Templates – Advanced Topics’ section covers Bootstrapping, Wait Conditions, Creation Policies, Update Policies, Stack Policies, and a few detailed walkthroughs to ensure an understanding of the steps to provision your resources.
Additional Features and Lesson Descriptions
A relatively new feature of CloudFormation is Stack Sets. Stacks Sets, as the name implies, are a group of stacks that can be deployed across regions and accounts and managed as a single unit. This is an incredibly powerful feature for large organizations and/or organizations that are widely dispersed. The initial setup is slightly complicated, but I think the lessons provided in the course will get you up and running pretty quickly.
So we’ve covered the basics, and a few things not so basic, how do we wrap up the course? We have some fun! The course provides a section on Custom Resources and Lambda. The ability to dynamically choose an AMI with a Lambda function in itself makes using Lambda with CloudFormation worthwhile. And, realizing that you may interact with other deployment technologies, I provided an overview on some of the more popular ones: Chef, Puppet, Docker, and Kubernetes, and walked through some configuration and setup on AWS with CloudFormation.
I conclude the course with a section on Best Practices, Troubleshooting, and Disaster Recovery, and added some more Lambda and CloudFormation into a DR scenario. For a more in-depth course over Lambda, take a look at our ‘Lambda Deep Dive‘.
It was a pleasure to create the ‘AWS CloudFormation Deep Dive‘, and I’m excited to present it to you. Remember to check out Linux Academy! We have a ton of new courses coming out, and I’ve already begun preparing my next two courses.
<!– end HubSpot Call-to-Action Code →