Skip to main content

Getting Started

Learn how to install and use Pulumi Any Terraform providers in your infrastructure projects
2 min read

This guide will help you get up and running with Pulumi Any Terraform providers in minutes.

Prerequisites#

Before you begin, make sure you have:

  • Node.js 18.0 or later (for TypeScript/JavaScript)
  • Pulumi CLI 3.190.0 or later
  • Package Manager: npm, yarn, or pnpm
  • A Pulumi account (sign up at app.pulumi.com)

Installing Pulumi#

If you don't have Pulumi installed:

Verify your installation:

Installation#

Each provider can be installed independently as an npm package.

Using npm#

Using yarn#

Using pnpm#

Creating Your First Project#

1. Initialize a Pulumi Project#

Create a new directory and initialize a Pulumi project:

Follow the prompts to set up your project. This creates:

  • Pulumi.yaml - Project configuration
  • index.ts - Your infrastructure code
  • package.json - Node.js dependencies

2. Install a Provider#

Add a provider to your project:

3. Configure Provider Credentials#

Most providers require API credentials. Configure them using Pulumi config:

Alternatively, use environment variables:

4. Write Your Infrastructure Code#

Edit index.ts to define your infrastructure:

5. Deploy Your Infrastructure#

Preview and deploy your infrastructure:

Pulumi will show you what resources will be created. Type "yes" to proceed.

6. Update and Manage#

To update your infrastructure, modify your code and run pulumi up again:

7. Clean Up#

When you're done, destroy your resources:

Example: Multi-Resource Deployment#

Here's a more complete example using Better Uptime to set up monitoring:

Using Multiple Providers#

You can use multiple providers in the same project:

Configuration Best Practices#

1. Use Pulumi Config for Secrets#

Always use --secret flag for sensitive data:

2. Organize with Stacks#

Use different stacks for different environments:

3. Use Stack References#

Share outputs between stacks:

Next Steps#

Now that you've created your first infrastructure:

Common Commands#

Here's a quick reference of Pulumi commands:

CommandDescription
pulumi newCreate a new project
pulumi previewPreview changes before deploying
pulumi upDeploy infrastructure
pulumi destroyDestroy all resources
pulumi stackManage stacks
pulumi configManage configuration
pulumi stateManage state
pulumi refreshRefresh state to match actual resources
pulumi cancelCancel an in-progress update

Getting Help#

If you run into issues:

  1. Check the Troubleshooting Guide
  2. Review Pulumi Documentation
  3. Search GitHub Issues
  4. Open a new issue with details about your problem