pulumi-troubleshooting
Skill124 starsChanged 8 months agoMITView on GitHub
Comprehensive guide to troubleshooting Pulumi TypeScript errors, infrastructure issues, and best practices - covers common errors, Outputs handling, AWS Beanstalk deployment, and cost optimization
- Reads credentials
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Solution: Use optional chaining for conditional exports:
- Distinctive: line 44
Solution: Remove the config section or don't set defaults for provider configs:
- Very specific: line 62
Solution: Use || operator to create if not exists:
- Very specific: line 71
Use .apply() to transform Output values
- Very specific: line 72
Use pulumi.all([...]) to combine multiple Outputs
- Very specific: line 73
Use pulumi.output(value) to wrap plain values as Outputs
- Distinctive: line 109
Solution: Use JSON.stringify for complex values:
- Distinctive: line 122
Solution: Ensure DNS records are created and wait for validation:
- Very specific: line 165
Run npm run build in the infra package locally
- Distinctive: line 166
Check for conditional exports inside blocks
- Distinctive: line 167
Verify all Pulumi Outputs are properly typed
- Very specific: line 168
Look for .map() calls on potentially undefined arrays
- Distinctive: line 169
Ensure all imports are correct
- Distinctive: line 177
Use public subnets to avoid NAT Gateway costs ($32/month)
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pulumi Infrastructure Troubleshooting Skill
Common Pulumi TypeScript Errors and Solutions
1. "This expression is not callable. Type 'never' has no call signatures"
Cause: TypeScript infers a type as never when working with Pulumi Outputs, especially with arrays.
Solution: Wrap the value in pulumi.output() and properly type the callback:
// ❌ Bad - TypeScript can't infer the type
value: pulumi.all(config.vpc.publicSubnets.map((s: any) => s.id))
// ✅ Good - Explicitly wrap and type
value: pulumi.output(config.vpc.publicSubnets).apply((subnets: any[]) =>
pulumi.all(subnets.map((s: any) => s.id)).apply(ids => ids.join(","))
)2. "Modifiers cannot appear here" (export in conditional blocks)
Cause: TypeScript doesn't allow export statements inside if blocks.
Solution: Use optional chaining for conditional exports:
// ❌ Bad
if (opensearch) {
export const opensearchEndpoint = opensearch.endpoint;
}
// ✅ Good
export const opensearchEndpoint = opensearch?.endpoint;3. "Configuration key 'aws:region' is not namespaced by the project"
Cause: Pulumi.yaml config with namespaced keys (e.g., aws:region) cannot use default attribute.
Solution: Remove the config section or don't set defaults for provider configs:
# ❌ Bad
config:
aws:region:
description: AWS region
default: us-east-1
# ✅ Good - set via workflow/CLI instead
config:
app:domainName:
description: Domain name4. Stack Not Found Errors
Cause: Pulumi stack doesn't exist yet in new environments.
Solution: Use || operator to create if not exists:
pulumi stack select $STACK || pulumi stack init $STACK5. Working with Pulumi Outputs
Key Concepts:
pulumi.Output<T>is a promise-like wrapper for async values- Use
.apply()to transform Output values - Use
pulumi.all([...])to combine multiple Outputs - Use
pulumi.output(value)to wrap plain values as Outputs
Common Patterns:
// Transforming a single Output
const url = endpoint.apply(e => `https://${e}`);
// Combining multiple Outputs
const connectionString = pulumi.all([host, port, db]).apply(
([h, p, d]) => `postgres://${h}:${p}/${d}`
);
// Interpolating Outputs
const message = pulumi.interpolate`Server at ${endpoint}:${port}`;Nested Outputs (Properties that are themselves Outputs):
// ❌ Bad - resource.property might be an Output<string>
const endpoint = instance.apply(i => i.endpoint.split(":")[0]); // ERROR: Property 'split' does not exist
// ✅ Good - unwrap nested Output with pulumi.output()
const endpoint = instance.apply(i =>
pulumi.output(i.endpoint).apply(e => e.split(":")[0])
);
// ✅ Alternative - use pulumi.all to flatten
const endpoint = pulumi.all([instance]).apply(([inst]) =>
pulumi.output(inst.endpoint).apply(e => e.split(":")[0])
);6. Beanstalk Environment Variables
Issue: Complex objects or arrays need to be serialized.
Solution: Use JSON.stringify for complex values:
{
namespace: "aws:elasticbeanstalk:application:environment",
name: "ALLOWED_ORIGINS",
value: allowedOrigins.apply(origins => JSON.stringify(origins)),
}7. ACM Certificate Validation
Issue: Certificate validation hangs or times out.
Solution: Ensure DNS records are created and wait for validation:
// 1. Create certificate
const cert = new aws.acm.Certificate(...);
// 2. Create DNS validation record
const validationRecord = new aws.route53.Record(..., {
name: cert.domainValidationOptions[0].resourceRecordName,
type: cert.domainValidationOptions[0].resourceRecordType,
records: [cert.domainValidationOptions[0].resourceRecordValue],
});
// 3. Wait for validation to complete
const validation = new aws.acm.CertificateValidation(..., {
certificateArn: cert.arn,
validationRecordFqdns: [validationRecord.fqdn],
});8. GitHub Actions Pulumi Setup
Best Practices:
- name: Setup Pulumi
uses: pulumi/actions@v5
- name: Configure Stack
run: |
STACK="${{ inputs.stack || 'prod' }}"
pulumi stack select $STACK || pulumi stack init $STACK
pulumi config set aws:region ${{ env.AWS_REGION }}
# Set other non-secret configs here
- name: Pulumi Up
run: pulumi up --yes --non-interactive
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}9. Debugging TypeScript Compilation
Quick checks:
- Run
npm run buildin the infra package locally - Check for conditional exports inside blocks
- Verify all Pulumi Outputs are properly typed
- Look for
.map()calls on potentially undefined arrays - Ensure all imports are correct
10. Cost Optimization Tips
Beanstalk vs ECS Fargate:
- Beanstalk with t3.micro: ~$32/month
- ECS Fargate: ~$126/month
- Key difference: Beanstalk runs on EC2 instances you control
- Use public subnets to avoid NAT Gateway costs ($32/month)
Checklist Before Deploying
- Run
npm run buildlocally to catch TypeScript errors - Test with
pulumi previewbeforepulumi up - Verify all secrets are in GitHub Secrets (not hardcoded)
- Check stack name matches environment (dev/staging/prod)
- Ensure domain/DNS is configured if using custom domains
- Verify VPC/subnets exist if using existing infrastructure
- Check that all required extensions/providers are installed
Common Environment Variables to Set
// Database
DATABASE_URL: pulumi.interpolate`postgres://${user}:${pass}@${host}:5432/${db}`
// Redis
REDIS_URL: redisEndpoint.apply(e => `redis://${e}:6379`)
// S3
S3_BUCKET: bucketName
S3_REGION: region
// Auth
GITHUB_CLIENT_ID: clientId
GITHUB_CLIENT_SECRET: clientSecret
// App Config
NODE_ENV: "production"
PORT: "8080"
LOG_LEVEL: "info"Resources
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

