Infrastructure as a Code

Kamran Ghyan
2 min readFeb 9, 2021

In this article will explain why IaaS is important to understand and adopt.

Utilizing AWS is incredible as it simplifies and improves infrastructure provisioning and maintenance. As you depend increasingly more upon AWS you rapidly understand that managing everything through AWS Management Console is not an ideal way.

Before we dive into IaaS, Let’s first understand the level of AWS infrastructure management.

Levels of infrastructure

Level 0: By hand

By this approach you can manage infrastructure using AWS Console Management interface. It is very simple and easy way to manage infrastructure. But this approach is less ideal for complex systems.

Level 1: Imperative Infrastructure as Code

By this approach you can write your own scripts using AWS SDK and manage and provision resources programmatically. Scripts are repeatable and reusable, In this approach you have to define all edge cases.

Level 2: Declarative Infrastructure as Code

This approach know as Infrastructure as a script, which uses maintaining and resource provisioning engine called AWS CloudFormation or Terraform which in turn use AWS SDK to manage the infrastructure. This approach create and update resources automatically.

Level 3: AWS Cloud Development Kit

Recently AWS launch new approach which is called Cloud Development Kit, In this approach software is developed using AWS CDK which generates the input for AWS CloudFormation.

Cloud Development Kit

AWS allow us to develop infrastructure in number of languages, following languages are supported: TypeScript, JavaScript, Python, Java, C#.

Basic Concepts of CDK

  • Construct: Basic building block for an AWS CDK app. Represents a “cloud component” and encapsulates everything AWS CloudFormation needs to create the component. They can be developed or downloaded from AWS Construct Library
  • Stack: Constructs need to be created within the scope of a Stack. This corresponds to a CloudFormation template.
  • App: Stacks are created in the scope of an App. An App can contain multiple stacks.

As a developer It’s very boring task to create infrastructure which is very dry task to do. Now using AWS CDK able to build large scale infrastructure programatically.

In next article will create simple AWS simple resources using AWS CDK which is very cool to do specially for developers.

--

--

Kamran Ghyan

Software Engineer, System Architecture, Cloud Architecture, AI enthusiastic