| name | Deploying Pulumi Infrastructure |
|---|---|
| description | Preview and deploy infrastructure changes using Pulumi. Use when deploying infrastructure, running pulumi up/preview, or applying infrastructure changes. Includes credential management with 1Password and safety confirmations for destructive operations. |
Deploy and manage infrastructure changes safely using Pulumi's preview and deployment workflow.
Use this skill when:
- Deploying infrastructure changes
- Previewing changes before applying
- Running
pulumi uporpulumi preview - Applying infrastructure as code
- Managing infrastructure updates
Follow this safe deployment pattern:
Ensure AWS and Pulumi credentials are available:
# If using direnv + 1Password (recommended):
# Credentials auto-load from .envrc when entering directory
cd path/to/pulumi/project
# Verify credentials loaded:
echo $AWS_ACCESS_KEY_ID # Should show key
echo $PULUMI_CONFIG_PASSPHRASE # Should show valueIf credentials not loaded: Check .envrc exists and direnv is allowed (direnv allow).
Always preview before deploying:
uv run pulumi previewReview the output carefully:
- Green
+: Resources to be created - Yellow
~: Resources to be modified - Red
-: Resources to be deleted
Before running pulumi up, always confirm with the user:
- Summarize the changes from the preview
- Highlight any destructive operations (deletes, replacements)
- Ask: "Should I proceed with deployment?"
- Wait for explicit confirmation
Only after user confirmation:
uv run pulumi up --yesThe --yes flag auto-approves the deployment (safe since user already confirmed based on preview).
After successful deployment:
# View stack outputs
uv run pulumi stack output
# Check resource state
uv run pulumi stack --show-urns# Preview changes (dry-run)
uv run pulumi preview
# Deploy with automatic approval
uv run pulumi up --yes
# Deploy and save detailed output
uv run pulumi up --yes 2>&1 | tee deployment.log
# View current stack state
uv run pulumi stack
# Export stack configuration
uv run pulumi stack export > stack-backup.jsonBefore deploying, verify:
- Credentials are loaded (AWS, Pulumi passphrase)
- Working in correct Pulumi project directory
- Correct stack selected (
pulumi stack select <stack>) - Preview shows expected changes
- No unexpected deletions or replacements
- User has confirmed deployment
- Backup of current state if making major changes
If deployment fails:
- Read the error message carefully - Pulumi provides detailed errors
- Check credentials - Most failures are authentication issues
- Verify permissions - IAM/RBAC issues are common
- Review stack state -
pulumi stackshows current state - Consult troubleshooting guide - See ../stack-management/troubleshooting.md
For more complex deployment scenarios, see reference.md:
- Targeted deployments (specific resources)
- Refresh operations
- Import existing infrastructure
- Parallel deployments
- CI/CD integration patterns
- Stack Management: Switch stacks, view outputs, manage configuration
- New Project: Initialize new Pulumi projects with proper structure
- Documentation: Access Pulumi provider documentation