top of page
Writer's picture_ shli001@uw.edu

Managing Cloud Infrastructure with Code

Introduction

Infrastructure as Code(IaC) is the management of cloud infrastructures(network, virtual machines, etc) in descriptive languages. IaC enables developers to manage, review, and distribute infrastructure configurations as if they are source codes for applications. Existing technologies for version control, such as Git, can be naturally utilized to version infrastructures in the same way that source codes are versioned and tracked. The problem that IaC solves stems from environmental drift in the release pipeline. Without IaC, people must maintain the settings of individual deployment environments. As time goes, inconsistency among the settings that people have used becomes a dominating problem that leads to issues during deployments. Moreover, with traditional infrastructure management, every configuration change requires manual action by operators or system administrators, which means changes are hard to track and usually contribute to errors.

IaC is a crucial practice in DevOps and is used in conjunction with Continuous Delivery for organizations to control costs, reduce risks, and respond with speed to new business opportunities and competitive threats.

Cloud IaC

There are many flavors of IaC. For example, cloud providers such as Amazon and Microsoft let developers use YAML and/or domain-specific languages(DSLs) such as PowerShell to build templates for cloud infrastructures. However, doing so requires developers to learn and understand all these descriptor languages despite their complexity. Especially if they are working on multiple cloud platforms, it will take a considerable amount of time to learn numerous configuration syntaxes.


In this article, I will introduce you to Pulumi, an open-source project that leverages familiar programming languages such as JavaScript and Python for infrastructures as code. In particular, I will discuss what are the benefits of using Pulumi, and how to start using it in your next project.


What is Pulumi

Pulumi is an open-source, multi-language, and multi-cloud development platform that supports all major clouds such as AWS, Azure, and Google Cloud. Pulumi provides a declarative approach to infrastructure provisioning. It allows you to create and manage any cloud infrastructures using real programming languages like JavaScript, Python, and Go. Pulumi taps into existing ecosystems of the clouds and provides an easy interface for creating, provisioning, and removing cloud infrastructures. By using real programming languages, developers who use Pulumi may utilize the full power of the languages, such as loops, async, and conditionals to layout the cloud infrastructures in ways similar to coding for applications.

By leveraging infrastructure as code combined with real languages, engineers using Pulumi can achieve greater productivity.

Benefits of Using Pulumi


Familiarity

There is no need to learn new DSLs just to get your cloud infrastructure up and running. With Pulumi, you can configure all the infrastructures you need in languages that you already know and love.


Abstractions

One of the core principles of Object-Oriented Programming(OOP) is the use of abstractions. Abstractions help to reduce copy-and-paste and enable the sharing and reuse of infrastructures in your favorite package manager.


Multi-Cloud DevOps

Pulumi makes it easy for you to use multiple clouds by leveraging a single model, tool, and service --eliminating YAML and DSL explosion.


Sharing and Reuse

By using existing package managers, you can share your abstractions with other people.


Easy to Use Command Line Interface(CLI)

Pulumi provides a powerful CLI that allows you to create, deploy, and delete infrastructure stacks in just a few commands.


Easy to Use Software Development Kit(SDK)

import pulumi
from pulumi_aws import s3

# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket('my-bucket')

# Export the name of the bucket
pulumi.export('bucket_name',  bucket.id)

How to Start Using Pulumi

Learning to use a new tool can be a daunting experience. Luckily, Pulumi provides multiple official tutorials and documentation that will help you understand how everything works. Before you read the tutorials, if you haven’t already, you would need to register an account with one of the cloud providers. Personally, I prefer AWS because it provides many services that are useful for small to medium-sized applications. However, as I mentioned before, Pulumi natively supports all the major cloud providers. As such, it is up to you to decide which provider to use for your next project.


Summary

Infrastructure as Code(IaC) is the concept of using a high-level descriptive coding language to automate the provisioning of cloud infrastructures such as servers, databases, and serverless functions. IaC aims to alleviate inconsistency by eliminating the need for developers to manually provision and manage infrastructure elements every time they want to develop, test, or deploy a software application. IaC is a crucial practice in DevOps and is used in conjunction with Continuous Delivery for organizations to control costs, reduce risks, and respond with speed to new business opportunities and competitive threats. Pulumi is an open-source IaS solution that allows developers to use real programming languages. Some of the benefits of Pulumi include Familiarity, Abstractions, Multi-Cloud DevOps, and Sharing and Reuse. If you want to start using Pulumi, I recommend following the official Pulumi tutorials.


 

References

  1. About Carlos SchultsThis post was written by Carlos Schults. Carlos is a .NET software developer with experience in both desktop and web development. “What Is Infrastructure as Code? How It Works, Best Practices, Tutorials.” Stackify, 6 Apr. 2020, stackify.com/what-is-infrastructure-as-code-how-it-works-best-practices-tutorials/.

  2. “Infrastructure-as-Code.” IBM, www.ibm.com/cloud/learn/infrastructure-as-code.

  3. SamGu. “What Is Infrastructure as Code? - Azure DevOps.” Azure DevOps | Microsoft Docs, docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as-code.

  4. “Why Pulumi.” Pulumi, www.pulumi.com/why-pulumi/.

48 views0 comments

Recent Posts

See All

コメント


bottom of page