Skip to main content
In this guide, we will walk through the process of setting up and bootstrapping a Pulumi project using the pulumi new command. Pulumi streamlines cloud infrastructure deployments by allowing you to choose your cloud provider and preferred programming language while automatically handling the necessary configurations.

Step 1: Initialize a New Project

Open your command prompt on Windows and run:
Since this project is developed in Python for AWS, scroll down to the AWS section and select the template titled “A minimal AWS Python Pulumi program.” Once selected, you will be guided through the next steps.

Step 2: Configure Your New Project

After picking the AWS-Python template, the tool will prompt you for some basic project information.
  1. Project Name & Description:
    Accept the default values (for example, pulumi-demo for the project name and the corresponding description) unless you prefer to customize them.
  2. Stack Name:
    A stack represents an isolated instance of your project configuration, which is useful for managing different environments such as development, staging, and production. In this guide, we use the default dev stack for the development environment:
  3. AWS Region Selection:
    You will be prompted to select the AWS region for deployment. In this example, we use us-east-1, but you may choose any region appropriate for your project.
If you were setting up a project for another cloud provider (such as Azure), the process remains similar but Pulumi would install dependencies related to that specific provider (e.g., Pulumi-Azure).

Step 3: Dependency Installation and Environment Setup

During the bootstrapping process, Pulumi automatically configures several key components:
  • Virtual Environment: A dedicated Python virtual environment is created.
  • Version Control: A .gitignore file is generated to help manage unnecessary files.
  • Dependencies Management: A requirements.txt file is created listing essential packages like Pulumi and Pulumi-AWS.
The requirements.txt file usually contains:
The command prompt will display the dependency installation output similar to:

Step 4: Review the Generated Code

All the boilerplate code for your Pulumi project is stored in the main.py file. Open this file in your favorite code editor to explore the default configuration and sample infrastructure code generated by Pulumi.
Now that your project is fully set up, you can begin modifying the code in main.py to define your infrastructure. When you’re ready, execute pulumi up to deploy your resources.
By following these steps, you have successfully bootstrapped your Pulumi project configured for AWS and Python. Enjoy building and deploying your cloud infrastructure!

Watch Video