
Getting Started Guide
How to Use Pulumi
A practical guide to get you up and running with Pulumi. Written by Delv Editorial, Delv Team.
Getting started with Pulumi
In this guide, you'll learn how to set up Pulumi and create your first cloud infrastructure using your preferred programming language. By the end, you'll be ready to manage cloud resources efficiently.Step 1: Sign up and set up
- Go to the Pulumi website.
- Click on the Get Started button in the top right corner.
- Choose Sign Up and create an account using your email address or sign in with GitHub.
- After signing up, you’ll be prompted to install the Pulumi CLI. Follow the instructions for your operating system (Windows, macOS, or Linux).
- Once installed, open your terminal and run
pulumi loginto log in to your Pulumi account.
Step 2: Your first project
- In your terminal, create a new directory for your project using
mkdir my-first-pulumi-project && cd my-first-pulumi-project. - Initialise a new Pulumi project by running
pulumi new. - Select your preferred language (e.g., TypeScript, Python, Go, or C#) from the list.
- Follow the prompts to name your project and select a stack (you can use the default).
- Once the project is created, you’ll see a
Pulumi.yamlfile and a main file (likeindex.tsfor TypeScript). - Open the main file and add a simple resource, for example, an AWS S3 bucket:
import * as aws from "@pulumi/aws";
const bucket = new aws.s3.Bucket("my-bucket");
- Save your changes and run
pulumi upin the terminal to deploy your infrastructure. Confirm the action when prompted.
Step 3: Get better results
- To manage your stacks, use
pulumi stack lsto list all available stacks andpulumi stack select <stack-name>to switch between them. - Use
pulumi config set <key> <value>to manage configuration settings for your project. - Explore the Pulumi documentation to find libraries and examples for advanced use cases.
Pro tip
Use
pulumi preview before running pulumi up. This command shows you what changes will be made without actually deploying them, helping you catch any mistakes early.