Skip to content
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

Merged
merged 6 commits into from
Jun 14, 2022

Conversation

guineveresaenger
Copy link
Contributor

Copy link
Member

@lblackstone lblackstone left a 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

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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).
Copy link
Contributor

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
Copy link
Contributor

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_:
Copy link
Contributor

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).
Copy link
Contributor

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

Copy link
Contributor Author

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"all resources and metadata"

@guineveresaenger guineveresaenger merged commit 343f4e3 into main Jun 14, 2022
@pulumi-bot pulumi-bot deleted the real-instructions branch June 14, 2022 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants