
- Infrastructure as code(IaC) is a very important element in an organizations cloud adoption journey. It helps to bring consistency, standard, speed and most importantly leverage drive cost optimization on cloud.
- Infrastructure is the underlying computing machinery example physical server, database, network , storage etc which is required for a software to run.
- In the absence of IaC tool provisioning of these infrastructure components is done manually. So imagine if you have an application with 20 microservices, and a web front end , without IaC you will have to manually build each environment (dev, stage, qa, prod) and set the container configuration , load balancer rules, health check up etc .
- This manual approach of provisioning is a time tasking task and can lead to inconsistent environments , as its difficult to remember the settings for each container, rules etc.
- Infrastructure as Code (IaC) helps to manage and provision the infrastructure through code instead of doing it manually. With IaC, infrastructure specification is written using code and it is used to create the infrastructure and this makes it easier to edit and distribute configurations. It also ensures that you provision the same environment every time. This can be integrated as part of continuous-integration and delivery (CI/CD) process.
- As part of the process , a developer writes code that declares the infrastructure which is required and this is run using an IaC tool and the tool interacts with the cloud and issues the appropriate commands on the target cloud environment to provision the infrastructure components.
- In real life, the infrastructure setup goes through changes as the project progresses. For example a developer will first provision a S3 bucket and then in the subsequent sprints there will be a need to deploy a microservice to read the content from the S3 bucket and therefore the infrastructure needs new resources to be added.
- To do this rightly IaC tools should know the state of the current setup , which is a snapshot of the infrastructure state when the tool was run successfully last time. This way the tool will only create the resources which are new or update any new or modified properties leaving everything else intact.
- The challenge with the IaC tools is the steep learning curve. Developers will have to new learn a new language and the conventions of infrastructure-as-code all at the same time. Managing infrastructure has been traditionally been done by Infrastructure or Operations teams and therefore they have been designed by keeping the infrastructure and operations team in mind.
- This is one of the main challenge for developers in adapting IaC tools and using this at scale for infrastructure provisioning.
- Pulumi helps to solve this problem. It took me just a day to understand the concepts and start using it for my projects.
- So What is Pulumi ?
- Pulumi is an open-source infrastructure-as-code platform that helps you create and manage cloud applications and infrastructure. It is similar to other tools as it is also powered by a command-line interface (CLI) that runs on multiple platforms (macOs, Linux, and Windows), and its main job is to translate the code with infrastructure specifications to resources on the target cloud.
- The main differentiator about Pulumi is we can write code in high-level programming language like Go, JavaScript, TypeScript,Python, C#, F#, and Visual Basic on .NET . This solves the problem of learning curve which is introduced by other IaC tools .By default, Pulumi uses the free Pulumi Service to track the state of your infrastructure across projects and environments, which other tools tend leave it to you to manage that on your own.
- Pulumi works with traditional infrastructure like VMs, networks, and databases, in addition to modern architectures, including containers, Kubernetes clusters, and serverless functions. Pulumi supports dozens of public, private, and hybrid cloud service providers.
- By using familiar languages for infrastructure as code, you get many benefits: IDEs, abstractions including functions, classes, and packages, existing debugging and testing tools, and more. The result is greater productivity with far less copy and paste, and it works the same way no matter which cloud you’re targeting.
- Check the site for more details – https://www.pulumi.com/
Thanks, Please share your feedback