pulumi-basics
$
npx mdskill add TheBushidoCollective/han/pulumi-basicsProvides infrastructure-as-code guidance for Pulumi projects using programming languages to provision cloud resources.
- Helps developers structure and write IaC projects with real programming languages.
- Integrates with Pulumi SDKs and cloud providers like AWS for resource management.
- Recommends based on project templates, configuration files, and common Pulumi commands.
- Presents results through code examples, command-line instructions, and configuration guidance.
SKILL.md
.github/skills/pulumi-basicsView on GitHub ↗
---
name: pulumi-basics
user-invocable: false
description: Use when writing infrastructure-as-code with Pulumi using programming languages for cloud resource provisioning.
allowed-tools: []
---
# Pulumi Basics
Infrastructure-as-code using real programming languages with Pulumi.
## Project Structure
```
my-infrastructure/
├── Pulumi.yaml # Project file
├── Pulumi.dev.yaml # Stack config
├── index.ts # Main program
└── package.json
```
## Pulumi.yaml
```yaml
name: my-infrastructure
user-invocable: false
runtime: nodejs
description: My infrastructure project
```
## TypeScript Example
```typescript
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Create VPC
const vpc = new aws.ec2.Vpc("main", {
cidrBlock: "10.0.0.0/16",
enableDnsHostnames: true,
tags: {
Name: "main-vpc",
},
});
// Create subnet
const subnet = new aws.ec2.Subnet("public", {
vpcId: vpc.id,
cidrBlock: "10.0.1.0/24",
availabilityZone: "us-east-1a",
});
// Export outputs
export const vpcId = vpc.id;
export const subnetId = subnet.id;
```
## Common Commands
```bash
# Create new project
pulumi new aws-typescript
# Preview changes
pulumi preview
# Apply changes
pulumi up
# Destroy resources
pulumi destroy
# View stack outputs
pulumi stack output
```
## Configuration
```bash
# Set config
pulumi config set aws:region us-east-1
# Set secret
pulumi config set --secret dbPassword mySecret123
# Get config
pulumi config get aws:region
```
## Best Practices
### Use Stack References
```typescript
const infraStack = new pulumi.StackReference("org/infra/prod");
const vpcId = infraStack.getOutput("vpcId");
```
### Component Resources
```typescript
class MyApp extends pulumi.ComponentResource {
constructor(name: string, args: MyAppArgs, opts?: pulumi.ComponentResourceOptions) {
super("custom:app:MyApp", name, {}, opts);
// Create resources
}
}
```
More from TheBushidoCollective/han
- absinthe-resolversUse when implementing GraphQL resolvers with Absinthe. Covers resolver patterns, dataloader integration, batching, and error handling.
- absinthe-schemaUse when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
- absinthe-subscriptionsUse when implementing real-time GraphQL subscriptions with Absinthe. Covers Phoenix channels, PubSub, and subscription patterns.
- act-docker-setupUse when configuring Docker environments for act, selecting runner images, managing container resources, or troubleshooting Docker-related issues with local GitHub Actions testing.
- act-local-testingUse when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues when running workflows on your local machine.
- act-workflow-syntaxUse when creating or modifying GitHub Actions workflow files. Provides guidance on workflow syntax, triggers, jobs, steps, and expressions for creating valid GitHub Actions workflows that can be tested locally with act.
- ameba-configurationUse when configuring Ameba rules and settings for Crystal projects including .ameba.yml setup, rule management, severity levels, and code quality enforcement.
- ameba-custom-rulesUse when creating custom Ameba rules for Crystal code analysis including rule development, AST traversal, issue reporting, and rule testing.
- ameba-integrationUse when integrating Ameba into development workflows including CI/CD pipelines, pre-commit hooks, GitHub Actions, and automated code review processes.
- analyze-performanceAnalyze performance metrics and identify slow transactions in Sentry