Skip to content

Commit 476778f

Browse files
authored
Update package add docs (#15013)
Update the docs for installing a package with `pulumi package add` to indicate that the package is now automatically added to `Pulumi.yaml`.
1 parent 2bd0b1e commit 476778f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

content/docs/iac/concepts/resources/providers.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,43 @@ For example, to generate a local SDK for the [`hashicorp/random` provider](https
5050
pulumi package add terraform-provider hashicorp/random
5151
```
5252

53+
This command does two things:
54+
55+
1. Generates a local SDK in the language of your Pulumi program
56+
1. Automatically adds the package to your `Pulumi.yaml` file under the `packages` key
57+
5358
{{% notes type="tip" %}}
5459
In order to make sure Pulumi users are aware of the Any Terraform Provider's capabilities, Pulumi has included select, popular providers that can be consumed in Pulumi via the Any Terraform Provider in the Pulumi Registry, such as [The Honeycomb provider](/registry/packages/honeycombio/).
5560
{{% /notes %}}
5661

5762
The generated SDK will include a `.gitignore` so it can be safely committed to version control without including all of the SDK's dependencies. The SDK installation process also downloads the provider binary to a shared location on your local system outside of the working directory. The binary is cached, so it will not need to be downloaded more than once, and is not committed to version control.
5863

59-
#### Adding Provider Packages to the Project Configuration File
64+
#### About Provider Packages in the Project Configuration File
6065

6166
{{% notes type="info" %}}
62-
Adding provider packages to your project configuration file requires Pulumi version 3.157.0 or later.
67+
When using `pulumi package add` with Pulumi version 3.157.0 or later, packages are automatically added to your project configuration file (`Pulumi.yaml`).
6368
{{% /notes %}}
6469

65-
You can avoid the need to commit any generated SDK files to version control by adding your parameterized packages to your Pulumi project configuration file (`Pulumi.yaml`).
66-
67-
You can add a list of your named provider packages under the [`packages`](/docs/iac/concepts/projects/project-file/#packages-options) key. For the example in the previous section, the syntax would be:
70+
When you run `pulumi package add`, the package is automatically added to your Pulumi project configuration file under the [`packages`](/docs/iac/concepts/projects/project-file/#packages-options) key. For the example in the previous section, the following entry would be added to your `Pulumi.yaml`:
6871

6972
```yaml
7073
packages:
7174
random:
7275
source: terraform-provider
73-
version: 0.10.0 # The version of terraform-provider in the Pulumi registry
76+
# The version of terraform-provider in the Pulumi registry.
77+
# This is automatically added by the `pulumi package add` command:
78+
version: 0.10.0
7479
parameters:
7580
- hashicorp/random
76-
- 3.7.1 # The version of hashicorp/random in the OpenTofu Registry
81+
# The version of hashicorp/random in the OpenTofu Registry.
82+
# This is not a required parameter, but you may wish to include
83+
# it at the command line or add it after the fact in Pulumi.yaml
84+
# in order to ensure consistent builds. If this value is not
85+
# specified, the provider will take the latest version of
86+
# the OpenTofu provider.
87+
- 3.7.1
7788
```
7889
79-
The versions specified above are optional, but recommended in order to ensure consistent behavior on all systems.
80-
8190
You can install any packages tracked in the project configuration file with the [`pulumi install`](/docs/iac/cli/commands/pulumi_install/) command:
8291

8392
```bash
@@ -88,7 +97,7 @@ Installing package 'random'...
8897
```
8998

9099
{{% notes type="warning" %}}
91-
If you are tracking a package in the project file and installing via `pulumi install`, be sure to remove any generated SDK files from version control and `.gitignore` the SDK directory or the generated files will still be under version control!
100+
If you are using `pulumi install` to install packages defined in your project file, be sure to remove any generated SDK files from version control and `.gitignore` the SDK directory or the generated files will still be under version control!
92101
{{% /notes %}}
93102

94103
## Default and Explicit Providers

0 commit comments

Comments
 (0)