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:Step 2: Configure Your New Project
After picking the AWS-Python template, the tool will prompt you for some basic project information.-
Project Name & Description:
Accept the default values (for example,pulumi-demofor the project name and the corresponding description) unless you prefer to customize them. -
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 defaultdevstack for the development environment: -
AWS Region Selection:
You will be prompted to select the AWS region for deployment. In this example, we useus-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
.gitignorefile is generated to help manage unnecessary files. - Dependencies Management: A
requirements.txtfile is created listing essential packages like Pulumi and Pulumi-AWS.
requirements.txt file usually contains:
Step 4: Review the Generated Code
All the boilerplate code for your Pulumi project is stored in themain.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.