Authoring and publishing Pulumi packages
This guide will take you step-by-step through creating and publishing a Pulumi Package. You can use this guide to create any type of Pulumi Package: a Native Provider, a provider bridged from an existing Terraform provider, or a Component. This guide assumes you’re using GitHub to host your package’s source code and GitHub Actions to publish various parts of your package.
Prerequisites
- You need to install Pulumi.
- You should be familiar with the Pulumi Resource and Component model.
- Pulumi Packages are multi-language: you can write your package once in either Go, Python, or TypeScript/JavaScript and then make it available to all Pulumi users, even if they use another language. To develop them, you need to have Git, Go, .NET, Python, and TypeScript installed on your system.
- To follow the whole guide, you need a GitHub account. However, using GitHub is not a requirement; you may still find this guide useful even if you use another system to store your source code.
Create a repository
To get started, create a repository for your Pulumi Package. We recommend hosting your Pulumi Package in a public repository on GitHub. We also recommend following the naming conventions below to help the community find the source code for your packages.
Select a template
To get started, click the link for the boilerplate repository template that you want to use, then click “Use this template” to make a copy of it.
- Author a Native Pulumi Provider for resources or components:
pulumi/pulumi-provider-boilerplate
- Bridge an existing Terraform Provider to use with Pulumi:
pulumi/pulumi-tf-provider-boilerplate
Name your provider and repository
If publishing to the Pulumi Package Registry, you will need to pick a unique name. This is normally named after the cloud provider or service the provider configures.
Your repository name should start with pulumi-
followed by the name of your provider e.g. pulumi-aws
for AWS, or pulumi-kubernetes
for the Kubernetes provider.
- If you’re bridging a terraform provider, re-use the Terraform provider’s name - replacing
terraform-provider-
withpulumi-
e.g. usepulumi-auth0
for bridgingterraform-provider-auth0
. - If you’re building a component for an existing provider, consider using the provider name followed by the component name. For example, if building an API Gateway component using the AWS provider, name your project
pulumi-aws-apigateway
.
Author your resources or components
See the instructions in your new repository’s README.md
file for specific instructions on how to author your package.
Write documentation
We recommend authoring documentation to help others in the Pulumi community use your package. In your repository, there should be a docs/
folder with a few template pages you can use that correspond to the various tabs on a package page in Pulumi Registry (like the Azure Native package). Use the guidance in the following sections to author content in these pages.
Overview, installation, & configuration
Specifically, you should author a few pages:
_index.md
, which will be shown on the Overview tab for your package. The title of this page should match the package display name and is the heading shown on the package detail page. The Overview is a great place to include a description of what your package does, a simple example, and any other details that you want prospective users of your package to know to be successful.installation-configuration.md
, which will be shown on your package’s Installation & Configuration tab. Use this page to describe how to set up your package, including authenticating to a cloud provider, and to list the configuration options that can be used with your package. The title of this page should be in the form<Package display name> Installation & Configuration
.
README.md
and _index.md
similar or the same, save for the YAML metadata/front-matter that’s in _index.md
.Package metadata
Metadata for your package is generated from the schema.json
in your repository. To make sure your package looks great in Pulumi Registry, ensure you add metadata like:
displayName
: the friendly name for your package displayed on the Registry’s browse page; this name should match the title of the_index.md
file.description
: a short description of your package; it should include the package namelogoUrl
: a web-accessible URL to a logo for your package (ideally an SVG); we recommend using the githubrawcontent.com URL for a logo stored in your package’s repository; all surrounding whitespace should be removed from the logo, and wordmarks are preferredpublisher
: your personal/company name, as you’d like it to be shown on Registrykeywords
:category/CATEGORY
: replaceCATEGORY
with one ofcloud
,database
,infrastructure
,monitoring
,network
,utility
,versioncontrol
kind/KIND
: replaceKIND
with one ofnative
,component
- Note: don’t set a kind if you’re bridging a Terraform provider
pluginDownloadURL
: a web-accessible URL that contains the compiled binary plugin associated with your package; for more information see Publish your package
${VERSION}
, ${OS}
and ${ARCH}
with their respective values if found in pluginDownloadURL
.API docs
API docs for your package are automatically generated from the schema.json
in your repository. Many Pulumi users learn to use a Pulumi Package via the API docs, since they appear automatically in many IDEs’ auto-complete and inline documentation features, like Visual Studio Code’s IntelliSense feature. Investing in API docs for your package is one of the best ways to improve its usability. Check out the pulumi-eks
schema and how it translates to Pulumi Registry for an example of great API docs.
How-to guides
You can also create how-to guides for your packages by contributing them to the pulumi/examples
repository on GitHub.
Publish your package
Once you’ve authored and tested your package locally, you can publish it to make it available to the Pulumi community. You must publish several artifacts:
- The npm, NuGet, Java, and Python SDK packages to the npm Registry, the NuGet Gallery, Maven Central and the Python Package Index
- If your package is hosted on GitHub, you may choose to use our custom Action for publishing Pulumi packages
- The Go module to your Git repository, by adding a tag, which we’ll explain in the sections below
- The binary Pulumi resource provider plugin to a binary hosting provider of your choice
- The package documentation - overview, installation & configuration, API docs, and how-to guides to Pulumi Registry
The URL used to download a plugin is derived from pluginDownloadURL
, as specified in the schema. Pulumi expects to find a plugin at
${pluginDownloadURL}/pulumi-${kind}-${name}-v${version}-${os}-${arch}.tar.gz
name
: the name field specified in the schemaversion
: the version field specified in the schemakind
: the kind specified in schema, probablyresource
os
: the target operating system (one ofdarwin
,linux
,windows
)arch
: the target system architecture (one ofamd64
,arm64
)
Pulumi packages consist of SDKs, as well as a binary to facilitate the actual task (creating cloud resources, ect.). Package
managers (npm, NuGet, Pip, GitHub) host the SDKs, but we need to know where the plugin is hosted. When a package embeds its
pluginDownloadURL
, we can automatically fetch the plugin. This means that pulumi up
just works, and there is no need to run
pulumi plugin install ${NAME} ${VERSION} --server ${pluginDownloadURL}
. If pluginDownloadURL
is not supplied, then the Pulumi
CLI assumes the plugin is hosted at get.pulumi.com
.
Support for GitHub releases
Since release 3.35.3, Pulumi understands a special form of pluginDownloadURL
to download plugins via GitHub releases
github://${github api host}/{organization}[/{repository}]
github api host
: the address of a GitHub API, forgithub.com
this isapi.github.com
organization
: the GitHub organization to userepository
: the GitHub repository to use, this defaults topulumi-${package name}
For example the Pulumiverse Astra package would specify github://api.github.com/pulumiverse
.
Support for Gitlab releases
Since release 3.56.0, Pulumi understands a special form of pluginDownloadURL
to download plugins via Gitlab releases
gitlab://${gitlab api host}/{<project_id>}
gitlab api host
: the address of a Gitlab API, for Gitlab SaaS this isgitlab.com
project_id
: the Gitlab project ID to use. The project ID can be found right below the project name on the project page.
Publish the documentation
All package documentation on Pulumi Registry is published via the pulumi/registry
repository on GitHub. To publish your package on Pulumi Registry:
- Fork and clone the
pulumi/registry
repository. - Add your package to the community package list
- Add your package’s GitHub repo slug, e.g.
"checkly/pulumi-checkly"
- Add the path to your package’s
schema.json
file from the root of your provider repository, e.g."provider/cmd/pulumi-resource-checkly/schema.json"
- Add your package’s GitHub repo slug, e.g.
- Open a pull request with the above changes and await review from a Pulumi team member.
schema.json
(or .yaml
).From there, a Pulumi employee will work with you to get your Pulumi Package published. To do so, they’ll:
- Review your pull request and trigger the automation that builds the package listing and the API docs from your schema.
- Merge upon approval of your PR
- Merge the resulting pull request in
pulumi/docs
that pulls the latest Registry content into pulumi.com and publishes it.
Congratulations
Congratulations on publishing your Pulumi Package!
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.