@nx-extend/pulumi
v12.0.1
Published
<a href="https://www.npmjs.com/package/@nx-extend/pulumi" rel="nofollow"> <img src="https://badgen.net/npm/v/@nx-extend/pulumi" alt="@nx-extend/pulumi NPM package"> </a>
Readme
@nx-extend/pulumi
Nx plugin for deploying your resources with Pulumi.
Features
- Manage infrastructure as code with Pulumi
- Multiple executors for different Pulumi operations
- Stack management and configuration
- Preview changes before applying
- Import existing resources
- Refresh state
Setup
Prerequisites
- Pulumi CLI installed and available in PATH
- Pulumi account and project configured
Install
npm install -D @nx-extend/pulumi
nx g @nx-extend/pulumi:initUsage
Available Executors
Up
Deploy your Pulumi stack:
nx run <project-name>:upAvailable options:
| Name | Type | Default | Description |
|------------|----------|---------|-------------------------------------------------------|
| stack | string | - | The target stack to use, if specified |
| root | string | - | The working directory to run Pulumi commands from |
Preview
Preview changes to your stack:
nx run <project-name>:previewAvailable options:
| Name | Type | Default | Description |
|------------|----------|---------|-------------------------------------------------------|
| stack | string | - | The target stack to use, if specified |
| root | string | - | The working directory to run Pulumi commands from |
Refresh
Refresh the state of your stack:
nx run <project-name>:refreshAvailable options:
| Name | Type | Default | Description |
|------------|----------|---------|-------------------------------------------------------|
| stack | string | - | The target stack to use, if specified |
| root | string | - | The working directory to run Pulumi commands from |
Import
Import existing resources into your Pulumi stack:
nx run <project-name>:importAvailable options:
| Name | Type | Default | Description |
|------------|----------|---------|-------------------------------------------------------|
| stack | string | - | The target stack to use, if specified |
| root | string | - | The working directory to run Pulumi commands from |
Config
Set config variable:
nx config <project-name> set --name="<name>" --value="<value>"Set secret config variable:
nx config <project-name> set --secret --name="<name>" --value="<value>"Available options:
| Name | Type | Default | Description |
|--------------|-----------|---------|-----------------------------------------------------|
| stack | string | - | The target stack to use, if specified |
| root | string | - | The working directory to run Pulumi commands from |
| name | string | - | The name of the config key to set |
| value | string | - | The value to set |
| secret | boolean | false | Whether to store the value as a secret |
Examples
Basic Stack Deployment
nx run my-infrastructure:up --stack=productionPreview Changes
nx run my-infrastructure:preview --stack=stagingSet Configuration
nx config my-infrastructure set --name="region" --value="us-east-1"
nx config my-infrastructure set --secret --name="api-key" --value="secret-value"