Pulumi TLS is a Python package that provides an interface to create and manage TLS (Transport Layer Security) resources within Pulumi programs. It allows for the programmatic generation of private keys, certificate signing requests, and self-signed certificates, which can then be used with other cloud providers. The library is currently at version 5.3.1 and typically sees frequent updates to align with its upstream Terraform provider and Pulumi's core bridge updates.
pip install pulumi_tlsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create an RSA private key and then use it to generate a self-signed TLS certificate with specified validity and allowed uses.
Consult the official Pulumi TLS provider changelog on GitHub and the Pulumi Registry for detailed migration guides or breaking changes specific to the versions you are upgrading between.
If OpenSSH compatibility is required, use ECDSA with `P256`, `P384`, or `P521` curves, or opt for the RSA algorithm.
Always trim whitespace from PEM output strings using string methods like `.strip()` in Python before passing them to other tools or services if you encounter parsing issues.
Run `pip install pulumi_tls` to install the package. If using a virtual environment, ensure it's activated and run `pip install pulumi_tls` or `venv/bin/pip install pulumi_tls`.
Consult the official `pulumi-tls` API documentation for the specific resource and version you are using to verify correct property names. Upgrade the `pulumi-tls` provider if necessary using `pip install --upgrade pulumi_tls`.
Ensure the private key is in a valid PEM (RFC 1421) format and includes the correct headers and footers (e.g., `-----BEGIN PRIVATE KEY-----`). Double-check the key content for any errors or unexpected characters.
Change the import statement to `import pulumi_tls as tls` or `from pulumi_tls import PrivateKey` to correctly reference the installed package.