Skip to main content

Pulumi Remote Stack

PyPI version Python versions License

A Pulumi Dynamic Resource provider for provisioning, configuring, and managing remote Pulumi stacks via the Pulumi Automation API.

How It Works

Under the hood, RemoteStack dynamically generates an inline pass-through Pulumi program that:

  1. Reads all supplied configuration entries and secrets from the Pulumi stack configuration.
  2. Directly exports them as stack outputs (with secrets appropriately marked as secret).
  3. Executes stack lifecycle operations (up, destroy) using the Pulumi Automation API.

The entire flow is wrapped in a Pulumi Dynamic Resource Provider, allowing you to create, populate, and manage independent remote stacks declaratively inside ordinary Pulumi programs. Downstream stacks can then consume these configurations and secrets as outputs using standard pulumi.StackReference.

Features

  • Lifecycle Management: Declaratively manage remote stacks (create, update, destroy) as first-class Pulumi resources.
  • Dynamic Configuration & Secrets: Pass plain configuration values or encrypted secrets directly to target stacks.
  • Pluggable Backends: Compatible with any standard Pulumi backend URL (e.g., cloud object stores, self-hosted backends, or Pulumi Service).
  • Azure Blob Storage Support: Automatic User SAS token generation for Azure Blob Storage backends via Azure CLI credentials.
  • Configurable Secrets Providers: Integrate custom encryption providers supported by Pulumi (e.g., HashiCorp Vault, AWS KMS, Azure KeyVault, GCP KMS).

Installation

Install using uv:

uv add pulumi-remote-stack

Or using pip:

pip install pulumi-remote-stack

Usage

import pulumi
from pulumi_remote_stack import RemoteStack

# Provision or manage the remote stack
remote_stack = RemoteStack(
    "production-infrastructure",
    project_name="my-infra",
    stack_name="prod",
    backend_url="azblob://my-pulumi-state",
    secrets_provider="azurekeyvault://my-vault.vault.azure.net/keys/my-key",
    backend_azure_storage_account="mystorageaccount",
    config={
        "environment": "production",
        "instance_count": 3,
    },
    secrets={
        "database_password": "supersecretpassword",
    },
)

# Consume exported configurations and secrets from the remote stack via standard Pulumi StackReference
stack_ref = pulumi.StackReference(
    "prod-ref",
    stack_name="prod",
    opts=pulumi.ResourceOptions(depends_on=[remote_stack]),
)

# Access values originally passed to the remote stack's config or secrets
env_name = stack_ref.get_output("environment")
db_password = stack_ref.get_output("database_password")

Inputs

Parameter Type Required Description
project_name Input[str] Yes Name of the Pulumi project to manage.
stack_name Input[str] Yes Name of the stack (e.g., dev, prod).
backend_url Input[str] Yes Target Pulumi backend URL (passed to PULUMI_BACKEND_URL).
secrets_provider Input[str] Yes Type and URI of secrets provider (e.g., default, passphrase, awskms://..., azurekeyvault://...).
config Input[dict[str, ConfigValue]] No Stack configuration map. Accepts primitive types (str, int, bool) and nested structures (dict, list).
secrets Input[dict[str, ConfigValue]] No Secret configuration values to encrypt and store securely in the target stack.
backend_azure_storage_account Input[str] No Azure Storage Account name if using Azure Blob backend. Triggers automated SAS token acquisition via Azure CLI.
only_create Input[bool] No When True, provisions the stack only once and skips updates during subsequent runs. Default: False.

Development

See DEVELOPMENT.md for local environment setup, build, and publishing guides.

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for pulumi-remote-stack 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulumi-remote-stack 0.1.8
File Size Uploaded
pulumi_remote_stack-0.1.8.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pulumi-remote-stack 0.1.8
File Interpreter ABI Platform
pulumi_remote_stack-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / pulumi_remote_stack-0.1.8.tar.gz

Download URL pulumi_remote_stack-0.1.8.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
804aa9e7656f7aa18489fd02818a455bf0ca100abf4547e3e6843ebe504e5511
BLAKE2b-256 checksum
How to use checksums
cfaa1a5b3ec2b3f71c42ef29e11e70d102d8f5fd59f29c47925f9b80d81d3ecf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / pulumi_remote_stack-0.1.8-py3-none-any.whl

Download URL pulumi_remote_stack-0.1.8-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29e4ddb624c1aa9a96c623fd1527f802b1640637849934b8d43a3edc4b1e670c
BLAKE2b-256 checksum
How to use checksums
6a7387788f56061d9f8847a9f4646a8a148a8e5482c80e6277ed7b28e1a329b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page