{"id":24380577,"url":"https://github.com/cloudy-sky-software/pulumi-provider-template","last_synced_at":"2025-04-10T23:04:58.625Z","repository":{"id":235361143,"uuid":"563307038","full_name":"cloudy-sky-software/pulumi-provider-template","owner":"cloudy-sky-software","description":"Template repo for creating Pulumi providers based on pulschema and pulumi-provider-framework","archived":false,"fork":false,"pushed_at":"2025-04-09T20:48:46.000Z","size":288,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T23:04:51.010Z","etag":null,"topics":["openapi3","pulumi","pulumi-provider"],"latest_commit_sha":null,"homepage":"","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/cloudy-sky-software.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-11-08T10:44:25.000Z","updated_at":"2025-04-09T20:48:49.000Z","dependencies_parsed_at":"2024-11-20T02:26:59.168Z","dependency_job_id":"5f57b323-fed4-46ca-91d1-c51110a894da","html_url":"https://github.com/cloudy-sky-software/pulumi-provider-template","commit_stats":null,"previous_names":["cloudy-sky-software/pulumi-provider-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudy-sky-software%2Fpulumi-provider-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudy-sky-software%2Fpulumi-provider-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudy-sky-software%2Fpulumi-provider-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudy-sky-software%2Fpulumi-provider-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudy-sky-software","download_url":"https://codeload.github.com/cloudy-sky-software/pulumi-provider-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312144,"owners_count":21082638,"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":["openapi3","pulumi","pulumi-provider"],"created_at":"2025-01-19T08:27:28.050Z","updated_at":"2025-04-10T23:04:58.616Z","avatar_url":"https://github.com/cloudy-sky-software.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pulumi Provider Template For OpenAPI-based Providers\n\nThis repository is a boilerplate showing how to create a native Pulumi provider using:\n\n1. [`pulschema`](https://github.com/cloudy-sky-software/pulschema) to convert an OpenAPI spec to Pulumi schema\n2. [`pulumi-provider-framework`](https://github.com/cloudy-sky-software/pulumi-provider-framework) to make HTTP requests against the cloud provider API. It uses the metadata returned by `pulschema` as one of the outputs from\n   converting an OpenAPI spec.\n\n## Background\n\nFollow this link to see what a [Pulumi native provider is comprised of](https://github.com/cloudy-sky-software/cloud-provider-api-conformance/blob/main/pulumi.md).\n\nA Pulumi Resource Provider:\n\n- is a gRPC server which allows for the Pulumi engine to create resources in a specific cloud\n- holds the lifecycle logic for these cloud resources\n- holds a pulumi JSON schema that describes the provider\n- provides language-specific SDKs so resources can be created in whichever language you prefer\n\nWhen we speak of a \"native\" provider, we mean that all implementation is native to Pulumi, as opposed\nto [Terraform-based providers](https://github.com/pulumi/pulumi-tf-provider-boilerplate).\n\n## Authoring a Pulumi Native Provider\n\nThis boilerplate creates a working Pulumi-owned provider named `xyz`.\n\n### Prerequisites\n\nEnsure the following tools are installed and present in your `$PATH`:\n\n- [`pulumictl`](https://github.com/pulumi/pulumictl#installation)\n- [Go 1.21](https://golang.org/dl/) or 1.latest\n- [NodeJS](https://nodejs.org/en/) 18.x. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS installations.\n- [Yarn](https://yarnpkg.com/)\n- [TypeScript](https://www.typescriptlang.org/)\n- [Python](https://www.python.org/downloads/) (called as `python3`)\n- [.NET](https://dotnet.microsoft.com/download)\n\n### Creating and Initializing the Repository\n\nPulumi offers this repository as a [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for convenience. From this repository:\n\n1. Click \"Use this template\".\n1. Set the following options:\n   - Owner: `\u003cyour GH organization\u003e`\n   - Repository name: pulumi-xyz (replace \"xyz\" with the name of your provider)\n     - Providers built from Cloudy Sky Software's templates are _always_ native providers, by default.\n     - However, if there is already a TF-bridged provider with that name, you should add the suffix `-native` so that the package name in some package registries do not conflict with the other providers.\n   - Description: Pulumi provider for xyz\n   - Repository type: Public\n1. Clone the generated repository.\n\nFrom the templated repository:\n\nSearch-replace the following occurrences with the corresponding names.\n\n| Search | Replace With                                                                   |\n| ------ | ------------------------------------------------------------------------------ |\n| xyz    | Lower-cased name of the provider                                               |\n| Xyz    | Pascal-case name of the provider                                               |\n| XYZ    | Upper-cased name of the provider                                               |\n| x_y_z  | Lower snake-cased name of the provider if the provider name has multiple words |\n\n#### Build the provider and install the plugin\n\n```bash\n$ make build install\n```\n\nThis will:\n\n1. Create the SDK codegen binary and place it in a `./bin` folder (gitignored)\n2. Create the provider binary and place it in the `./bin` folder (gitignored)\n3. Generate the dotnet, Go, Node, and Python SDKs and place them in the `./sdk` folder\n4. Install the provider on your machine.\n\n#### Test against the example\n\n```bash\n$ cd examples/simple\n$ yarn link @pulumi/xyz\n$ yarn install\n$ pulumi stack init test\n$ pulumi up\n```\n\nNow that you have completed all of the above steps, you have a working provider that generates a random string for you.\n\n#### A brief repository overview\n\nYou now have:\n\n1. A `provider/` folder containing the building and implementation logic\n   1. `cmd/`\n      1. `pulumi-gen-xyz/` - generates language SDKs from the schema\n      2. `pulumi-resource-xyz/` - holds the package schema, injects the package version, and starts the gRPC server\n   2. `pkg`\n      1. `provider` - holds the gRPC methods (and for now, the sample implementation logic) required by the Pulumi engine\n      2. `version` - semver package to be consumed by build processes\n3. `sdk` - holds the generated code libraries created by `pulumi-gen-xyz/main.go`\n4. `examples` a folder of Pulumi programs to try locally and/or use in CI.\n5. A `Makefile` and this `README`.\n\n### Implementing the provider callback methods\n\nYou will find a mostly blank implementation of these in `pkg/provider/provider.go`.\nNote that these methods do not link 1:1 to the Pulumi resource provider interface\nbecause `pulumi-provider-framework` provides a convenient callback mechanism\nand handles all other responsibilities. You should use the callback methods\nto alter the HTTP request (in Pre* methods) or the response (in Post*) as\nneeded. If you don't need any customization, then you don't need to do\nanything at all. Yep! The framework handles it all.\n\n### Build Examples\n\nCreate an example program using the resources defined in your provider, and place it in the `examples/` folder.\n\nYou can now repeat the steps for [build, install, and test](#test-against-the-example).\n\n## Documentation\n\nPlease [follow this guide to add documentation to your provider](https://www.pulumi.com/docs/guides/pulumi-packages/how-to-author/#write-documentation).\n\n### Importing Existing Resources\n\nImport IDs should satisfy all ID segments in the `GET` endpoint for the resource\nyou are importing. The IDs required in the path should be separated by `/`.\nFirst, start by identifying the `GET` endpoint in the OpenAPI spec\nfor the provider.\n\nFor example, let's assume such a GET endpoint path for some resource is: `/services/{serviceId}/someResource/{someResourceId}`.\n\nThus, the `pulumi import` command to run is:\n\n```bash\n# The resource type token can be easily found by using your IDEs\n# Go To Definition functionality for the resource and looking at the type\n# property defined in the custom resource's class definition.\npulumi import {resourceTypeToken} {resourceName} /{serviceId}/{someResourceId}\n```\n\nAlternatively, you can also import using the `import` Pulumi resource option.\nRun `pulumi up` to import the resource into your stack's state. Once imported,\nyou should remove the `import` resource option.\n\n```typescript\nconst someResource = new SomeResource(\n  \"myResourceName\",\n  { //inputs for the reosurce },\n  {\n    protect: true,\n    import: `/{serviceId}/{someResourceId}`,\n  }\n);\n```\n\nRefer to the Pulumi [docs](https://www.pulumi.com/docs/iac/adopting-pulumi/import/) for importing a\nresource.\n\n## Configuring CI and releases\n\n1. Follow the instructions laid out in the [deployment templates](./deployment-templates/README-DEPLOYMENT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudy-sky-software%2Fpulumi-provider-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudy-sky-software%2Fpulumi-provider-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudy-sky-software%2Fpulumi-provider-template/lists"}