Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

PrivateKey

Create a PrivateKey Resource

new PrivateKey(name: string, args: PrivateKeyArgs, opts?: CustomResourceOptions);
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)
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.
opts ResourceOptions
A bag of options that control this 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.

PrivateKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The PrivateKey resource accepts the following input properties:

Algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

EcdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

RsaBits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

Algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

EcdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

RsaBits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

ecdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

rsaBits number

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

algorithm str

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

ecdsa_curve str

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

rsa_bits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 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.
PrivateKeyPem string

The private key data in PEM format.

PublicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

PublicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

PublicKeyPem string

The public key data in PEM format.

Id string
The provider-assigned unique ID for this managed resource.
PrivateKeyPem string

The private key data in PEM format.

PublicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

PublicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

PublicKeyPem string

The public key data in PEM format.

id string
The provider-assigned unique ID for this managed resource.
privateKeyPem string

The private key data in PEM format.

publicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

publicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

publicKeyPem string

The public key data in PEM format.

id str
The provider-assigned unique ID for this managed resource.
private_key_pem str

The private key data in PEM format.

public_key_fingerprint_md5 str

The md5 hash 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, as per the rules for public_key_openssh.

public_key_openssh str

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

public_key_pem str

The public key data in PEM format.

Look up an 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_pem: Optional[str] = None, public_key_fingerprint_md5: Optional[str] = None, public_key_openssh: Optional[str] = None, public_key_pem: Optional[str] = None, rsa_bits: Optional[int] = None) -> PrivateKey
func 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)
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.

The following state arguments are supported:

Algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

EcdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

PrivateKeyPem string

The private key data in PEM format.

PublicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

PublicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

PublicKeyPem string

The public key data in PEM format.

RsaBits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

Algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

EcdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

PrivateKeyPem string

The private key data in PEM format.

PublicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

PublicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

PublicKeyPem string

The public key data in PEM format.

RsaBits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

algorithm string

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

ecdsaCurve string

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

privateKeyPem string

The private key data in PEM format.

publicKeyFingerprintMd5 string

The md5 hash 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, as per the rules for public_key_openssh.

publicKeyOpenssh string

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

publicKeyPem string

The public key data in PEM format.

rsaBits number

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

algorithm str

The name of the algorithm to use for the key. Currently-supported values are “RSA” and “ECDSA”.

ecdsa_curve str

When algorithm is “ECDSA”, the name of the elliptic curve to use. May be any one of “P224”, “P256”, “P384” or “P521”, with “P224” as the default.

private_key_pem str

The private key data in PEM format.

public_key_fingerprint_md5 str

The md5 hash 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, as per the rules for public_key_openssh.

public_key_openssh str

The public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves “P256”, “P384” and “P521” are supported. This attribute is empty if an incompatible ECDSA curve is selected.

public_key_pem str

The public key data in PEM format.

rsa_bits int

When algorithm is “RSA”, the size of the generated RSA key in bits. Defaults to 2048.

Package Details

Repository
https://github.com/pulumi/pulumi-tls
License
Apache-2.0
Notes
This Pulumi package is based on the tls Terraform Provider.