Category: Software, Data, Infrastructure, automation, yaml

Infrastructure As Code (IaC) has become a key concept when working with Cloud providers and implementing DevOps, having IaC in your projects helps you manage, automate, test, and simplify deployment processes by building CI/CD pipelines that can integrate the application and the infrastructure code.

The most common tools are CloudFormation, which works with AWS specifically, and Terraform, which can be implemented in several cloud providers.

These concepts can be reviewed in detail in the Pulumi Documentation: Program: This is the code that you write to create your infrastructure, this can include multiple files in your programming language of choice, from Pulumi CLI you run Pulumi up command and Pulumi will execute it and determine the desired infrastructure state for all resources declared.

Keep in mind that you can not access the output directly, for instance, the method create_alb into the class aws_alb returns a Python dictionary with the ARN, DNS, and Zone ID for the ALB created, you can not print or manipulate these outputs directly because each element in the dictionary is a Pulumi Output object, if you try to print that, you will get the following output.

We have seen how we can use Python3 to define the infrastructure in AWS for a simple microservice, we can take advantage of a real programing language and apply the knowledge that we already have.

Related Articles