🗂️ Navigation

Pulumi Command Provider

Run external commands as part of your Pulumi deployment.

Visit Website →

Overview

The Pulumi Command provider is a utility provider that allows you to run arbitrary shell commands as part of a Pulumi deployment. It can execute commands locally on the machine running Pulumi or remotely on a resource via SSH. This provider acts as a bridge to integrate non-declarative or external tools into a declarative Pulumi workflow, but should be used with caution as it can make deployments less predictable.

✨ Key Features

  • Execute local shell commands
  • Execute remote commands over SSH
  • Control when commands are run (on create, update, delete)
  • Pass inputs to commands and read their outputs
  • Trigger re-execution when specific inputs change

🎯 Key Differentiators

  • Integration into Pulumi's declarative resource model and dependency graph
  • Ability to use outputs from other resources as command inputs
  • Consistent experience across different programming languages

Unique Value: Provides a declarative way to manage the lifecycle of imperative commands, integrating them into the Pulumi resource graph to handle dependencies and triggers correctly.

🎯 Use Cases (4)

Running a database migration script after a database has been provisioned. Fetching a credential from an external system that doesn't have a Pulumi provider. Running a configuration script on a newly created virtual machine. Integrating a custom CLI tool into the deployment process.

✅ Best For

  • Using `kubectl` commands as part of a deployment to apply a manifest that is not easily representable in the Kubernetes provider.
  • Running a `git clone` command to fetch application code onto a server.

💡 Check With Vendor

Verify these considerations match your specific requirements:

  • Managing resources that have a dedicated, declarative Pulumi provider available.
  • As a replacement for a proper configuration management tool like Ansible or Chef for complex server setup.

🏆 Alternatives

Terraform provisioners (local-exec, remote-exec) Custom scripting in CI/CD pipelines

Offers a more integrated solution than running separate scripts in a CI/CD pipeline, as it respects the dependency order of infrastructure resources. It should be used as a last resort when a declarative provider is not available.

💻 Platforms

API

✅ Offline Mode Available

🔌 Integrations

Local shell (bash, PowerShell, etc.) SSH

💰 Pricing

Contact for pricing
Free Tier Available

Free tier: The provider is open-source and free to use.

Visit Pulumi Command Provider Website →