{"id":16880546,"url":"https://github.com/squaremo/pulumi-localprocess","last_synced_at":"2026-04-18T09:35:43.804Z","repository":{"id":66130746,"uuid":"504589424","full_name":"squaremo/pulumi-localprocess","owner":"squaremo","description":"Pulumi component for running local processes","archived":false,"fork":false,"pushed_at":"2022-06-17T15:42:42.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-25T05:25:02.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squaremo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-17T15:42:40.000Z","updated_at":"2022-06-17T15:42:45.000Z","dependencies_parsed_at":"2023-02-24T14:15:49.097Z","dependency_job_id":null,"html_url":"https://github.com/squaremo/pulumi-localprocess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"pulumi/pulumi-component-provider-ts-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fpulumi-localprocess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fpulumi-localprocess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fpulumi-localprocess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fpulumi-localprocess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squaremo","download_url":"https://codeload.github.com/squaremo/pulumi-localprocess/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244541980,"owners_count":20469246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:59:09.947Z","updated_at":"2026-04-18T09:35:38.773Z","avatar_url":"https://github.com/squaremo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pulumi Component Provider Boilerplate (TypeScript)\n\nThis repo is a boilerplate showing how to create a Pulumi component provider written in TypeScript. You can search-replace `xyz` with the name of your desired provider as a starting point for creating a component provider for your component resources.\n\n## Background\nThis repository is part of the [guide for authoring and publishing a Pulumi Package](https://www.pulumi.com/docs/guides/pulumi-packages/how-to-author).\n\nLearn about the concepts behind [Pulumi Packages](https://www.pulumi.com/docs/guides/pulumi-packages/#pulumi-packages) and, more specifically, [Pulumi Components](https://www.pulumi.com/docs/intro/concepts/resources/components/)\n\n## Sample xyz Component Provider\n\nAn example `StaticPage` [component resource](https://www.pulumi.com/docs/intro/concepts/resources/#components) is available in `provider/cmd/pulumi-resource-xyz/staticPage.ts`. This component creates a static web page hosted in an AWS S3 Bucket. There is nothing special about `StaticPage` -- it is a typical component resource written in TypeScript.\n\nThe component provider makes component resources available to other languages. The implementation is in `provider/cmd/pulumi-resource-xyz/provider.ts`. Each component resource in the provider must have an implementation in the `construct` method to create an instance of the requested component resource and return its `URN` and state (outputs). There is an initial implementation that demonstrates an implementation of `construct` for the example `StaticPage` component.\n\nA code generator is available which generates SDKs in TypeScript, Python, Go and .NET which are also checked in to the `sdk` folder. The SDKs are generated from a schema in `schema.json`. This file should be kept aligned with the component resources supported by the component provider implementation.\n\nAn example of using the `StaticPage` component in TypeScript is in `examples/simple`.\n\nNote that the provider plugin (`pulumi-resource-xyz`) must be on your `PATH` to be used by Pulumi deployments. In this case, `pulumi-resource-xyz` is a platform-specific binary that includes its Node.js dependency along with the provider code, created using [pkg](https://github.com/vercel/pkg). By default, running `make install` will create the binary specific to your host environment.\n\nAfter running `make install`, `pulumi-resource-xyz` will be available in the `./bin` directory. You can add this to your path in bash with `export PATH=$PATH:$PWD/bin`.\n\nIf creating a provider for distribution to other users, they will need the `pulumi-resource-xyz` directory on their `PATH`. See the Packaging section below for more on distributing the provider to users.\n\n## Prerequisites\n\n- Pulumi CLI\n- Node.js\n- Yarn\n- Go 1.17 (to regenerate the SDKs)\n- Python 3.6+ (to build the Python SDK)\n- .NET Core SDK (to build the .NET SDK)\n\n## Build and Test\n\n```bash\n# Build and install the provider\nmake install_provider\n\n# Regenerate SDKs\nmake generate\n\n# Ensure the pulumi-provider-xyz script is on PATH\n$ export PATH=$PATH:$PWD/bin\n\n# Test Node.js SDK\n$ make install_nodejs_sdk\n$ cd examples/simple\n$ yarn install\n$ yarn link @pulumi/xyz\n$ pulumi stack init test\n$ pulumi config set aws:region us-east-1\n$ pulumi up\n```\n\n## Naming\n\nThe `xyz` provider's plugin must be named `pulumi-resource-xyz` (in the format `pulumi-resource-\u003cprovider\u003e`).\n\nWhile the provider plugin must follow this naming convention, the SDK package naming can be customized. TODO explain.\n\n## Packaging\n\nThe provider plugin can be packaged into a tarball and hosted at a custom server URL to make it easier to distribute to users.\n\nCurrently, five tarball files are necessary for Linux, macOS, and Windows (`pulumi-resource-xyz-v0.0.1-linux-amd64.tar.gz`, `pulumi-resource-xyz-v0.0.1-linux-arm64.tar.gz` `pulumi-resource-xyz-v0.0.1-darwin-amd64.tar.gz`, `pulumi-resource-xyz-v0.0.1-darwin-arm64.tar.gz`, `pulumi-resource-xyz-v0.0.1-windows-amd64.tar.gz`) each containing the same files: the platform-specific binary `pulumi-resource-xyz`, README and LICENSE. The fill set of binaries can be automatically generated using the command `make dist`.\n\nTODO explain custom server hosting in more detail.\n\n## Configuring CI and releases\n\n1. Follow the instructions laid out in the [deployment templates](./deployment-templates/README-DEPLOYMENT.md).\n\n\n## Example component\n\nLet's look at the example `StaticPage` component resource in more detail.\n\n### Schema\n\nThe example `StaticPage` component resource is defined in `schema.json`:\n\n```json\n\"resources\": {\n    \"xyz:index:StaticPage\": {\n        \"isComponent\": true,\n        \"inputProperties\": {\n            \"indexContent\": {\n                \"type\": \"string\",\n                \"description\": \"The HTML content for index.html.\"\n            }\n        },\n        \"requiredInputs\": [\n            \"indexContent\"\n        ],\n        \"properties\": {\n            \"bucket\": {\n                \"$ref\": \"/aws/v3.30.0/schema.json#/resources/aws:s3%2Fbucket:Bucket\",\n                \"description\": \"The bucket resource.\"\n            },\n            \"websiteUrl\": {\n                \"type\": \"string\",\n                \"description\": \"The website URL.\"\n            }\n        },\n        \"required\": [\n            \"bucket\",\n            \"websiteUrl\"\n        ]\n    }\n}\n```\n\nThe component resource's type token is `xyz:index:StaticPage` in the format of `\u003cpackage\u003e:\u003cmodule\u003e:\u003ctype\u003e`. In this case, it's in the `xyz` package and `index` module. This is the same type token passed inside the implementation of `StaticPage` in `provider/cmd/pulumi-resource-xyz/staticPage.ts`, and also the same token referenced in `construct` in `provider/cmd/pulumi-resource-xyz/provider.ts`.\n\nThis component has a required `indexContent` input property typed as `string`, and two required output properties: `bucket` and `websiteUrl`. Note that `bucket` is typed as the `aws:s3/bucket:Bucket` resource from the `aws` provider (in the schema the `/` is escaped as `%2F`).\n\nSince this component returns a type from the `aws` provider, each SDK must reference the associated Pulumi `aws` SDK for the language. For the .NET, Node.js, and Python SDKs, dependencies are specified in the `language` section of the schema:\n\n```json\n\"language\": {\n    \"csharp\": {\n        \"packageReferences\": {\n            \"Pulumi\": \"2.*\",\n            \"Pulumi.Aws\": \"3.*\"\n        }\n    },\n    \"nodejs\": {\n        \"dependencies\": {\n            \"@pulumi/aws\": \"^3.30.0\"\n        },\n        \"devDependencies\": {\n            \"typescript\": \"^3.7.0\"\n        }\n    },\n    \"python\": {\n        \"requires\": {\n            \"pulumi\": \"\u003e=2.21.2,\u003c3.0.0\",\n            \"pulumi-aws\": \"\u003e=3.30.0,\u003c4.0.0\"\n        }\n    }\n}\n```\n\nFor the Go SDK, dependencies are specified in the `sdk/go.mod` file.\n\n### Implementation\n\nThe implementation of this component is in `provider/cmd/pulumi-resource-xyz/staticPage.ts` and the structure of the component's inputs and outputs aligns with what is defined in `schema.json`:\n\n```typescript\nexport interface StaticPageArgs {\n    indexContent: pulumi.Input\u003cstring\u003e;\n}\n\nexport class StaticPage extends pulumi.ComponentResource {\n    public readonly bucket: aws.s3.Bucket;\n    public readonly websiteUrl: pulumi.Output\u003cstring\u003e;\n\n    constructor(name: string, args: StaticPageArgs, opts?: pulumi.ComponentResourceOptions) {\n        super(\"xyz:index:StaticPage\", name, args, opts);\n\n        ...\n    }\n}\n```\n\nThe provider makes this component resource available in the `construct` method in `provider/cmd/pulumi-resource-xyz/provider.ts`. When `construct` is called and the `type` argument is `xyz:index:StaticPage`, we create an instance of the `StaticPage` component resource and return its `URN` and outputs as its state.\n\n\n```typescript\nasync function constructStaticPage(name: string, inputs: pulumi.Inputs,\n    options: pulumi.ComponentResourceOptions): Promise\u003cprovider.ConstructResult\u003e {\n\n    // Create the component resource.\n    const staticPage = new StaticPage(name, inputs as StaticPageArgs, options);\n\n    // Return the component resource's URN and outputs as its state.\n    return {\n        urn: staticPage.urn,\n        state: {\n            bucket: staticPage.bucket,\n            websiteUrl: staticPage.websiteUrl,\n        },\n    };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaremo%2Fpulumi-localprocess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquaremo%2Fpulumi-localprocess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaremo%2Fpulumi-localprocess/lists"}