-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide step by step guide to creating a native provider #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving this! LGTM after these changes
Co-authored-by: Levi Blackstone <[email protected]>
README.md
Outdated
|
||
### Background | ||
|
||
This repository is part of the [guide for authoring and publishing a Pulumi Package](https://www.pulumi.com/docs/guides/pulumi-packages/how-to-author). | ||
|
||
Learn about the concepts behind [Pulumi Packages](https://www.pulumi.com/docs/guides/pulumi-packages/#pulumi-packages). | ||
|
||
## Creating a Pulumi Native Provider | ||
See where Resource Providers fit into [the Pulumi architecture](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/#how-pulumi-works) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we trying to say with this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A reminder of the architecture diagram may help those more visually inclined. Changing the wording to clarify.
README.md
Outdated
|
||
A 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 `provider/cmd/pulumi-resource-xyz/schema.json`. This file should be kept aligned with the resources, functions and types supported by the provider implementation. | ||
The following instructions cover providers maintained by Pulumi (denoted with a "Pulumi Official" checkmark on the Pulumi registry). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just say "this guide assumes that the provider is written for the pulumi organisation
README.md
Outdated
|
||
You need to provide the following methods _for each resource_: | ||
|
||
1. Check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it for each resource? I can't see 100s of sets of these for pulumi-aws-native
README.md
Outdated
} | ||
``` | ||
|
||
You need to provide the following methods _for each resource_: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a small line to suggest what these do will help
README.md
Outdated
## Configuring CI and releases | ||
|
||
We use [centralized CI management for our providers](https://github.com/pulumi/ci-mgmt/tree/master/native-provider-ci). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't yet do this so I don't think this is fair to say
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#41 so it doesn't fall off the radar
README.md
Outdated
|
||
Once you have a schema that describes all the resources for your provider, you will need to implement the desired gRPC methods. | ||
You will find a mostly blank implementation of these in `pkg/provider/provider.go`. | ||
Note that these methods do not necessarily link 1:1 to the Pulumi CLI commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they do not - it's not 'not necessarily'
README.md
Outdated
|
||
The [JSON schema file](https://www.pulumi.com/docs/guides/pulumi-packages/schema) is used by `pulumi-gen-xyz` to create language-specific SDKs. | ||
It is, therefore, a central requirement for any resource provider. | ||
Provider schemas can be machine-generated from an API specification, or handwritten. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to say that a schema can be generated from a combination of a 3rd party API Specification + Pulumi specific logic, or handwritten
README.md
Outdated
It is, therefore, a central requirement for any resource provider. | ||
Provider schemas can be machine-generated from an API specification, or handwritten. | ||
This repository provides the [xyz example schema](./provider/cmd/pulumi-resource-xyz/schema.json) to get you started. | ||
[The Azure Native Provider schema](https://raw.githubusercontent.com/pulumi/pulumi-azure-native/master/provider/cmd/pulumi-resource-azure-native/schema.json) provides a much larger example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a monster to create - I suggest pointing to aws-native as it's not too big to digest?
README.md
Outdated
Provider schemas can be machine-generated from an API specification, or handwritten. | ||
This repository provides the [xyz example schema](./provider/cmd/pulumi-resource-xyz/schema.json) to get you started. | ||
[The Azure Native Provider schema](https://raw.githubusercontent.com/pulumi/pulumi-azure-native/master/provider/cmd/pulumi-resource-azure-native/schema.json) provides a much larger example. | ||
Refer to the [package schema documentation](https://www.pulumi.com/docs/guides/pulumi-packages/schema/#pulumi-package-schema) for additional details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional details about?
README.md
Outdated
|
||
### Implementing the gRPC methods | ||
|
||
Once you have a schema that describes all the resources for your provider, you will need to implement the desired gRPC methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"all resources and metadata"
Resolves https://github.com/pulumi/platform-providers-team/issues/55