For this tutorial, we’re going to learn more about cloud computing by exploring how to use Pulumi to build, configure, and deploy a real-life, modern application using Docker. We will create a frontend, a backend, and a database to deploy the Pulumipus Boba Tea Shop. Along the way, we’ll learn more about how Pulumi works. Time How long this tutorial will take depends on your internet connection, reading speed, and other factors.
Infrastructure in Pulumi is organized into projects. In the Pulumi ecosystem, a project represents a Pulumi program that, when run, declares the desired infrastructure for Pulumi to manage. The program has corresponding stacks, or isolated, independently configurable instances of your Pulumi program. We’ll talk more about stacks later in the Building with Pulumi pathway. Create a directory Each Pulumi project lives in its own directory. Create one now and change into it by running these commands in your terminal:
Now that we’ve created our images, we can provision our application with a network and containers. First, we’re going to add configuration to our Pulumi program. Pulumi is a tool to configure your infrastructure, and that includes being able to configure the different stacks with different values. As a result, it makes sense to include the basic configurations as variables at the top of your program. Configure the application Add the following configuration variables to your Pulumi program below the imports:
In this part, we’ll create our first Pulumi resource. Resources in Pulumi are the basic building blocks of your infrastructure, whether that’s a database instance or a compute instance or a specific storage bucket. In Pulumi, resource providers manage your resources. You can group those resources to abstract them (such as a group of compute instances that all have the same configuration and implementation) via component resources. In this case, our resources are going to be Docker containers and images that we build locally using infrastructure as code.