{"id":23448722,"url":"https://github.com/unstoppablemango/pulumi-proxmox","last_synced_at":"2025-04-10T02:36:19.468Z","repository":{"id":114026672,"uuid":"409061330","full_name":"UnstoppableMango/pulumi-proxmox","owner":"UnstoppableMango","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-02T08:09:31.000Z","size":55,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T09:19:57.339Z","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/UnstoppableMango.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":"2021-09-22T04:16:26.000Z","updated_at":"2021-09-22T04:16:30.000Z","dependencies_parsed_at":"2025-03-05T13:46:46.469Z","dependency_job_id":null,"html_url":"https://github.com/UnstoppableMango/pulumi-proxmox","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/UnstoppableMango%2Fpulumi-proxmox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnstoppableMango%2Fpulumi-proxmox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnstoppableMango%2Fpulumi-proxmox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnstoppableMango%2Fpulumi-proxmox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnstoppableMango","download_url":"https://codeload.github.com/UnstoppableMango/pulumi-proxmox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144562,"owners_count":21054948,"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-12-23T22:18:19.838Z","updated_at":"2025-04-10T02:36:19.448Z","avatar_url":"https://github.com/UnstoppableMango.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xyz Pulumi Component Provider (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\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 [nexe](https://github.com/nexe/nexe). By default, running `make install` will create the binary specific to your host environment, but you can override the binary target by passing in `make install target=\u003ctarge-string\u003e` where `target-string` is a [valid nexe target](https://github.com/nexe/nexe#target-string--object).\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 `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.15 (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, three 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-darwin-amd64.tar.gz`, `pulumi-resource-xyz-v0.0.1-windows-amd64.tar.gz`) each containing the same file: the platform-specific binary `pulumi-resource-xyz` created in the `./bin` directory after running `make install_provider`. These artifacts can be generated automatically in the `dist` directory using `make dist`.\n\nTODO explain custom server hosting in more detail.\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%2Funstoppablemango%2Fpulumi-proxmox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funstoppablemango%2Fpulumi-proxmox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funstoppablemango%2Fpulumi-proxmox/lists"}