Skip to content

Commit 0457c3e

Browse files
jkodroffclaude
andauthored
Clarify package installation and move packages page to concepts (#16702)
Moved the packages concepts page from guides to concepts directory to match its nav location. Updated package consumption documentation to emphasize pulumi install as the recommended approach for installing all dependencies, including both standard package manager dependencies and local packages. Added best practices to Terraform provider and module docs. Fixes #16699 Update package installation guidance to recommend pulumi install Rewrote the consuming packages section to emphasize pulumi install as the recommended approach for installing dependencies. Added clear guidance on when to use standard package managers versus pulumi package add, and updated related docs to mention pulumi install in best practices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 1aeee3e commit 0457c3e

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

content/docs/iac/guides/building-extending/packages/packages.md renamed to content/docs/iac/concepts/packages/packages.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ aliases:
1717
- /docs/iac/using-pulumi/pulumi-packages/
1818
- /docs/iac/concepts/packages/
1919
- /docs/iac/guides/building-extending/packages/
20+
- /docs/iac/guides/building-extending/packages/packages/
2021
---
2122

2223
Pulumi Packages are the core technology that enables Pulumi [resources](/docs/iac/concepts/resources/), [components](/docs/iac/concepts/components/), and [functions](/docs/iac/concepts/functions/) to be defined once and used in all Pulumi languages.
@@ -30,10 +31,34 @@ Pulumi packages consist of two parts that allow them to be consumed in any Pulum
3031

3132
## Consuming packages
3233

33-
How you consume a Pulumi package depends on whether it has published SDKs:
34+
There are two ways to add Pulumi packages to your program:
3435

35-
- For packages with published SDKs, you can consume the package by adding a reference to the published SDK from the package feed, e.g. `npm install`, `dotnet package add`, etc. The published SDKs contain commands to automatically download the provider code/binary.
36-
- For packages without published SDKs, called [local packages](/docs/iac/guides/building-extending/packages/local-packages/#updating-local-packages), you can consume a package via the [`pulumi package add`](/docs/iac/cli/commands/pulumi_package_add/) command, which will download the provider plugin and generate a local SDK. Generated local SDKs may be committed to version control, or they can be regenerated at any time with the [`pulumi install`](/docs/iac/cli/commands/pulumi_install/) command.
36+
- **Packages with published SDKs**: Use your language's standard package manager. Most packages in the [Pulumi Registry](/registry/) have published SDKs. Each package's Installation & Configuration page shows the specific command for your language ([example](/registry/packages/aws/installation-configuration/)).
37+
- **Local packages**: Use [`pulumi package add`](/docs/iac/cli/commands/pulumi_package_add/), which generates an SDK locally and adds a reference to `Pulumi.yaml`. This is used for components, Terraform providers, and other packages without published SDKs.
38+
39+
### Installing packages
40+
41+
To install all dependencies, use [`pulumi install`](/docs/iac/cli/commands/pulumi_install/). This is the recommended approach because it handles both standard package manager dependencies (from `package.json`, `requirements.txt`, etc.) and any local packages defined in `Pulumi.yaml` in a single command.
42+
43+
Run `pulumi install` when:
44+
45+
- Setting up a project after cloning from source control
46+
- Adding or updating packages
47+
- Ensuring all team members have the same dependencies
48+
49+
### Adding local packages
50+
51+
For packages without published SDKs, called [local packages](/docs/iac/guides/building-extending/packages/local-packages/), use the [`pulumi package add`](/docs/iac/cli/commands/pulumi_package_add/) command. This downloads the provider plugin, generates a local SDK in your language, and adds the package to your `Pulumi.yaml`:
52+
53+
```bash
54+
# Example: Add a Terraform provider
55+
pulumi package add terraform-provider hashicorp/random
56+
57+
# Example: Add a component from a git repository
58+
pulumi package add example.com/org/repo.git/path@version
59+
```
60+
61+
After adding a local package, run `pulumi install` to complete the installation.
3762

3863
Some common use cases for local packages include:
3964

@@ -45,7 +70,7 @@ In order to consume a Pulumi package, there may be additional runtime requiremen
4570

4671
- TypeScript packages require the NodeJS runtime.
4772
- Python packages require a Python interpreter.
48-
- Go packages do not require a runtime if they are compiled. If they are referenced via source (e.g. a Pulumi component published via Pulumi IDP), they require a compatible version the Go language to be installed.
73+
- Go packages do not require a runtime if they are compiled. If they are referenced via source (e.g. a Pulumi component published via Pulumi IDP), they require a compatible version of the Go language to be installed.
4974
- .NET packages do not require a runtime if they are compiled as runtime-included binaries, which is Pulumi's recommended approach. .NET packages compiled as runtime-dependent binaries require a runtime.
5075
- Java packages require a JVM runtime.
5176
- YAML packages do not have any specific runtime requirements.

content/docs/iac/get-started/terraform/terraform-modules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ output "website_url" {
921921
4. **Monitor module updates**: Keep track of module updates and breaking changes
922922
5. **Use reputable sources**: Prefer well-maintained modules from trusted sources
923923
6. **Document module usage**: Document why you chose specific modules and their configuration
924+
7. **Use `pulumi install` for setup**: When cloning a project that uses Terraform modules, run [`pulumi install`](/docs/iac/cli/commands/pulumi_install/) to install all dependencies, including local packages defined in `Pulumi.yaml`
924925

925926
## Clean up
926927

content/docs/iac/get-started/terraform/terraform-providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,5 +404,6 @@ output "availability_zones" {
404404
1. **Use native providers when available**: Prefer native Pulumi providers over Terraform providers for better performance and type safety
405405
2. **Document provider usage**: Document which Terraform providers your team uses and why
406406
3. **Monitor provider updates**: Keep track of provider updates and breaking changes
407+
4. **Use `pulumi install` for setup**: When cloning a project that uses Terraform providers, run [`pulumi install`](/docs/iac/cli/commands/pulumi_install/) to install all dependencies, including local packages defined in `Pulumi.yaml`
407408

408409
{{< get-started-stepper >}}

content/docs/iac/guides/building-extending/packages/local-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pulumi package add <provider|schema|path> [provider-parameter...] [flags]
173173

174174
For packages from Git repositories, specify a version tag or commit hash to control which version is used.
175175

176-
After regenerating the SDK, ensure you reinstall or relink the SDK in your project using your language's package manager (e.g., `npm add`, `pip install -e`, etc.).
176+
After regenerating the SDK, run [`pulumi install`](/docs/iac/cli/commands/pulumi_install/) to install all dependencies, including the updated local package.
177177

178178
## Versioning considerations
179179

0 commit comments

Comments
 (0)