|
| 1 | +--- |
| 2 | +title_tag: Plugins |
| 3 | +meta_desc: Learn about Pulumi plugins, the core extensibility mechanism that enables Pulumi to work with cloud providers, languages, and tools. |
| 4 | +title: Plugins |
| 5 | +h1: Plugins |
| 6 | +meta_image: /images/docs/meta-images/docs-meta.png |
| 7 | +menu: |
| 8 | + iac: |
| 9 | + name: Plugins |
| 10 | + parent: iac-concepts |
| 11 | + weight: 140 |
| 12 | + concepts: |
| 13 | + weight: 140 |
| 14 | +--- |
| 15 | + |
| 16 | +{{% notes type="info" %}} |
| 17 | +Most Pulumi users don't need to understand plugins in depth, as most plugin installation and management happens automatically. |
| 18 | + |
| 19 | +If you're interested in learning more about Pulumi internals, see the [Pulumi Developer Documentation](https://pulumi-developer-docs.readthedocs.io/latest/docs/architecture/plugins.html). |
| 20 | +{{% /notes %}} |
| 21 | + |
| 22 | +Plugins are Pulumi's core extensibility mechanism, allowing the Pulumi engine to communicate in a uniform manner with various languages, resource providers, and other tools. Plugins always run as separate processes and mostly use gRPC for communication with the Pulumi engine. |
| 23 | + |
| 24 | +## Plugin types |
| 25 | + |
| 26 | +Pulumi supports five categories of plugins: |
| 27 | + |
| 28 | +### Resource plugins |
| 29 | + |
| 30 | +Resource plugins (also known as [providers](/docs/iac/concepts/resources/providers/)) expose standardized interfaces for managing cloud resources. A listing of providers is available in the [Pulumi Registry](/registry/). |
| 31 | + |
| 32 | +When you first run `pulumi preview` or `pulumi up`, the Pulumi CLI will install any required providers that are not already in your plugin cache. |
| 33 | + |
| 34 | +### Language plugins |
| 35 | + |
| 36 | +Language plugins (also known as language hosts) host programs written in specific languages, enabling the Pulumi engine to execute your Pulumi code without understanding language-specific details. As described in [How Pulumi works](/docs/iac/concepts/how-pulumi-works/#language-hosts), language plugins consist of: |
| 37 | + |
| 38 | +1. A language executor binary named `pulumi-language-<language-name>`, which Pulumi uses to launch the runtime for your program's language (e.g., Node.js or Python). This binary is distributed with the Pulumi CLI. |
| 39 | +1. For all languages except YAML, a language SDK that prepares your program for execution and observes resource registrations. |
| 40 | + |
| 41 | +Pulumi-supported language plugins are installed automatically with the Pulumi CLI. Community-supported language plugins can be installed separately. |
| 42 | + |
| 43 | +### Analyzer plugins |
| 44 | + |
| 45 | +Analyzer plugins scan Pulumi programs for potential issues and power [Pulumi Policy as Code](/docs/insights/policy/). These plugins enable you to enforce compliance, security, and best practices across your infrastructure. |
| 46 | + |
| 47 | +Policy plugins are installed automatically with the Pulumi CLI. |
| 48 | + |
| 49 | +### Converter plugins |
| 50 | + |
| 51 | +Converter plugins transform existing infrastructure-as-code from other tools (like Terraform, Kubernetes YAML, or CloudFormation) into Pulumi programs. Learn more about [conversion tools](/docs/iac/guides/migration/converters/). |
| 52 | + |
| 53 | +Converter plugins are installed automatically with the Pulumi CLI when you run the [`pulumi convert`](/docs/iac/cli/commands/pulumi_convert) command. |
| 54 | + |
| 55 | +### Tool plugins |
| 56 | + |
| 57 | +Tool plugins enable integration between Pulumi and external tools, extending Pulumi's capabilities to work with your existing workflows and toolchains. |
| 58 | + |
| 59 | +## Plugin installation and management |
| 60 | + |
| 61 | +### Automatic installation |
| 62 | + |
| 63 | +The Pulumi CLI normally handles plugin installation automatically. For example: |
| 64 | + |
| 65 | +- **Resource plugins** (provider binaries) are installed automatically when you first run `pulumi preview` or `pulumi up` if they are not already present in the plugin cache |
| 66 | +- **Language plugins** are installed with the Pulumi CLI |
| 67 | +- **Policy plugins** are installed with the Pulumi CLI |
| 68 | +- The Pulumi CLI ensures your resource plugins are present when you run your Pulumi program |
| 69 | + |
| 70 | +### Manual installation |
| 71 | + |
| 72 | +Most users will not need to run the [`pulumi plugin install`](/docs/iac/cli/commands/pulumi_plugin_install/) command manually. However, manual plugin installation can be useful for scenarios like: |
| 73 | + |
| 74 | +- Pre-loading plugins on a custom Docker image to speed up CI/CD pipelines |
| 75 | +- Working in air-gapped environments |
| 76 | +- Testing pre-release versions of plugins |
| 77 | +- Installing plugins that are community-maintained |
| 78 | + |
| 79 | +### Plugin storage |
| 80 | + |
| 81 | +Plugins are stored in different locations depending on their type: |
| 82 | + |
| 83 | +- All plugins that ship with the Pulumi CLI, including all of our supported **Language plugins** and **policy plugins** are stored in `~/.pulumi/bin` |
| 84 | +- All plugins that are installed by the user, whether explicitly or automatically by the Pulumi CLI, are cached in `~/.pulumi/plugins` |
| 85 | + |
| 86 | +### Plugin management commands |
| 87 | + |
| 88 | +You can manage your local plugin cache using the following CLI commands: |
| 89 | + |
| 90 | +- [`pulumi plugin ls`](/docs/iac/cli/commands/pulumi_plugin_ls/) - List installed plugins |
| 91 | +- [`pulumi plugin rm`](/docs/iac/cli/commands/pulumi_plugin_rm/) - Remove cached plugins |
| 92 | +- [`pulumi plugin install`](/docs/iac/cli/commands/pulumi_plugin_install/) - Manually install a plugin |
| 93 | + |
| 94 | +## Plugin implementation details |
| 95 | + |
| 96 | +Plugins are deployed through two approaches: |
| 97 | + |
| 98 | +- **Executables** following the naming convention `pulumi-<kind>-<name>` (e.g., `pulumi-resource-aws`) |
| 99 | +- **Directory-based plugins** containing a `PulumiPlugin.yaml` configuration file, where the engine uses the specified runtime to execute the plugin through the language plugin's interface |
| 100 | + |
| 101 | +For more details about Pulumi plugin architecture and how to contribute to plugin development, see the [Pulumi Developer Documentation](https://pulumi-developer-docs.readthedocs.io/latest/docs/architecture/plugins.html). |
| 102 | + |
| 103 | +## Related topics |
| 104 | + |
| 105 | +- [Providers](/docs/iac/concepts/resources/providers/) - Learn more about resource plugins (providers) |
| 106 | +- [How Pulumi works](/docs/iac/concepts/how-pulumi-works/) - Understand how plugins fit into Pulumi's architecture |
| 107 | +- [Policy as Code](/docs/insights/policy/) - Learn about analyzer plugins for policy enforcement |
| 108 | +- [Conversion tools](/docs/iac/guides/migration/converters/) - Use converter plugins to migrate from other IaC tools |
0 commit comments