published on Monday, Mar 30, 2026 by Pulumi
published on Monday, Mar 30, 2026 by Pulumi
If the managed resource supports a write-only attribute for the private key (first introduced in Terraform 1.11), then the ephemeral variant of
tls.PrivateKeyshould be used, when possible, to avoid storing the private key data in the plan or state file.
Creates a PEM (and OpenSSH) formatted private key.
Generates a secure private key and encodes it in PEM (RFC 1421) and OpenSSH PEM (RFC 4716) formats. This resource is primarily intended for easily bootstrapping throwaway development environments.
Security Notice The private key generated by this resource will be stored unencrypted in your Terraform state file. Use of this resource for production deployments is not recommended. Instead, generate a private key file outside of Terraform and distribute it securely to the system where Terraform will be run.
This is a logical resource, so it contributes only to the current Terraform state and does not create any external managed resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tls from "@pulumi/tls";
// ECDSA key with P384 elliptic curve
const ecdsa_p384_example = new tls.PrivateKey("ecdsa-p384-example", {
algorithm: "ECDSA",
ecdsaCurve: "P384",
});
// RSA key of size 4096 bits
const rsa_4096_example = new tls.PrivateKey("rsa-4096-example", {
algorithm: "RSA",
rsaBits: 4096,
});
// ED25519 key
const ed25519_example = new tls.PrivateKey("ed25519-example", {algorithm: "ED25519"});
import pulumi
import pulumi_tls as tls
# ECDSA key with P384 elliptic curve
ecdsa_p384_example = tls.PrivateKey("ecdsa-p384-example",
algorithm="ECDSA",
ecdsa_curve="P384")
# RSA key of size 4096 bits
rsa_4096_example = tls.PrivateKey("rsa-4096-example",
algorithm="RSA",
rsa_bits=4096)
# ED25519 key
ed25519_example = tls.PrivateKey("ed25519-example", algorithm="ED25519")
package main
import (
"github.com/pulumi/pulumi-tls/sdk/v5/go/tls"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// ECDSA key with P384 elliptic curve
_, err := tls.NewPrivateKey(ctx, "ecdsa-p384-example", &tls.PrivateKeyArgs{
Algorithm: pulumi.String("ECDSA"),
EcdsaCurve: pulumi.String("P384"),
})
if err != nil {
return err
}
// RSA key of size 4096 bits
_, err = tls.NewPrivateKey(ctx, "rsa-4096-example", &tls.PrivateKeyArgs{
Algorithm: pulumi.String("RSA"),
RsaBits: pulumi.Int(4096),
})
if err != nil {
return err
}
// ED25519 key
_, err = tls.NewPrivateKey(ctx, "ed25519-example", &tls.PrivateKeyArgs{
Algorithm: pulumi.String("ED25519"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tls = Pulumi.Tls;
return await Deployment.RunAsync(() =>
{
// ECDSA key with P384 elliptic curve
var ecdsa_p384_example = new Tls.PrivateKey("ecdsa-p384-example", new()
{
Algorithm = "ECDSA",
EcdsaCurve = "P384",
});
// RSA key of size 4096 bits
var rsa_4096_example = new Tls.PrivateKey("rsa-4096-example", new()
{
Algorithm = "RSA",
RsaBits = 4096,
});
// ED25519 key
var ed25519_example = new Tls.PrivateKey("ed25519-example", new()
{
Algorithm = "ED25519",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tls.PrivateKey;
import com.pulumi.tls.PrivateKeyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// ECDSA key with P384 elliptic curve
var ecdsa_p384_example = new PrivateKey("ecdsa-p384-example", PrivateKeyArgs.builder()
.algorithm("ECDSA")
.ecdsaCurve("P384")
.build());
// RSA key of size 4096 bits
var rsa_4096_example = new PrivateKey("rsa-4096-example", PrivateKeyArgs.builder()
.algorithm("RSA")
.rsaBits(4096)
.build());
// ED25519 key
var ed25519_example = new PrivateKey("ed25519-example", PrivateKeyArgs.builder()
.algorithm("ED25519")
.build());
}
}
resources:
# ECDSA key with P384 elliptic curve
ecdsa-p384-example:
type: tls:PrivateKey
properties:
algorithm: ECDSA
ecdsaCurve: P384
# RSA key of size 4096 bits
rsa-4096-example:
type: tls:PrivateKey
properties:
algorithm: RSA
rsaBits: 4096
# ED25519 key
ed25519-example:
type: tls:PrivateKey
properties:
algorithm: ED25519
Generating a New Key
Since a private key is a logical resource that lives only in the Terraform state, it will persist until it is explicitly destroyed by the user.
In order to force the generation of a new key within an existing state, the private key instance can be “tainted”:
terraform taint tls_private_key.example
A new key will then be generated on the next pulumi up.
Create PrivateKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateKey(name: string, args: PrivateKeyArgs, opts?: CustomResourceOptions);@overload
def PrivateKey(resource_name: str,
args: PrivateKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
algorithm: Optional[str] = None,
ecdsa_curve: Optional[str] = None,
rsa_bits: Optional[int] = None)func NewPrivateKey(ctx *Context, name string, args PrivateKeyArgs, opts ...ResourceOption) (*PrivateKey, error)public PrivateKey(string name, PrivateKeyArgs args, CustomResourceOptions? opts = null)
public PrivateKey(String name, PrivateKeyArgs args)
public PrivateKey(String name, PrivateKeyArgs args, CustomResourceOptions options)
type: tls:PrivateKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PrivateKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PrivateKeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PrivateKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var privateKeyResource = new Tls.Index.PrivateKey("privateKeyResource", new()
{
Algorithm = "string",
EcdsaCurve = "string",
RsaBits = 0,
});
example, err := tls.NewPrivateKey(ctx, "privateKeyResource", &tls.PrivateKeyArgs{
Algorithm: pulumi.String("string"),
EcdsaCurve: pulumi.String("string"),
RsaBits: pulumi.Int(0),
})
var privateKeyResource = new PrivateKey("privateKeyResource", PrivateKeyArgs.builder()
.algorithm("string")
.ecdsaCurve("string")
.rsaBits(0)
.build());
private_key_resource = tls.PrivateKey("privateKeyResource",
algorithm="string",
ecdsa_curve="string",
rsa_bits=0)
const privateKeyResource = new tls.PrivateKey("privateKeyResource", {
algorithm: "string",
ecdsaCurve: "string",
rsaBits: 0,
});
type: tls:PrivateKey
properties:
algorithm: string
ecdsaCurve: string
rsaBits: 0
PrivateKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PrivateKey resource accepts the following input properties:
- Algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - Ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - Rsa
Bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- Algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - Ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - Rsa
Bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm String
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve String - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - rsa
Bits Integer - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - rsa
Bits number - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm str
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa_
curve str - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - rsa_
bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm String
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve String - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - rsa
Bits Number - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateKey resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- Private
Key stringPem - Private key data in PEM (RFC 1421) format.
- Private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- Public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- Private
Key stringPem - Private key data in PEM (RFC 1421) format.
- Private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- Public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
- id String
- The provider-assigned unique ID for this managed resource.
- private
Key StringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key StringPem - Private key data in PEM (RFC 1421) format.
- private
Key StringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key StringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key StringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
- id string
- The provider-assigned unique ID for this managed resource.
- private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key stringPem - Private key data in PEM (RFC 1421) format.
- private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
- id str
- The provider-assigned unique ID for this managed resource.
- private_
key_ stropenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private_
key_ strpem - Private key data in PEM (RFC 1421) format.
- private_
key_ strpem_ pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public_
key_ strfingerprint_ md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public_
key_ strfingerprint_ sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public_
key_ stropenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public_
key_ strpem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
- id String
- The provider-assigned unique ID for this managed resource.
- private
Key StringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key StringPem - Private key data in PEM (RFC 1421) format.
- private
Key StringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key StringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key StringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace().
Look up Existing PrivateKey Resource
Get an existing PrivateKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PrivateKeyState, opts?: CustomResourceOptions): PrivateKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
algorithm: Optional[str] = None,
ecdsa_curve: Optional[str] = None,
private_key_openssh: Optional[str] = None,
private_key_pem: Optional[str] = None,
private_key_pem_pkcs8: Optional[str] = None,
public_key_fingerprint_md5: Optional[str] = None,
public_key_fingerprint_sha256: Optional[str] = None,
public_key_openssh: Optional[str] = None,
public_key_pem: Optional[str] = None,
rsa_bits: Optional[int] = None) -> PrivateKeyfunc GetPrivateKey(ctx *Context, name string, id IDInput, state *PrivateKeyState, opts ...ResourceOption) (*PrivateKey, error)public static PrivateKey Get(string name, Input<string> id, PrivateKeyState? state, CustomResourceOptions? opts = null)public static PrivateKey get(String name, Output<String> id, PrivateKeyState state, CustomResourceOptions options)resources: _: type: tls:PrivateKey get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - Ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - Private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- Private
Key stringPem - Private key data in PEM (RFC 1421) format.
- Private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- Public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Rsa
Bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- Algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - Ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - Private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- Private
Key stringPem - Private key data in PEM (RFC 1421) format.
- Private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- Public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - Public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - Rsa
Bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm String
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve String - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - private
Key StringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key StringPem - Private key data in PEM (RFC 1421) format.
- private
Key StringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key StringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key StringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - rsa
Bits Integer - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm string
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve string - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - private
Key stringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key stringPem - Private key data in PEM (RFC 1421) format.
- private
Key stringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key stringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key stringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key stringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key stringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - rsa
Bits number - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm str
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa_
curve str - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - private_
key_ stropenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private_
key_ strpem - Private key data in PEM (RFC 1421) format.
- private_
key_ strpem_ pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public_
key_ strfingerprint_ md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public_
key_ strfingerprint_ sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public_
key_ stropenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public_
key_ strpem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - rsa_
bits int - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
- algorithm String
- Name of the algorithm to use when generating the private key. Currently-supported values are:
RSA,ECDSA,ED25519. - ecdsa
Curve String - When
algorithmisECDSA, the name of the elliptic curve to use. Currently-supported values are:P224,P256,P384,P521. (default:P224). - private
Key StringOpenssh - Private key data in OpenSSH PEM (RFC 4716) format.
- private
Key StringPem - Private key data in PEM (RFC 1421) format.
- private
Key StringPem Pkcs8 - Private key data in PKCS#8 PEM (RFC 5208) format.
- public
Key StringFingerprint Md5 - The fingerprint of the public key data in OpenSSH MD5 hash format, e.g.
aa:bb:cc:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringFingerprint Sha256 - The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g.
SHA256:.... Only available if the selected private key format is compatible, similarly topublicKeyOpensshand the ECDSA P224 limitations. - public
Key StringOpenssh - The public key data in "Authorized Keys" format. This is not populated for
ECDSAwith curveP224, as it is not supported. NOTE: the underlying libraries that generate this value append a\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - public
Key StringPem - Public key data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a
\nat the end of the PEM. In case this disrupts your use case, we recommend usingtrimspace(). - rsa
Bits Number - When
algorithmisRSA, the size of the generated RSA key, in bits (default:2048).
Package Details
- Repository
- TLS pulumi/pulumi-tls
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
tlsTerraform Provider.
published on Monday, Mar 30, 2026 by Pulumi
