TLS

Pulumi Official
Package maintained by Pulumi
v4.6.0 published on Monday, Jun 6, 2022 by Pulumi

CertRequest

Example Usage

using System.IO;
using Pulumi;
using Tls = Pulumi.Tls;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Tls.CertRequest("example", new Tls.CertRequestArgs
        {
            PrivateKeyPem = File.ReadAllText("private_key.pem"),
            Subject = new Tls.Inputs.CertRequestSubjectArgs
            {
                CommonName = "example.com",
                Organization = "ACME Examples, Inc",
            },
        });
    }

}
package main

import (
	"io/ioutil"

	"github.com/pulumi/pulumi-tls/sdk/v4/go/tls"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tls.NewCertRequest(ctx, "example", &tls.CertRequestArgs{
			PrivateKeyPem: readFileOrPanic("private_key.pem"),
			Subject: &CertRequestSubjectArgs{
				CommonName:   pulumi.String("example.com"),
				Organization: pulumi.String("ACME Examples, Inc"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new CertRequest("example", CertRequestArgs.builder()        
            .privateKeyPem(Files.readString("private_key.pem"))
            .subject(CertRequestSubjectArgs.builder()
                .commonName("example.com")
                .organization("ACME Examples, Inc")
                .build())
            .build());

    }
}
import pulumi
import pulumi_tls as tls

example = tls.CertRequest("example",
    private_key_pem=(lambda path: open(path).read())("private_key.pem"),
    subject=tls.CertRequestSubjectArgs(
        common_name="example.com",
        organization="ACME Examples, Inc",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as tls from "@pulumi/tls";
import * from "fs";

const example = new tls.CertRequest("example", {
    privateKeyPem: fs.readFileSync("private_key.pem"),
    subject: {
        commonName: "example.com",
        organization: "ACME Examples, Inc",
    },
});

Coming soon!

Create a CertRequest Resource

new CertRequest(name: string, args: CertRequestArgs, opts?: CustomResourceOptions);
@overload
def CertRequest(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                dns_names: Optional[Sequence[str]] = None,
                ip_addresses: Optional[Sequence[str]] = None,
                key_algorithm: Optional[str] = None,
                private_key_pem: Optional[str] = None,
                subject: Optional[CertRequestSubjectArgs] = None,
                uris: Optional[Sequence[str]] = None)
@overload
def CertRequest(resource_name: str,
                args: CertRequestArgs,
                opts: Optional[ResourceOptions] = None)
func NewCertRequest(ctx *Context, name string, args CertRequestArgs, opts ...ResourceOption) (*CertRequest, error)
public CertRequest(string name, CertRequestArgs args, CustomResourceOptions? opts = null)
public CertRequest(String name, CertRequestArgs args)
public CertRequest(String name, CertRequestArgs args, CustomResourceOptions options)
type: tls:CertRequest
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CertRequestArgs
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 CertRequestArgs
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 CertRequestArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CertRequestArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CertRequestArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CertRequest Resource Properties

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

Inputs

The CertRequest resource accepts the following input properties:

PrivateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

DnsNames List<string>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

IpAddresses List<string>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

KeyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

Subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

Uris List<string>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

PrivateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

DnsNames []string

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

IpAddresses []string

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

KeyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

Subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

Uris []string

List of URIs for which a certificate is being requested (i.e. certificate subjects).

privateKeyPem String

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

dnsNames List<String>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses List<String>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm String

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris List<String>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

privateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

dnsNames string[]

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses string[]

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris string[]

List of URIs for which a certificate is being requested (i.e. certificate subjects).

private_key_pem str

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

dns_names Sequence[str]

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ip_addresses Sequence[str]

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

key_algorithm str

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris Sequence[str]

List of URIs for which a certificate is being requested (i.e. certificate subjects).

privateKeyPem String

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

dnsNames List<String>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses List<String>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm String

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

subject Property Map

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris List<String>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

Outputs

All input properties are implicitly available as output properties. Additionally, the CertRequest resource produces the following output properties:

CertRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

Id string

The provider-assigned unique ID for this managed resource.

CertRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

Id string

The provider-assigned unique ID for this managed resource.

certRequestPem String

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

id String

The provider-assigned unique ID for this managed resource.

certRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

id string

The provider-assigned unique ID for this managed resource.

cert_request_pem str

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

id str

The provider-assigned unique ID for this managed resource.

certRequestPem String

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing CertRequest Resource

Get an existing CertRequest 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?: CertRequestState, opts?: CustomResourceOptions): CertRequest
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cert_request_pem: Optional[str] = None,
        dns_names: Optional[Sequence[str]] = None,
        ip_addresses: Optional[Sequence[str]] = None,
        key_algorithm: Optional[str] = None,
        private_key_pem: Optional[str] = None,
        subject: Optional[CertRequestSubjectArgs] = None,
        uris: Optional[Sequence[str]] = None) -> CertRequest
func GetCertRequest(ctx *Context, name string, id IDInput, state *CertRequestState, opts ...ResourceOption) (*CertRequest, error)
public static CertRequest Get(string name, Input<string> id, CertRequestState? state, CustomResourceOptions? opts = null)
public static CertRequest get(String name, Output<String> id, CertRequestState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
CertRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

DnsNames List<string>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

IpAddresses List<string>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

KeyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

PrivateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

Subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

Uris List<string>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

CertRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

DnsNames []string

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

IpAddresses []string

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

KeyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

PrivateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

Subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

Uris []string

List of URIs for which a certificate is being requested (i.e. certificate subjects).

certRequestPem String

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

dnsNames List<String>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses List<String>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm String

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

privateKeyPem String

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris List<String>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

certRequestPem string

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

dnsNames string[]

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses string[]

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm string

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

privateKeyPem string

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris string[]

List of URIs for which a certificate is being requested (i.e. certificate subjects).

cert_request_pem str

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

dns_names Sequence[str]

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ip_addresses Sequence[str]

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

key_algorithm str

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

private_key_pem str

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

subject CertRequestSubjectArgs

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris Sequence[str]

List of URIs for which a certificate is being requested (i.e. certificate subjects).

certRequestPem String

The certificate request data in PEM (RFC 1421) format. NOTE: the underlying libraries that generate this value append a \n at the end of the PEM. In case this disrupts your use case, we recommend using trimspace().

dnsNames List<String>

List of DNS names for which a certificate is being requested (i.e. certificate subjects).

ipAddresses List<String>

List of IP addresses for which a certificate is being requested (i.e. certificate subjects).

keyAlgorithm String

Name of the algorithm used when generating the private key provided in private_key_pem. NOTE: this is deprecated and ignored, as the key algorithm is now inferred from the key.

Deprecated:

This is now ignored, as the key algorithm is inferred from the private_key_pem.

privateKeyPem String

Private key in PEM (RFC 1421) format, that the certificate will belong to. This can be read from a separate file using the file interpolation function. Only an irreversible secure hash of the private key will be stored in the Terraform state.

subject Property Map

The subject for which a certificate is being requested. The acceptable arguments are all optional and their naming is based upon Issuer Distinguished Names (RFC5280) section.

uris List<String>

List of URIs for which a certificate is being requested (i.e. certificate subjects).

Supporting Types

CertRequestSubject

CommonName string
Country string
Locality string
Organization string
OrganizationalUnit string
PostalCode string
Province string
SerialNumber string
StreetAddresses List<string>
commonName String
country String
locality String
organization String
organizationalUnit String
postalCode String
province String
serialNumber String
streetAddresses List<String>
commonName String
country String
locality String
organization String
organizationalUnit String
postalCode String
province String
serialNumber String
streetAddresses List<String>

Package Details

Repository
https://github.com/pulumi/pulumi-tls
License
Apache-2.0
Notes

This Pulumi package is based on the tls Terraform Provider.