Thursday, April 4, 2019

AWS CloudFormation Linter Installation and Quick Introduction

AWS Cloudformation is an evolving managed service which facilitates infrastructure as a code in the cloud. What it means is that you can create AWS resources like EC2 instances, S3 buckets and many more just by writing code instead of using GUI console.

For instances, if you want to create 100 EC2 instances for production, and then later you have to create same for development and for testing and then may be later on, you might need to change the configuration of those EC2 instances then doing that by GUI would be a very tedious task. With CloudFormation, you just describe those EC2 instances once in a file called as template and then run it.

Now another cool thing here is that you don't have to write code for all those 100 EC2 instances in that template. You may just describe one EC2 instance and then use CloudFormation Macros to provision 100 or even more of them  (AWS resource limits apply).

Anyway, CloudFormation templates are either written in JSON or in YAML and they grow big fairly quickly and it becomes hard to keep track of syntactical and other errors. With aws cloudformation validate-template or with GUI you can identify the mal-formatted template file but what about if you have written any property of a resource wrongly? What if the resource specification is not as per AWS resource specification document?

Enters AWS CloudFormation Linter.

Linting is an ancient concept from good old C era which refers to a tool to check the source code for any syntax or bugs. So CloudFormation Linter or cfn-lint is a nifty tool to check for syntactical and bugs in the template. I tried to catch any logical errors with cfn-lint in the template but it was unable to identify them. For example, in my template of building a code pipeline, I omitted the cfn-init signal to let CFN know that launch configuration is complete so that deployment group of CodeDeploy could use it, but it was unable to catch that. So it would be a great future feature for cfn-lint.

Following is an example as how to install it and then I have passed through one of my templates to identify any errors:

Another cool blog post by Chuck Meyer is here about cfn-lint and git pre-commit validation.


Sherin Alfonsa said...

Worth for my valuable time, I am very much satisfied with your blog. Thanks for sharing.

CCNA Training in Chennai
android Training in Chennai
Java Training in Chennai
AWS Training in Chennai
AWS Certification in Chennai
AWS Course

Unknown said...

I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone

React JS Online Training

Unknown said...

The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.

Tableau online training

Unknown said...

Thanks for sharing an informative blog keep rocking bring more details
mobile application development training online
mobile app development course
mobile application development training
mobile app development course online
mobile application development course
online mobile application development
learn mobile application development

Printer Setup said...

I like this blog very much, Its a very nice billet to read and incur Info. Also, check our sites..!! , , 123 hp com , 123 hp com setup, 123 hp setup , HP com setup

sellakumar said...

We are a part of the success story for many of our customer's successful cloud Migrations.
Cloud Migration services

Aws Cloud Migration services

Azure Cloud Migration services

sellakumar said...

Thank you for the informative post about Security challenges in AWS , Found it useful . cloud migration services have now become secured and with no-risk

Vmware Cloud Migration services

Database Migration services

sellakumar said...

I have gone through your post and I found it very helpfull. Looking forward to see more post from you.

Lia Infraservices

sellakumar said...

I am really impressed with the way of writing of this blog. The author has shared the info in a crisp and short way.

Cloud Migration services

Best Cloud Migration Tool