Socket
Book a DemoInstallSign in
Socket

@pulumi/tls

Package Overview
Dependencies
Maintainers
2
Versions
512
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pulumi/tls

A Pulumi package to create TLS resources in Pulumi programs.

5.2.2
latest
Source
npmnpm
Version published
Weekly downloads
218K
-30.02%
Maintainers
2
Weekly downloads
 
Created

What is @pulumi/tls?

@pulumi/tls is an npm package that provides TLS (Transport Layer Security) utilities for managing and creating TLS certificates and keys. It is part of the Pulumi ecosystem, which allows for infrastructure as code using familiar programming languages.

What are @pulumi/tls's main functionalities?

Creating a Self-Signed Certificate

This feature allows you to create a self-signed certificate using the @pulumi/tls package. The code sample demonstrates how to generate a private key and then use it to create a self-signed certificate.

const tls = require('@pulumi/tls');

const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });
const selfSignedCert = new tls.SelfSignedCert('example', {
  keyAlgorithm: 'RSA',
  privateKeyPem: privateKey.privateKeyPem,
  subjects: [{ commonName: 'example.com' }],
  validityPeriodHours: 8760,
  allowedUses: ['keyEncipherment', 'digitalSignature', 'serverAuth']
});

exports.certPem = selfSignedCert.certPem;

Creating a Private Key

This feature allows you to create a private key. The code sample shows how to generate an RSA private key with a specified number of bits.

const tls = require('@pulumi/tls');

const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });

exports.privateKeyPem = privateKey.privateKeyPem;

Creating a Certificate Signing Request (CSR)

This feature allows you to create a Certificate Signing Request (CSR). The code sample demonstrates how to generate a CSR using a private key and subject information.

const tls = require('@pulumi/tls');

const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });
const csr = new tls.CertRequest('example', {
  keyAlgorithm: 'RSA',
  privateKeyPem: privateKey.privateKeyPem,
  subjects: [{ commonName: 'example.com' }]
});

exports.csrPem = csr.certRequestPem;

Other packages similar to @pulumi/tls

Keywords

pulumi

FAQs

Package last updated on 02 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.