[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JF3H6MVB92R81N2A4XG6CB":3,"skill-same:01M6JF3H6MVB92R81N2A4XG6CB":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6JF3H6MVB92R81N2A4XG6CB","pulumi-component",null,"Guide for authoring Pulumi ComponentResource classes. Use when creating reusable infrastructure components, designing component interfaces, setting up multi-language support, or distributing component packages.","jdiegosierra\u002Fenterprise-agent-plugins","jdiegosierra","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F27728978?v=4","01M6JF1FEEGH0TEKZ1X8C4DC89","Diego","01M6JF1FJR2H5YYKPRJ0HTJ9RJ",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fpulumi-component\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"pulumi component","component","pulumi","agent-skills","for","multi-language","multi","authoring","language","reusable","support","up","use","guide","packages","infrastructure","components","2026-11-10 10:12:30",false,"---\nname: pulumi-component\ndescription: Guide for authoring Pulumi ComponentResource classes. Use when creating reusable infrastructure components, designing component interfaces, setting up multi-language support, or distributing component packages.\nmetadata:\n  based_on: pulumi\u002Fagent-skills\n---\n\n# Authoring Pulumi Components\n\nA ComponentResource groups related infrastructure resources into a reusable, logical unit. Components make infrastructure easier to understand, reuse, and maintain. Components appear as a single node with children nested underneath in `pulumi preview`\u002F`pulumi up` output and in the Pulumi Cloud console.\n\nThis skill covers the full component authoring lifecycle. For general Pulumi coding patterns (Output handling, secrets, aliases, preview workflows), use the `pulumi-best-practices` skill instead.\n\n## When to Use This Skill\n\nInvoke this skill when:\n\n- Creating a new ComponentResource class\n- Designing the args interface for a component\n- Making a component consumable from multiple Pulumi languages\n- Publishing or distributing a component package\n- Refactoring inline resources into a reusable component\n- Debugging component behavior (missing outputs, stuck creating, children at wrong level)\n\n## Component Anatomy\n\nEvery component has four required elements:\n\n1. **Extend ComponentResource** and call `super()` with a type URN\n2. **Accept standard parameters**: name, args, and `ComponentResourceOptions`\n3. **Set `parent: this`** on all child resources\n4. **Call `registerOutputs()`** at the end of the constructor\n\n### TypeScript\n\n```typescript\nimport * as pulumi from \"@pulumi\u002Fpulumi\";\nimport * as aws from \"@pulumi\u002Faws\";\n\ninterface StaticSiteArgs {\n    indexDocument?: pulumi.Input\u003Cstring>;\n    errorDocument?: pulumi.Input\u003Cstring>;\n}\n\nclass StaticSite extends pulumi.ComponentResource {\n    public readonly bucketName: pulumi.Output\u003Cstring>;\n    public readonly websiteUrl: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: StaticSiteArgs, opts?: pulumi.ComponentResourceOptions) {\n        \u002F\u002F 1. Call super with type URN: \u003Cpackage>:\u003Cmodule>:\u003Ctype>\n        super(\"myorg:index:StaticSite\", name, {}, opts);\n\n        \u002F\u002F 2. Create child resources with parent: this\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n\n        const website = new aws.s3.BucketWebsiteConfigurationV2(`${name}-website`, {\n            bucket: bucket.id,\n            indexDocument: { suffix: args.indexDocument ?? \"index.html\" },\n            errorDocument: { key: args.errorDocument ?? \"error.html\" },\n        }, { parent: this });\n\n        \u002F\u002F 3. Expose outputs as class properties\n        this.bucketName = bucket.id;\n        this.websiteUrl = website.websiteEndpoint;\n\n        \u002F\u002F 4. Register outputs -- always the last line\n        this.registerOutputs({\n            bucketName: this.bucketName,\n            websiteUrl: this.websiteUrl,\n        });\n    }\n}\n\n\u002F\u002F Usage\nconst site = new StaticSite(\"marketing\", {\n    indexDocument: \"index.html\",\n});\nexport const url = site.websiteUrl;\n```\n\n### Python\n\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nclass StaticSiteArgs:\n    def __init__(self,\n                 index_document: pulumi.Input[str] = \"index.html\",\n                 error_document: pulumi.Input[str] = \"error.html\"):\n        self.index_document = index_document\n        self.error_document = error_document\n\nclass StaticSite(pulumi.ComponentResource):\n    bucket_name: pulumi.Output[str]\n    website_url: pulumi.Output[str]\n\n    def __init__(self, name: str, args: StaticSiteArgs,\n                 opts: pulumi.ResourceOptions = None):\n        super().__init__(\"myorg:index:StaticSite\", name, None, opts)\n\n        bucket = aws.s3.Bucket(f\"{name}-bucket\",\n            opts=pulumi.ResourceOptions(parent=self))\n\n        website = aws.s3.BucketWebsiteConfigurationV2(f\"{name}-website\",\n            bucket=bucket.id,\n            index_document=aws.s3.BucketWebsiteConfigurationV2IndexDocumentArgs(\n                suffix=args.index_document,\n            ),\n            error_document=aws.s3.BucketWebsiteConfigurationV2ErrorDocumentArgs(\n                key=args.error_document,\n            ),\n            opts=pulumi.ResourceOptions(parent=self))\n\n        self.bucket_name = bucket.id\n        self.website_url = website.website_endpoint\n\n        self.register_outputs({\n            \"bucket_name\": self.bucket_name,\n            \"website_url\": self.website_url,\n        })\n\nsite = StaticSite(\"marketing\", StaticSiteArgs())\npulumi.export(\"url\", site.website_url)\n```\n\n### Type URN Format\n\nThe first argument to `super()` is the type URN: `\u003Cpackage>:\u003Cmodule>:\u003Ctype>`.\n\n| Segment | Convention | Example |\n|---------|-----------|---------|\n| package | Organization or package name | `myorg`, `acme`, `pkg` |\n| module  | Usually `index` | `index` |\n| type    | PascalCase class name | `StaticSite`, `VpcNetwork` |\n\nFull examples: `myorg:index:StaticSite`, `acme:index:KubernetesCluster`\n\n### registerOutputs Is Required\n\n**Why**: Without `registerOutputs()`, the component appears stuck in a \"creating\" state in the Pulumi console and outputs are not persisted to state.\n\n**Wrong**:\n\n```typescript\nclass MyComponent extends pulumi.ComponentResource {\n    public readonly url: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: MyArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:MyComponent\", name, {}, opts);\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n        this.url = bucket.bucketRegionalDomainName;\n        \u002F\u002F Missing registerOutputs -- component stuck \"creating\"\n    }\n}\n```\n\n**Right**:\n\n```typescript\nclass MyComponent extends pulumi.ComponentResource {\n    public readonly url: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: MyArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:MyComponent\", name, {}, opts);\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n        this.url = bucket.bucketRegionalDomainName;\n\n        this.registerOutputs({ url: this.url });\n    }\n}\n```\n\n### Derive Child Names from the Component Name\n\n**Why**: Hardcoded child names cause collisions when the component is instantiated multiple times.\n\n**Wrong**:\n\n```typescript\n\u002F\u002F Collides if two instances of this component exist\nconst bucket = new aws.s3.Bucket(\"my-bucket\", {}, { parent: this });\n```\n\n**Right**:\n\n```typescript\n\u002F\u002F Unique per component instance\nconst bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n```\n\n---\n\n## Designing the Args Interface\n\nThe args interface is the most impactful design decision. It defines what consumers can configure and how composable the component is.\n\n### Wrap Properties in Input\u003CT>\n\n**Why**: `Input\u003CT>` accepts both plain values and `Output\u003CT>` from other resources. Without it, consumers must unwrap outputs manually with `.apply()`.\n\n**Wrong**:\n\n```typescript\ninterface WebServiceArgs {\n    port: number;            \u002F\u002F Forces consumers to unwrap Outputs\n    vpcId: string;           \u002F\u002F Cannot accept vpc.id directly\n}\n```\n\n**Right**:\n\n```typescript\ninterface WebServiceArgs {\n    port: pulumi.Input\u003Cnumber>;     \u002F\u002F Accepts 8080 or someOutput\n    vpcId: pulumi.Input\u003Cstring>;    \u002F\u002F Accepts \"vpc-123\" or vpc.id\n}\n```\n\n### Keep Structures Flat\n\nAvoid deeply nested arg objects. Flat interfaces are easier to use and evolve.\n\n```typescript\n\u002F\u002F Prefer flat\ninterface DatabaseArgs {\n    instanceClass: pulumi.Input\u003Cstring>;\n    storageGb: pulumi.Input\u003Cnumber>;\n    enableBackups?: pulumi.Input\u003Cboolean>;\n    backupRetentionDays?: pulumi.Input\u003Cnumber>;\n}\n\n\u002F\u002F Avoid deep nesting\ninterface DatabaseArgs {\n    instance: {\n        compute: { class: pulumi.Input\u003Cstring> };\n        storage: { sizeGb: pulumi.Input\u003Cnumber> };\n    };\n    backup: {\n        config: { enabled: pulumi.Input\u003Cboolean>; retention: pulumi.Input\u003Cnumber> };\n    };\n}\n```\n\n### No Union Types\n\nUnion types break multi-language SDK generation. Python, Go, and C# cannot represent `string | number`.\n\n**Wrong**:\n\n```typescript\ninterface MyArgs {\n    port: pulumi.Input\u003Cstring | number>;  \u002F\u002F Fails in Python, Go, C#\n}\n```\n\n**Right**:\n\n```typescript\ninterface MyArgs {\n    port: pulumi.Input\u003Cnumber>;  \u002F\u002F Single type, works everywhere\n}\n```\n\nIf you need to accept multiple forms, use separate optional properties:\n\n```typescript\ninterface StorageArgs {\n    sizeGb?: pulumi.Input\u003Cnumber>;      \u002F\u002F Specify size in GB\n    sizeMb?: pulumi.Input\u003Cnumber>;      \u002F\u002F Or specify size in MB\n}\n```\n\n### No Functions or Callbacks\n\nFunctions cannot be serialized across language boundaries.\n\n**Wrong**:\n\n```typescript\ninterface MyArgs {\n    nameTransform: (name: string) => string;  \u002F\u002F Cannot serialize\n}\n```\n\n**Right**:\n\n```typescript\ninterface MyArgs {\n    namePrefix?: pulumi.Input\u003Cstring>;   \u002F\u002F Configuration instead of callback\n    nameSuffix?: pulumi.Input\u003Cstring>;\n}\n```\n\n### Use Defaults for Optional Properties\n\nSet sensible defaults inside the constructor so consumers only configure what they need:\n\n```typescript\ninterface SecureBucketArgs {\n    enableVersioning?: pulumi.Input\u003Cboolean>;   \u002F\u002F Defaults to true\n    enableEncryption?: pulumi.Input\u003Cboolean>;   \u002F\u002F Defaults to true\n    blockPublicAccess?: pulumi.Input\u003Cboolean>;  \u002F\u002F Defaults to true\n}\n\nclass SecureBucket extends pulumi.ComponentResource {\n    constructor(name: string, args: SecureBucketArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:SecureBucket\", name, {}, opts);\n\n        const enableVersioning = args.enableVersioning ?? true;\n        const enableEncryption = args.enableEncryption ?? true;\n        const blockPublicAccess = args.blockPublicAccess ?? true;\n\n        \u002F\u002F Apply defaults...\n    }\n}\n\n\u002F\u002F Consumer only overrides what they need\nconst bucket = new SecureBucket(\"data\", { enableVersioning: false });\n```\n\n---\n\n## Exposing Outputs\n\n### Expose Only What Consumers Need\n\nComponents often create many internal resources. Expose only the values consumers need, not every internal resource.\n\n**Wrong**:\n\n```typescript\nclass Database extends pulumi.ComponentResource {\n    \u002F\u002F Exposes everything -- consumers see implementation details\n    public readonly cluster: aws.rds.Cluster;\n    public readonly primaryInstance: aws.rds.ClusterInstance;\n    public readonly replicaInstance: aws.rds.ClusterInstance;\n    public readonly subnetGroup: aws.rds.SubnetGroup;\n    public readonly securityGroup: aws.ec2.SecurityGroup;\n    public readonly parameterGroup: aws.rds.ClusterParameterGroup;\n    \u002F\u002F ...\n}\n```\n\n**Right**:\n\n```typescript\nclass Database extends pulumi.ComponentResource {\n    \u002F\u002F Exposes only what consumers need\n    public readonly endpoint: pulumi.Output\u003Cstring>;\n    public readonly port: pulumi.Output\u003Cnumber>;\n    public readonly securityGroupId: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: DatabaseArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:Database\", name, {}, opts);\n\n        const sg = new aws.ec2.SecurityGroup(`${name}-sg`, { \u002F* ... *\u002F }, { parent: this });\n        const cluster = new aws.rds.Cluster(`${name}-cluster`, { \u002F* ... *\u002F }, { parent: this });\n\n        this.endpoint = cluster.endpoint;\n        this.port = cluster.port;\n        this.securityGroupId = sg.id;\n\n        this.registerOutputs({\n            endpoint: this.endpoint,\n            port: this.port,\n            securityGroupId: this.securityGroupId,\n        });\n    }\n}\n```\n\n### Derive Composite Outputs\n\nUse `pulumi.interpolate` or `pulumi.concat` to build derived values:\n\n```typescript\nthis.connectionString = pulumi.interpolate`postgresql:\u002F\u002F${args.username}:${args.password}@${cluster.endpoint}:${cluster.port}\u002F${args.databaseName}`;\n\nthis.registerOutputs({ connectionString: this.connectionString });\n```\n\n---\n\n## Component Design Patterns\n\n### Sensible Defaults with Override\n\nEncode best practices as defaults. Allow consumers to override when they have specific requirements.\n\n```typescript\ninterface SecureBucketArgs {\n    enableVersioning?: pulumi.Input\u003Cboolean>;\n    enableEncryption?: pulumi.Input\u003Cboolean>;\n    blockPublicAccess?: pulumi.Input\u003Cboolean>;\n    tags?: pulumi.Input\u003CRecord\u003Cstring, pulumi.Input\u003Cstring>>>;\n}\n\nclass SecureBucket extends pulumi.ComponentResource {\n    public readonly bucketId: pulumi.Output\u003Cstring>;\n    public readonly arn: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: SecureBucketArgs = {}, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:SecureBucket\", name, {}, opts);\n\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {\n            tags: args.tags,\n        }, { parent: this });\n\n        \u002F\u002F Versioning on by default\n        if (args.enableVersioning !== false) {\n            new aws.s3.BucketVersioningV2(`${name}-versioning`, {\n                bucket: bucket.id,\n                versioningConfiguration: { status: \"Enabled\" },\n            }, { parent: this });\n        }\n\n        \u002F\u002F Encryption on by default\n        if (args.enableEncryption !== false) {\n            new aws.s3.BucketServerSideEncryptionConfigurationV2(`${name}-encryption`, {\n                bucket: bucket.id,\n                rules: [{ applyServerSideEncryptionByDefault: { sseAlgorithm: \"AES256\" } }],\n            }, { parent: this });\n        }\n\n        \u002F\u002F Public access blocked by default\n        if (args.blockPublicAccess !== false) {\n            new aws.s3.BucketPublicAccessBlock(`${name}-public-access`, {\n                bucket: bucket.id,\n                blockPublicAcls: true,\n                blockPublicPolicy: true,\n                ignorePublicAcls: true,\n                restrictPublicBuckets: true,\n            }, { parent: this });\n        }\n\n        this.bucketId = bucket.id;\n        this.arn = bucket.arn;\n        this.registerOutputs({ bucketId: this.bucketId, arn: this.arn });\n    }\n}\n```\n\n### Conditional Resource Creation\n\nUse optional args to gate creation of sub-resources:\n\n```typescript\ninterface WebServiceArgs {\n    image: pulumi.Input\u003Cstring>;\n    port: pulumi.Input\u003Cnumber>;\n    enableMonitoring?: pulumi.Input\u003Cboolean>;\n    alarmEmail?: pulumi.Input\u003Cstring>;\n}\n\nclass WebService extends pulumi.ComponentResource {\n    constructor(name: string, args: WebServiceArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:WebService\", name, {}, opts);\n\n        const service = new aws.ecs.Service(`${name}-service`, {\n            \u002F\u002F ...service config...\n        }, { parent: this });\n\n        \u002F\u002F Only create alarm infrastructure when monitoring is enabled\n        if (args.enableMonitoring) {\n            const topic = new aws.sns.Topic(`${name}-alerts`, {}, { parent: this });\n\n            if (args.alarmEmail) {\n                new aws.sns.TopicSubscription(`${name}-alert-email`, {\n                    topic: topic.arn,\n                    protocol: \"email\",\n                    endpoint: args.alarmEmail,\n                }, { parent: this });\n            }\n\n            new aws.cloudwatch.MetricAlarm(`${name}-cpu-alarm`, {\n                \u002F\u002F ...alarm config referencing service...\n                alarmActions: [topic.arn],\n            }, { parent: this });\n        }\n\n        this.registerOutputs({});\n    }\n}\n```\n\n### Composition\n\nBuild higher-level components from lower-level ones. Each level manages a single concern.\n\n```typescript\n\u002F\u002F Lower-level component\nclass VpcNetwork extends pulumi.ComponentResource {\n    public readonly vpcId: pulumi.Output\u003Cstring>;\n    public readonly publicSubnetIds: pulumi.Output\u003Cstring>[];\n    public readonly privateSubnetIds: pulumi.Output\u003Cstring>[];\n\n    constructor(name: string, args: VpcNetworkArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:VpcNetwork\", name, {}, opts);\n        \u002F\u002F ...create VPC, subnets, route tables...\n        this.registerOutputs({ vpcId: this.vpcId });\n    }\n}\n\n\u002F\u002F Higher-level component that uses VpcNetwork\nclass Platform extends pulumi.ComponentResource {\n    public readonly kubeconfig: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: PlatformArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:Platform\", name, {}, opts);\n\n        \u002F\u002F Compose lower-level components\n        const network = new VpcNetwork(`${name}-network`, {\n            cidrBlock: args.cidrBlock,\n        }, { parent: this });\n\n        const cluster = new aws.eks.Cluster(`${name}-cluster`, {\n            vpcConfig: {\n                subnetIds: network.privateSubnetIds,\n            },\n        }, { parent: this });\n\n        this.kubeconfig = cluster.kubeconfig;\n        this.registerOutputs({ kubeconfig: this.kubeconfig });\n    }\n}\n```\n\n### Provider Passthrough\n\nAccept explicit providers for multi-region or multi-account deployments. `ComponentResourceOptions` carries provider configuration to children automatically:\n\n```typescript\n\u002F\u002F Consumer passes a provider for a different region\nconst usWest = new aws.Provider(\"us-west\", { region: \"us-west-2\" });\nconst site = new StaticSite(\"west-site\", { indexDocument: \"index.html\" }, {\n    providers: [usWest],\n});\n```\n\nChildren with `{ parent: this }` automatically inherit the provider. No extra code is needed inside the component.\n\n---\n\n## Multi-Language Components\n\nIf your component will be consumed from multiple Pulumi languages (TypeScript, Python, Go, C#, Java, YAML), package it as a multi-language component.\n\n### Do You Need Multi-Language?\n\nAsk: \"Will anyone consume this component from a different language than it was authored in?\"\n\n**Single-language component** (no packaging needed):\n\n- Your team uses one language and the component stays within that codebase\n- The component is internal to a single project or monorepo\n- No `PulumiPlugin.yaml` needed -- just import the class directly\n\n**Multi-language component** (packaging required):\n\n- Other teams consume your component in different languages\n- Platform teams building abstractions for developers who choose their own language\n- YAML consumers need access -- even if you author in TypeScript, YAML programs require multi-language packaging to use your component\n- Building a shared component library for your organization\n- Publishing to the Pulumi private registry or public registry is a common reason, but not required for multi-language support\n\n**Common mistake**: A TypeScript platform team builds components only their TypeScript users can consume. If application developers use Python or YAML, those components are invisible to them without multi-language packaging.\n\n### Setup\n\nCreate a `PulumiPlugin.yaml` in the component directory to declare the runtime:\n\n```yaml\nruntime: nodejs\n```\n\nOr for Python:\n\n```yaml\nruntime: python\n```\n\n### Serialization Constraints\n\nFor multi-language compatibility, args must be serializable. These constraints apply regardless of the authoring language:\n\n| Allowed | Not Allowed |\n|---------|-------------|\n| `string`, `number`, `boolean` | Union types (`string \\| number`) |\n| `Input\u003CT>` wrappers | Functions and callbacks |\n| Arrays and maps of primitives | Complex nested generics |\n| Enums | Platform-specific types |\n\n### Consuming Multi-Language Components\n\nConsumers install the component with `pulumi package add`, which automatically downloads the provider plugin, generates a local SDK in the consumer's language, and updates `Pulumi.yaml`:\n\n```bash\n# From a Git repository\npulumi package add \u003Cgit-repo-url>\n\n# From a specific version tag\npulumi package add \u003Cgit-repo-url>@v1.0.0\n```\n\nFor fresh checkouts or CI environments, run `pulumi install` to ensure all package dependencies are available. The consumer does not need to manually generate SDKs.\n\nAuthors who publish SDKs to package managers (npm, PyPI, etc.) can optionally use `pulumi package gen-sdk` to generate language-specific SDKs for publishing. Most component authors do not need this -- `pulumi package add` handles SDK generation on the consumer side.\n\n### Entry Points\n\nPublished multi-language components require an entry point that hosts the component provider process. The entry point pattern differs by language.\n\n**TypeScript** (`runtime: nodejs`):\n\nExport component classes from `index.ts`. No separate entry point file is needed. Pulumi introspects exported classes automatically.\n\n```typescript\n\u002F\u002F index.ts -- exports are the entry point\nexport { StaticSite, StaticSiteArgs } from \".\u002FstaticSite\";\nexport { SecureBucket, SecureBucketArgs } from \".\u002FsecureBucket\";\n```\n\n**Python** (`runtime: python`):\n\nCreate a `__main__.py` that calls `component_provider_host` with all component classes:\n\n```python\nfrom pulumi.provider.experimental import component_provider_host\nfrom static_site import StaticSite\nfrom secure_bucket import SecureBucket\n\nif __name__ == \"__main__\":\n    component_provider_host(\n        name=\"my-components\",\n        components=[StaticSite, SecureBucket],\n    )\n```\n\n**Go** (`runtime: go`):\n\nCreate a `main.go` that builds and runs the provider:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com\u002Fpulumi\u002Fpulumi-go-provider\u002Finfer\"\n)\n\nfunc main() {\n    p, err := infer.NewProviderBuilder().\n        WithComponents(\n            infer.ComponentF(NewStaticSite),\n            infer.ComponentF(NewSecureBucket),\n        ).\n        Build()\n    if err != nil {\n        fmt.Fprintln(os.Stderr, err)\n        os.Exit(1)\n    }\n    if err := p.Run(context.Background(), \"my-components\", \"0.1.0\"); err != nil {\n        fmt.Fprintln(os.Stderr, err)\n        os.Exit(1)\n    }\n}\n```\n\n**C#** (`runtime: dotnet`):\n\nCreate a `Program.cs` that serves the component provider host:\n\n```csharp\nusing System.Threading.Tasks;\n\nclass Program\n{\n    public static Task Main(string[] args) =>\n        Pulumi.Experimental.Provider.ComponentProviderHost.Serve(args);\n}\n```\n\nFor a complete working example across all languages, see https:\u002F\u002Fgithub.com\u002Fmikhailshilkov\u002Fcomp-as-comp.\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n\n---\n\n## Distribution\n\nChoose a distribution method based on your audience:\n\n| Audience | Method | How |\n|----------|--------|-----|\n| Same project | Direct import | Standard language import |\n| Same organization | Private registry | `pulumi package publish` to Pulumi Cloud |\n| Same organization | Git repository | `pulumi package add \u003Crepo>` with version tags |\n| Language ecosystem | Package manager | Publish to npm, PyPI, NuGet, or Maven |\n| Public community | Pulumi Registry | Submit via pulumi\u002Fregistry GitHub repo |\n\n### Pulumi Private Registry\n\nThe private registry is the centralized catalog for your organization's components. It provides automatic API documentation, version management, and discoverability for all teams.\n\nPublish a component to the private registry:\n\n```bash\npulumi package publish https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmy-component --publisher myorg\n```\n\nVersion components using git tags with a `v` prefix:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nA README file is required when publishing. Pulumi uses it as the component's documentation page in the registry.\n\nAutomate publishing from GitHub Actions using OIDC authentication:\n\n```yaml\nname: Publish Component\non:\n  push:\n    tags:\n      - \"v*\"\n\npermissions:\n  id-token: write\n  contents: read\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    env:\n      PULUMI_ORG: myorg\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n      - uses: pulumi\u002Fauth-actions@v1\n        with:\n          organization: ${{ env.PULUMI_ORG }}\n          requested-token-type: urn:pulumi:token-type:access_token:organization\n      - run: pulumi package publish https:\u002F\u002Fgithub.com\u002F${{ github.repository }} --publisher ${{ env.PULUMI_ORG }}\n```\n\n**Prerequisites**: Configure GitHub OIDC integration with Pulumi Cloud before using this workflow.\n\nThe registry supports private GitHub and GitLab repositories. For non-OIDC setups, authenticate with `GITHUB_TOKEN` or `GITLAB_TOKEN` environment variables.\n\nThe private registry automatically generates SDK documentation for each published component. Enrich the generated docs by adding type annotations to your component's inputs and outputs (JSDoc in TypeScript, docstrings in Python, `Annotate()` methods in Go).\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fidp\u002Fget-started\u002Fprivate-registry\u002F\n\n### Git Repository Distribution\n\nTag releases for consumers to pin versions:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nConsumers install with:\n\n```bash\npulumi package add https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmy-component@v1.0.0\n```\n\n### Package Manager Distribution\n\nPublish language-specific packages for native dependency management:\n\n- **npm**: `npm publish` for TypeScript\u002FJavaScript\n- **PyPI**: `twine upload` for Python\n- **NuGet**: `dotnet nuget push` for .NET\n- **Maven Central**: Standard Maven publishing for Java\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Problem | Fix |\n|-------------|---------|-----|\n| Resources inside `apply()` | Not visible in `pulumi preview` | Move resource creation outside apply (see `pulumi-best-practices` practice 1) |\n| Missing `registerOutputs()` | Component stuck \"creating\" | Always call as last line of constructor |\n| Missing `parent: this` | Children appear at root level | Pass `{ parent: this }` to all child resources |\n| Union types in args | Breaks Python, Go, C# SDKs | Use single types; separate properties for variants |\n| Functions in args | Cannot serialize across languages | Use configuration properties instead |\n| Hardcoded child names | Collisions with multiple instances | Derive names from `${name}-suffix` |\n| Over-exposed outputs | Leaks implementation details | Export only what consumers need |\n| Single-use component | Unnecessary abstraction overhead | Use inline resources until a pattern repeats |\n| Deeply nested args | Hard to use and evolve | Keep interfaces flat with optional properties |\n\n---\n\n## Quick Reference\n\n| Topic | Key Point |\n|-------|-----------|\n| Type URN | `\u003Cpackage>:\u003Cmodule>:\u003Ctype>`, module usually `index` |\n| Constructor | `super(type, name, {}, opts)` then children then `registerOutputs()` |\n| Child resources | Always `{ parent: this }`, derive name from `${name}-suffix` |\n| Args interface | Wrap in `Input\u003CT>`, no unions, no functions, flat structure |\n| Outputs | Public readonly `Output\u003CT>` properties, expose only essentials |\n| Defaults | Use `??` operator to apply sensible defaults in constructor |\n| Composition | Lower-level components composed into higher-level ones |\n| Multi-language | `PulumiPlugin.yaml` + entry point; consumers use `pulumi package add` |\n| Distribution | Private registry, git tags, package managers, or public Pulumi Registry |\n\n## Related Skills\n\n- **pulumi**: General Pulumi patterns including Output handling, secrets, and aliases\n- **pulumi-automation-api**: Programmatic orchestration for integration testing and multi-stack workflows\n- **pulumi-esc**: Centralized secrets and configuration for component deployments\n\n## References\n\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Fresources\u002Fcomponents\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fidp\u002Fget-started\u002Fprivate-registry\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Finputs-outputs\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Fresources\u002Foptions\u002Faliases\u002F\n\n## Attribution\n\nBased on [pulumi\u002Fagent-skills](https:\u002F\u002Fgithub.com\u002Fpulumi\u002Fagent-skills).\n","# Authoring Pulumi Components\n\nA ComponentResource groups related infrastructure resources into a reusable, logical unit. Components make infrastructure easier to understand, reuse, and maintain. Components appear as a single node with children nested underneath in `pulumi preview`\u002F`pulumi up` output and in the Pulumi Cloud console.\n\nThis skill covers the full component authoring lifecycle. For general Pulumi coding patterns (Output handling, secrets, aliases, preview workflows), use the `pulumi-best-practices` skill instead.\n\n## When to Use This Skill\n\nInvoke this skill when:\n\n- Creating a new ComponentResource class\n- Designing the args interface for a component\n- Making a component consumable from multiple Pulumi languages\n- Publishing or distributing a component package\n- Refactoring inline resources into a reusable component\n- Debugging component behavior (missing outputs, stuck creating, children at wrong level)\n\n## Component Anatomy\n\nEvery component has four required elements:\n\n1. **Extend ComponentResource** and call `super()` with a type URN\n2. **Accept standard parameters**: name, args, and `ComponentResourceOptions`\n3. **Set `parent: this`** on all child resources\n4. **Call `registerOutputs()`** at the end of the constructor\n\n### TypeScript\n\n```typescript\nimport * as pulumi from \"@pulumi\u002Fpulumi\";\nimport * as aws from \"@pulumi\u002Faws\";\n\ninterface StaticSiteArgs {\n    indexDocument?: pulumi.Input\u003Cstring>;\n    errorDocument?: pulumi.Input\u003Cstring>;\n}\n\nclass StaticSite extends pulumi.ComponentResource {\n    public readonly bucketName: pulumi.Output\u003Cstring>;\n    public readonly websiteUrl: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: StaticSiteArgs, opts?: pulumi.ComponentResourceOptions) {\n        \u002F\u002F 1. Call super with type URN: \u003Cpackage>:\u003Cmodule>:\u003Ctype>\n        super(\"myorg:index:StaticSite\", name, {}, opts);\n\n        \u002F\u002F 2. Create child resources with parent: this\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n\n        const website = new aws.s3.BucketWebsiteConfigurationV2(`${name}-website`, {\n            bucket: bucket.id,\n            indexDocument: { suffix: args.indexDocument ?? \"index.html\" },\n            errorDocument: { key: args.errorDocument ?? \"error.html\" },\n        }, { parent: this });\n\n        \u002F\u002F 3. Expose outputs as class properties\n        this.bucketName = bucket.id;\n        this.websiteUrl = website.websiteEndpoint;\n\n        \u002F\u002F 4. Register outputs -- always the last line\n        this.registerOutputs({\n            bucketName: this.bucketName,\n            websiteUrl: this.websiteUrl,\n        });\n    }\n}\n\n\u002F\u002F Usage\nconst site = new StaticSite(\"marketing\", {\n    indexDocument: \"index.html\",\n});\nexport const url = site.websiteUrl;\n```\n\n### Python\n\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nclass StaticSiteArgs:\n    def __init__(self,\n                 index_document: pulumi.Input[str] = \"index.html\",\n                 error_document: pulumi.Input[str] = \"error.html\"):\n        self.index_document = index_document\n        self.error_document = error_document\n\nclass StaticSite(pulumi.ComponentResource):\n    bucket_name: pulumi.Output[str]\n    website_url: pulumi.Output[str]\n\n    def __init__(self, name: str, args: StaticSiteArgs,\n                 opts: pulumi.ResourceOptions = None):\n        super().__init__(\"myorg:index:StaticSite\", name, None, opts)\n\n        bucket = aws.s3.Bucket(f\"{name}-bucket\",\n            opts=pulumi.ResourceOptions(parent=self))\n\n        website = aws.s3.BucketWebsiteConfigurationV2(f\"{name}-website\",\n            bucket=bucket.id,\n            index_document=aws.s3.BucketWebsiteConfigurationV2IndexDocumentArgs(\n                suffix=args.index_document,\n            ),\n            error_document=aws.s3.BucketWebsiteConfigurationV2ErrorDocumentArgs(\n                key=args.error_document,\n            ),\n            opts=pulumi.ResourceOptions(parent=self))\n\n        self.bucket_name = bucket.id\n        self.website_url = website.website_endpoint\n\n        self.register_outputs({\n            \"bucket_name\": self.bucket_name,\n            \"website_url\": self.website_url,\n        })\n\nsite = StaticSite(\"marketing\", StaticSiteArgs())\npulumi.export(\"url\", site.website_url)\n```\n\n### Type URN Format\n\nThe first argument to `super()` is the type URN: `\u003Cpackage>:\u003Cmodule>:\u003Ctype>`.\n\n| Segment | Convention | Example |\n|---------|-----------|---------|\n| package | Organization or package name | `myorg`, `acme`, `pkg` |\n| module  | Usually `index` | `index` |\n| type    | PascalCase class name | `StaticSite`, `VpcNetwork` |\n\nFull examples: `myorg:index:StaticSite`, `acme:index:KubernetesCluster`\n\n### registerOutputs Is Required\n\n**Why**: Without `registerOutputs()`, the component appears stuck in a \"creating\" state in the Pulumi console and outputs are not persisted to state.\n\n**Wrong**:\n\n```typescript\nclass MyComponent extends pulumi.ComponentResource {\n    public readonly url: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: MyArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:MyComponent\", name, {}, opts);\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n        this.url = bucket.bucketRegionalDomainName;\n        \u002F\u002F Missing registerOutputs -- component stuck \"creating\"\n    }\n}\n```\n\n**Right**:\n\n```typescript\nclass MyComponent extends pulumi.ComponentResource {\n    public readonly url: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: MyArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:MyComponent\", name, {}, opts);\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n        this.url = bucket.bucketRegionalDomainName;\n\n        this.registerOutputs({ url: this.url });\n    }\n}\n```\n\n### Derive Child Names from the Component Name\n\n**Why**: Hardcoded child names cause collisions when the component is instantiated multiple times.\n\n**Wrong**:\n\n```typescript\n\u002F\u002F Collides if two instances of this component exist\nconst bucket = new aws.s3.Bucket(\"my-bucket\", {}, { parent: this });\n```\n\n**Right**:\n\n```typescript\n\u002F\u002F Unique per component instance\nconst bucket = new aws.s3.Bucket(`${name}-bucket`, {}, { parent: this });\n```\n\n---\n\n## Designing the Args Interface\n\nThe args interface is the most impactful design decision. It defines what consumers can configure and how composable the component is.\n\n### Wrap Properties in Input\u003CT>\n\n**Why**: `Input\u003CT>` accepts both plain values and `Output\u003CT>` from other resources. Without it, consumers must unwrap outputs manually with `.apply()`.\n\n**Wrong**:\n\n```typescript\ninterface WebServiceArgs {\n    port: number;            \u002F\u002F Forces consumers to unwrap Outputs\n    vpcId: string;           \u002F\u002F Cannot accept vpc.id directly\n}\n```\n\n**Right**:\n\n```typescript\ninterface WebServiceArgs {\n    port: pulumi.Input\u003Cnumber>;     \u002F\u002F Accepts 8080 or someOutput\n    vpcId: pulumi.Input\u003Cstring>;    \u002F\u002F Accepts \"vpc-123\" or vpc.id\n}\n```\n\n### Keep Structures Flat\n\nAvoid deeply nested arg objects. Flat interfaces are easier to use and evolve.\n\n```typescript\n\u002F\u002F Prefer flat\ninterface DatabaseArgs {\n    instanceClass: pulumi.Input\u003Cstring>;\n    storageGb: pulumi.Input\u003Cnumber>;\n    enableBackups?: pulumi.Input\u003Cboolean>;\n    backupRetentionDays?: pulumi.Input\u003Cnumber>;\n}\n\n\u002F\u002F Avoid deep nesting\ninterface DatabaseArgs {\n    instance: {\n        compute: { class: pulumi.Input\u003Cstring> };\n        storage: { sizeGb: pulumi.Input\u003Cnumber> };\n    };\n    backup: {\n        config: { enabled: pulumi.Input\u003Cboolean>; retention: pulumi.Input\u003Cnumber> };\n    };\n}\n```\n\n### No Union Types\n\nUnion types break multi-language SDK generation. Python, Go, and C# cannot represent `string | number`.\n\n**Wrong**:\n\n```typescript\ninterface MyArgs {\n    port: pulumi.Input\u003Cstring | number>;  \u002F\u002F Fails in Python, Go, C#\n}\n```\n\n**Right**:\n\n```typescript\ninterface MyArgs {\n    port: pulumi.Input\u003Cnumber>;  \u002F\u002F Single type, works everywhere\n}\n```\n\nIf you need to accept multiple forms, use separate optional properties:\n\n```typescript\ninterface StorageArgs {\n    sizeGb?: pulumi.Input\u003Cnumber>;      \u002F\u002F Specify size in GB\n    sizeMb?: pulumi.Input\u003Cnumber>;      \u002F\u002F Or specify size in MB\n}\n```\n\n### No Functions or Callbacks\n\nFunctions cannot be serialized across language boundaries.\n\n**Wrong**:\n\n```typescript\ninterface MyArgs {\n    nameTransform: (name: string) => string;  \u002F\u002F Cannot serialize\n}\n```\n\n**Right**:\n\n```typescript\ninterface MyArgs {\n    namePrefix?: pulumi.Input\u003Cstring>;   \u002F\u002F Configuration instead of callback\n    nameSuffix?: pulumi.Input\u003Cstring>;\n}\n```\n\n### Use Defaults for Optional Properties\n\nSet sensible defaults inside the constructor so consumers only configure what they need:\n\n```typescript\ninterface SecureBucketArgs {\n    enableVersioning?: pulumi.Input\u003Cboolean>;   \u002F\u002F Defaults to true\n    enableEncryption?: pulumi.Input\u003Cboolean>;   \u002F\u002F Defaults to true\n    blockPublicAccess?: pulumi.Input\u003Cboolean>;  \u002F\u002F Defaults to true\n}\n\nclass SecureBucket extends pulumi.ComponentResource {\n    constructor(name: string, args: SecureBucketArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:SecureBucket\", name, {}, opts);\n\n        const enableVersioning = args.enableVersioning ?? true;\n        const enableEncryption = args.enableEncryption ?? true;\n        const blockPublicAccess = args.blockPublicAccess ?? true;\n\n        \u002F\u002F Apply defaults...\n    }\n}\n\n\u002F\u002F Consumer only overrides what they need\nconst bucket = new SecureBucket(\"data\", { enableVersioning: false });\n```\n\n---\n\n## Exposing Outputs\n\n### Expose Only What Consumers Need\n\nComponents often create many internal resources. Expose only the values consumers need, not every internal resource.\n\n**Wrong**:\n\n```typescript\nclass Database extends pulumi.ComponentResource {\n    \u002F\u002F Exposes everything -- consumers see implementation details\n    public readonly cluster: aws.rds.Cluster;\n    public readonly primaryInstance: aws.rds.ClusterInstance;\n    public readonly replicaInstance: aws.rds.ClusterInstance;\n    public readonly subnetGroup: aws.rds.SubnetGroup;\n    public readonly securityGroup: aws.ec2.SecurityGroup;\n    public readonly parameterGroup: aws.rds.ClusterParameterGroup;\n    \u002F\u002F ...\n}\n```\n\n**Right**:\n\n```typescript\nclass Database extends pulumi.ComponentResource {\n    \u002F\u002F Exposes only what consumers need\n    public readonly endpoint: pulumi.Output\u003Cstring>;\n    public readonly port: pulumi.Output\u003Cnumber>;\n    public readonly securityGroupId: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: DatabaseArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:Database\", name, {}, opts);\n\n        const sg = new aws.ec2.SecurityGroup(`${name}-sg`, { \u002F* ... *\u002F }, { parent: this });\n        const cluster = new aws.rds.Cluster(`${name}-cluster`, { \u002F* ... *\u002F }, { parent: this });\n\n        this.endpoint = cluster.endpoint;\n        this.port = cluster.port;\n        this.securityGroupId = sg.id;\n\n        this.registerOutputs({\n            endpoint: this.endpoint,\n            port: this.port,\n            securityGroupId: this.securityGroupId,\n        });\n    }\n}\n```\n\n### Derive Composite Outputs\n\nUse `pulumi.interpolate` or `pulumi.concat` to build derived values:\n\n```typescript\nthis.connectionString = pulumi.interpolate`postgresql:\u002F\u002F${args.username}:${args.password}@${cluster.endpoint}:${cluster.port}\u002F${args.databaseName}`;\n\nthis.registerOutputs({ connectionString: this.connectionString });\n```\n\n---\n\n## Component Design Patterns\n\n### Sensible Defaults with Override\n\nEncode best practices as defaults. Allow consumers to override when they have specific requirements.\n\n```typescript\ninterface SecureBucketArgs {\n    enableVersioning?: pulumi.Input\u003Cboolean>;\n    enableEncryption?: pulumi.Input\u003Cboolean>;\n    blockPublicAccess?: pulumi.Input\u003Cboolean>;\n    tags?: pulumi.Input\u003CRecord\u003Cstring, pulumi.Input\u003Cstring>>>;\n}\n\nclass SecureBucket extends pulumi.ComponentResource {\n    public readonly bucketId: pulumi.Output\u003Cstring>;\n    public readonly arn: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: SecureBucketArgs = {}, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:SecureBucket\", name, {}, opts);\n\n        const bucket = new aws.s3.Bucket(`${name}-bucket`, {\n            tags: args.tags,\n        }, { parent: this });\n\n        \u002F\u002F Versioning on by default\n        if (args.enableVersioning !== false) {\n            new aws.s3.BucketVersioningV2(`${name}-versioning`, {\n                bucket: bucket.id,\n                versioningConfiguration: { status: \"Enabled\" },\n            }, { parent: this });\n        }\n\n        \u002F\u002F Encryption on by default\n        if (args.enableEncryption !== false) {\n            new aws.s3.BucketServerSideEncryptionConfigurationV2(`${name}-encryption`, {\n                bucket: bucket.id,\n                rules: [{ applyServerSideEncryptionByDefault: { sseAlgorithm: \"AES256\" } }],\n            }, { parent: this });\n        }\n\n        \u002F\u002F Public access blocked by default\n        if (args.blockPublicAccess !== false) {\n            new aws.s3.BucketPublicAccessBlock(`${name}-public-access`, {\n                bucket: bucket.id,\n                blockPublicAcls: true,\n                blockPublicPolicy: true,\n                ignorePublicAcls: true,\n                restrictPublicBuckets: true,\n            }, { parent: this });\n        }\n\n        this.bucketId = bucket.id;\n        this.arn = bucket.arn;\n        this.registerOutputs({ bucketId: this.bucketId, arn: this.arn });\n    }\n}\n```\n\n### Conditional Resource Creation\n\nUse optional args to gate creation of sub-resources:\n\n```typescript\ninterface WebServiceArgs {\n    image: pulumi.Input\u003Cstring>;\n    port: pulumi.Input\u003Cnumber>;\n    enableMonitoring?: pulumi.Input\u003Cboolean>;\n    alarmEmail?: pulumi.Input\u003Cstring>;\n}\n\nclass WebService extends pulumi.ComponentResource {\n    constructor(name: string, args: WebServiceArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:WebService\", name, {}, opts);\n\n        const service = new aws.ecs.Service(`${name}-service`, {\n            \u002F\u002F ...service config...\n        }, { parent: this });\n\n        \u002F\u002F Only create alarm infrastructure when monitoring is enabled\n        if (args.enableMonitoring) {\n            const topic = new aws.sns.Topic(`${name}-alerts`, {}, { parent: this });\n\n            if (args.alarmEmail) {\n                new aws.sns.TopicSubscription(`${name}-alert-email`, {\n                    topic: topic.arn,\n                    protocol: \"email\",\n                    endpoint: args.alarmEmail,\n                }, { parent: this });\n            }\n\n            new aws.cloudwatch.MetricAlarm(`${name}-cpu-alarm`, {\n                \u002F\u002F ...alarm config referencing service...\n                alarmActions: [topic.arn],\n            }, { parent: this });\n        }\n\n        this.registerOutputs({});\n    }\n}\n```\n\n### Composition\n\nBuild higher-level components from lower-level ones. Each level manages a single concern.\n\n```typescript\n\u002F\u002F Lower-level component\nclass VpcNetwork extends pulumi.ComponentResource {\n    public readonly vpcId: pulumi.Output\u003Cstring>;\n    public readonly publicSubnetIds: pulumi.Output\u003Cstring>[];\n    public readonly privateSubnetIds: pulumi.Output\u003Cstring>[];\n\n    constructor(name: string, args: VpcNetworkArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:VpcNetwork\", name, {}, opts);\n        \u002F\u002F ...create VPC, subnets, route tables...\n        this.registerOutputs({ vpcId: this.vpcId });\n    }\n}\n\n\u002F\u002F Higher-level component that uses VpcNetwork\nclass Platform extends pulumi.ComponentResource {\n    public readonly kubeconfig: pulumi.Output\u003Cstring>;\n\n    constructor(name: string, args: PlatformArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"myorg:index:Platform\", name, {}, opts);\n\n        \u002F\u002F Compose lower-level components\n        const network = new VpcNetwork(`${name}-network`, {\n            cidrBlock: args.cidrBlock,\n        }, { parent: this });\n\n        const cluster = new aws.eks.Cluster(`${name}-cluster`, {\n            vpcConfig: {\n                subnetIds: network.privateSubnetIds,\n            },\n        }, { parent: this });\n\n        this.kubeconfig = cluster.kubeconfig;\n        this.registerOutputs({ kubeconfig: this.kubeconfig });\n    }\n}\n```\n\n### Provider Passthrough\n\nAccept explicit providers for multi-region or multi-account deployments. `ComponentResourceOptions` carries provider configuration to children automatically:\n\n```typescript\n\u002F\u002F Consumer passes a provider for a different region\nconst usWest = new aws.Provider(\"us-west\", { region: \"us-west-2\" });\nconst site = new StaticSite(\"west-site\", { indexDocument: \"index.html\" }, {\n    providers: [usWest],\n});\n```\n\nChildren with `{ parent: this }` automatically inherit the provider. No extra code is needed inside the component.\n\n---\n\n## Multi-Language Components\n\nIf your component will be consumed from multiple Pulumi languages (TypeScript, Python, Go, C#, Java, YAML), package it as a multi-language component.\n\n### Do You Need Multi-Language?\n\nAsk: \"Will anyone consume this component from a different language than it was authored in?\"\n\n**Single-language component** (no packaging needed):\n\n- Your team uses one language and the component stays within that codebase\n- The component is internal to a single project or monorepo\n- No `PulumiPlugin.yaml` needed -- just import the class directly\n\n**Multi-language component** (packaging required):\n\n- Other teams consume your component in different languages\n- Platform teams building abstractions for developers who choose their own language\n- YAML consumers need access -- even if you author in TypeScript, YAML programs require multi-language packaging to use your component\n- Building a shared component library for your organization\n- Publishing to the Pulumi private registry or public registry is a common reason, but not required for multi-language support\n\n**Common mistake**: A TypeScript platform team builds components only their TypeScript users can consume. If application developers use Python or YAML, those components are invisible to them without multi-language packaging.\n\n### Setup\n\nCreate a `PulumiPlugin.yaml` in the component directory to declare the runtime:\n\n```yaml\nruntime: nodejs\n```\n\nOr for Python:\n\n```yaml\nruntime: python\n```\n\n### Serialization Constraints\n\nFor multi-language compatibility, args must be serializable. These constraints apply regardless of the authoring language:\n\n| Allowed | Not Allowed |\n|---------|-------------|\n| `string`, `number`, `boolean` | Union types (`string \\| number`) |\n| `Input\u003CT>` wrappers | Functions and callbacks |\n| Arrays and maps of primitives | Complex nested generics |\n| Enums | Platform-specific types |\n\n### Consuming Multi-Language Components\n\nConsumers install the component with `pulumi package add`, which automatically downloads the provider plugin, generates a local SDK in the consumer's language, and updates `Pulumi.yaml`:\n\n```bash\n# From a Git repository\npulumi package add \u003Cgit-repo-url>\n\n# From a specific version tag\npulumi package add \u003Cgit-repo-url>@v1.0.0\n```\n\nFor fresh checkouts or CI environments, run `pulumi install` to ensure all package dependencies are available. The consumer does not need to manually generate SDKs.\n\nAuthors who publish SDKs to package managers (npm, PyPI, etc.) can optionally use `pulumi package gen-sdk` to generate language-specific SDKs for publishing. Most component authors do not need this -- `pulumi package add` handles SDK generation on the consumer side.\n\n### Entry Points\n\nPublished multi-language components require an entry point that hosts the component provider process. The entry point pattern differs by language.\n\n**TypeScript** (`runtime: nodejs`):\n\nExport component classes from `index.ts`. No separate entry point file is needed. Pulumi introspects exported classes automatically.\n\n```typescript\n\u002F\u002F index.ts -- exports are the entry point\nexport { StaticSite, StaticSiteArgs } from \".\u002FstaticSite\";\nexport { SecureBucket, SecureBucketArgs } from \".\u002FsecureBucket\";\n```\n\n**Python** (`runtime: python`):\n\nCreate a `__main__.py` that calls `component_provider_host` with all component classes:\n\n```python\nfrom pulumi.provider.experimental import component_provider_host\nfrom static_site import StaticSite\nfrom secure_bucket import SecureBucket\n\nif __name__ == \"__main__\":\n    component_provider_host(\n        name=\"my-components\",\n        components=[StaticSite, SecureBucket],\n    )\n```\n\n**Go** (`runtime: go`):\n\nCreate a `main.go` that builds and runs the provider:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com\u002Fpulumi\u002Fpulumi-go-provider\u002Finfer\"\n)\n\nfunc main() {\n    p, err := infer.NewProviderBuilder().\n        WithComponents(\n            infer.ComponentF(NewStaticSite),\n            infer.ComponentF(NewSecureBucket),\n        ).\n        Build()\n    if err != nil {\n        fmt.Fprintln(os.Stderr, err)\n        os.Exit(1)\n    }\n    if err := p.Run(context.Background(), \"my-components\", \"0.1.0\"); err != nil {\n        fmt.Fprintln(os.Stderr, err)\n        os.Exit(1)\n    }\n}\n```\n\n**C#** (`runtime: dotnet`):\n\nCreate a `Program.cs` that serves the component provider host:\n\n```csharp\nusing System.Threading.Tasks;\n\nclass Program\n{\n    public static Task Main(string[] args) =>\n        Pulumi.Experimental.Provider.ComponentProviderHost.Serve(args);\n}\n```\n\nFor a complete working example across all languages, see https:\u002F\u002Fgithub.com\u002Fmikhailshilkov\u002Fcomp-as-comp.\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n\n---\n\n## Distribution\n\nChoose a distribution method based on your audience:\n\n| Audience | Method | How |\n|----------|--------|-----|\n| Same project | Direct import | Standard language import |\n| Same organization | Private registry | `pulumi package publish` to Pulumi Cloud |\n| Same organization | Git repository | `pulumi package add \u003Crepo>` with version tags |\n| Language ecosystem | Package manager | Publish to npm, PyPI, NuGet, or Maven |\n| Public community | Pulumi Registry | Submit via pulumi\u002Fregistry GitHub repo |\n\n### Pulumi Private Registry\n\nThe private registry is the centralized catalog for your organization's components. It provides automatic API documentation, version management, and discoverability for all teams.\n\nPublish a component to the private registry:\n\n```bash\npulumi package publish https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmy-component --publisher myorg\n```\n\nVersion components using git tags with a `v` prefix:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nA README file is required when publishing. Pulumi uses it as the component's documentation page in the registry.\n\nAutomate publishing from GitHub Actions using OIDC authentication:\n\n```yaml\nname: Publish Component\non:\n  push:\n    tags:\n      - \"v*\"\n\npermissions:\n  id-token: write\n  contents: read\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    env:\n      PULUMI_ORG: myorg\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n      - uses: pulumi\u002Fauth-actions@v1\n        with:\n          organization: ${{ env.PULUMI_ORG }}\n          requested-token-type: urn:pulumi:token-type:access_token:organization\n      - run: pulumi package publish https:\u002F\u002Fgithub.com\u002F${{ github.repository }} --publisher ${{ env.PULUMI_ORG }}\n```\n\n**Prerequisites**: Configure GitHub OIDC integration with Pulumi Cloud before using this workflow.\n\nThe registry supports private GitHub and GitLab repositories. For non-OIDC setups, authenticate with `GITHUB_TOKEN` or `GITLAB_TOKEN` environment variables.\n\nThe private registry automatically generates SDK documentation for each published component. Enrich the generated docs by adding type annotations to your component's inputs and outputs (JSDoc in TypeScript, docstrings in Python, `Annotate()` methods in Go).\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fidp\u002Fget-started\u002Fprivate-registry\u002F\n\n### Git Repository Distribution\n\nTag releases for consumers to pin versions:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nConsumers install with:\n\n```bash\npulumi package add https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmy-component@v1.0.0\n```\n\n### Package Manager Distribution\n\nPublish language-specific packages for native dependency management:\n\n- **npm**: `npm publish` for TypeScript\u002FJavaScript\n- **PyPI**: `twine upload` for Python\n- **NuGet**: `dotnet nuget push` for .NET\n- **Maven Central**: Standard Maven publishing for Java\n\n**Reference**: https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Problem | Fix |\n|-------------|---------|-----|\n| Resources inside `apply()` | Not visible in `pulumi preview` | Move resource creation outside apply (see `pulumi-best-practices` practice 1) |\n| Missing `registerOutputs()` | Component stuck \"creating\" | Always call as last line of constructor |\n| Missing `parent: this` | Children appear at root level | Pass `{ parent: this }` to all child resources |\n| Union types in args | Breaks Python, Go, C# SDKs | Use single types; separate properties for variants |\n| Functions in args | Cannot serialize across languages | Use configuration properties instead |\n| Hardcoded child names | Collisions with multiple instances | Derive names from `${name}-suffix` |\n| Over-exposed outputs | Leaks implementation details | Export only what consumers need |\n| Single-use component | Unnecessary abstraction overhead | Use inline resources until a pattern repeats |\n| Deeply nested args | Hard to use and evolve | Keep interfaces flat with optional properties |\n\n---\n\n## Quick Reference\n\n| Topic | Key Point |\n|-------|-----------|\n| Type URN | `\u003Cpackage>:\u003Cmodule>:\u003Ctype>`, module usually `index` |\n| Constructor | `super(type, name, {}, opts)` then children then `registerOutputs()` |\n| Child resources | Always `{ parent: this }`, derive name from `${name}-suffix` |\n| Args interface | Wrap in `Input\u003CT>`, no unions, no functions, flat structure |\n| Outputs | Public readonly `Output\u003CT>` properties, expose only essentials |\n| Defaults | Use `??` operator to apply sensible defaults in constructor |\n| Composition | Lower-level components composed into higher-level ones |\n| Multi-language | `PulumiPlugin.yaml` + entry point; consumers use `pulumi package add` |\n| Distribution | Private registry, git tags, package managers, or public Pulumi Registry |\n\n## Related Skills\n\n- **pulumi**: General Pulumi patterns including Output handling, secrets, and aliases\n- **pulumi-automation-api**: Programmatic orchestration for integration testing and multi-stack workflows\n- **pulumi-esc**: Centralized secrets and configuration for component deployments\n\n## References\n\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Fresources\u002Fcomponents\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fusing-pulumi\u002Fpulumi-packages\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fidp\u002Fget-started\u002Fprivate-registry\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Finputs-outputs\u002F\n- https:\u002F\u002Fwww.pulumi.com\u002Fdocs\u002Fiac\u002Fconcepts\u002Fresources\u002Foptions\u002Faliases\u002F\n\n## Attribution\n\nBased on [pulumi\u002Fagent-skills](https:\u002F\u002Fgithub.com\u002Fpulumi\u002Fagent-skills).\n",{"name":5,"metadata":41,"description":7},{"based_on":42},"pulumi\u002Fagent-skills","main","558f37431dd6df3458f8bd5e229edb6c1c254ca7","plugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fpulumi-component",0,"https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins","https:\u002F\u002Fgithub.com\u002Fjdiegosierra","https:\u002F\u002Fjdiegosierra.github.io","Site Reliability Engineer | DevOps | MLOps | Software Craftsmanship | Blockchain Expert | Embedded Software Developer","2026-04-08 06:00:05",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jdiegosierra\u002Fenterprise-agent-plugins --skill pulumi-component",{"tool":58,"command":59},"bunx","bunx skills add jdiegosierra\u002Fenterprise-agent-plugins --skill pulumi-component",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jdiegosierra\u002Fenterprise-agent-plugins --skill pulumi-component","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fpulumi-component\u002FSKILL.md",true,[],[67,88,94,100,121,144],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":36},"01M6JF56YA4GJ2G91M4655E2VF","vue","Use when building Vue 3 applications with Composition API, Nuxt 3, or Quasar. Invoke for Pinia, TypeScript, PWA, Capacitor mobile apps, Vite configuration.","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fvue\u002FSKILL.md",[],[69,23,74,75,76,77,31,78,79,80,81,82,83,84,85,86,87],"Composition","configuration","mobile","vite","capacitor","pwa","pinia","nuxt","apps","api","applications","typescript","with","claude-skills",{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":36},"01M6JF55WHCX01YN0EDC1ENBP1","update","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fupdate\u002FSKILL.md",[],[90],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":36},"01M6JF52TKMMW8CSBWWK0D60Z7","uninstall","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Funinstall\u002FSKILL.md",[],[96],{"skillNo":101,"name":85,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":36},"01M6JF4ZA6KVK7K37FYCGKZR3V","Use when working with TypeScript's advanced type system — generics, conditional types, mapped types, or full-stack type safety. Assumes ES2023+ JavaScript knowledge (see javascript for fundamentals). Invoke for type guards, utility types, tRPC integration, monorepo setup.","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Ftypescript\u002FSKILL.md",[],[85,31,87,106,86,107,108,109,110,111,23,112,113,114,115,116,117,118,119,120],"advanced","types","trpc","utility","type","type system","monorepo","system","stack","knowledge","Safety","Type Safety","integration","conditional","javascript",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":36},"01M6JF4VJD26K2THYRJGM1BK6M","testing","Use when writing tests, creating test strategies, or building automation frameworks. Invoke for unit tests, integration tests, E2E, coverage analysis, performance testing, security testing.","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Ftesting\u002FSKILL.md",[],[123,23,128,129,87,130,131,132,133,134,135,31,136,137,138,139,140,141,142,143],"writing","coverage","test strategies","unit","tests","Security Testing","strategies","frameworks","analysis","e2e","writing tests","unit tests","integration tests","test","automation","performance",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":36},"01M6JF4PEBCHAS2VP7EEW634B7","terraform","Use when working with Terraform or OpenTofu — creating modules, writing tests, setting up CI\u002FCD pipelines, reviewing configurations, debugging state issues, implementing security scanning, or making IaC architecture decisions. For Pulumi see pulumi-best-practices, for general CI\u002FCD see devops.","https:\u002F\u002Fgithub.com\u002Fjdiegosierra\u002Fenterprise-agent-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Facme-engineering\u002Fsrc\u002Fskills\u002Fterraform\u002FSKILL.md",[],[146,30,23,151,21,87,152,132,153,154,155,156,157,31,158,159,160,161,162,128],"implementing","CI\u002FCD","best-practices","general","modules","iac","scanning","ci","issues","debugging","architecture","security"]