TLS v4.10.0, Feb 15 23
TLS v4.10.0, Feb 15 23
tls.CertRequest
Explore with Pulumi AI
Example Usage
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Tls = Pulumi.Tls;
return await Deployment.RunAsync(() =>
{
var example = new Tls.CertRequest("example", new()
{
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: &tls.CertRequestSubjectArgs{
CommonName: pulumi.String("example.com"),
Organization: pulumi.String("ACME Examples, Inc"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tls.CertRequest;
import com.pulumi.tls.CertRequestArgs;
import com.pulumi.tls.inputs.CertRequestSubjectArgs;
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) {
var example = new CertRequest("example", CertRequestArgs.builder()
.privateKeyPem(Files.readString(Paths.get("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 fs from "fs";
import * as tls from "@pulumi/tls";
const example = new tls.CertRequest("example", {
privateKeyPem: fs.readFileSync("private_key.pem"),
subject: {
commonName: "example.com",
organization: "ACME Examples, Inc",
},
});
resources:
example:
type: tls:CertRequest
properties:
privateKeyPem:
fn::readFile: private_key.pem
subject:
commonName: example.com
organization: ACME Examples, Inc
Create 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:
- Private
Key stringPem 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 List<string> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- Ip
Addresses List<string> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- Key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- Subject
Cert
Request Subject Args 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).
- Private
Key stringPem 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 []string List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- Ip
Addresses []string List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- Key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- Subject
Cert
Request Subject Args 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 StringPem 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 List<String> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses List<String> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- subject
Cert
Request Subject Args 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).
- private
Key stringPem 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 string[] List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses string[] List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- subject
Cert
Request Subject Args 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_ strpem 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- subject
Cert
Request Subject Args 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).
- private
Key StringPem 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 List<String> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses List<String> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.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:
- Cert
Request stringPem 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 usingtrimspace()
.- Id string
The provider-assigned unique ID for this managed resource.
- Cert
Request stringPem 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 usingtrimspace()
.- Id string
The provider-assigned unique ID for this managed resource.
- cert
Request StringPem 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 usingtrimspace()
.- id String
The provider-assigned unique ID for this managed resource.
- cert
Request stringPem 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 usingtrimspace()
.- id string
The provider-assigned unique ID for this managed resource.
- cert_
request_ strpem 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 usingtrimspace()
.- id str
The provider-assigned unique ID for this managed resource.
- cert
Request StringPem 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 usingtrimspace()
.- id String
The provider-assigned unique ID for this managed resource.
Look up 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.
- Cert
Request stringPem 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 usingtrimspace()
.- Dns
Names List<string> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- Ip
Addresses List<string> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- Key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- Private
Key stringPem 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
Cert
Request Subject Args 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).
- Cert
Request stringPem 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 usingtrimspace()
.- Dns
Names []string List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- Ip
Addresses []string List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- Key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- Private
Key stringPem 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
Cert
Request Subject Args 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 StringPem 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 usingtrimspace()
.- dns
Names List<String> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses List<String> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- private
Key StringPem 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
Cert
Request Subject Args 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).
- cert
Request stringPem 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 usingtrimspace()
.- dns
Names string[] List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses string[] List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- private
Key stringPem 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
Cert
Request Subject Args 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_ strpem 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 usingtrimspace()
.- 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- private_
key_ strpem 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
Cert
Request Subject Args 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).
- cert
Request StringPem 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 usingtrimspace()
.- dns
Names List<String> List of DNS names for which a certificate is being requested (i.e. certificate subjects).
- ip
Addresses List<String> List of IP addresses for which a certificate is being requested (i.e. certificate subjects).
- key
Algorithm 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.This is now ignored, as the key algorithm is inferred from the
private_key_pem
.- private
Key StringPem 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
- Common
Name string Distinguished name:
CN
- Country string
Distinguished name:
C
- Locality string
Distinguished name:
L
- Organization string
Distinguished name:
O
- Organizational
Unit string Distinguished name:
OU
- Postal
Code string Distinguished name:
PC
- Province string
Distinguished name:
ST
- Serial
Number string Distinguished name:
SERIALNUMBER
- Street
Addresses List<string> Distinguished name:
STREET
- Common
Name string Distinguished name:
CN
- Country string
Distinguished name:
C
- Locality string
Distinguished name:
L
- Organization string
Distinguished name:
O
- Organizational
Unit string Distinguished name:
OU
- Postal
Code string Distinguished name:
PC
- Province string
Distinguished name:
ST
- Serial
Number string Distinguished name:
SERIALNUMBER
- Street
Addresses []string Distinguished name:
STREET
- common
Name String Distinguished name:
CN
- country String
Distinguished name:
C
- locality String
Distinguished name:
L
- organization String
Distinguished name:
O
- organizational
Unit String Distinguished name:
OU
- postal
Code String Distinguished name:
PC
- province String
Distinguished name:
ST
- serial
Number String Distinguished name:
SERIALNUMBER
- street
Addresses List<String> Distinguished name:
STREET
- common
Name string Distinguished name:
CN
- country string
Distinguished name:
C
- locality string
Distinguished name:
L
- organization string
Distinguished name:
O
- organizational
Unit string Distinguished name:
OU
- postal
Code string Distinguished name:
PC
- province string
Distinguished name:
ST
- serial
Number string Distinguished name:
SERIALNUMBER
- street
Addresses string[] Distinguished name:
STREET
- common_
name str Distinguished name:
CN
- country str
Distinguished name:
C
- locality str
Distinguished name:
L
- organization str
Distinguished name:
O
- organizational_
unit str Distinguished name:
OU
- postal_
code str Distinguished name:
PC
- province str
Distinguished name:
ST
- serial_
number str Distinguished name:
SERIALNUMBER
- street_
addresses Sequence[str] Distinguished name:
STREET
- common
Name String Distinguished name:
CN
- country String
Distinguished name:
C
- locality String
Distinguished name:
L
- organization String
Distinguished name:
O
- organizational
Unit String Distinguished name:
OU
- postal
Code String Distinguished name:
PC
- province String
Distinguished name:
ST
- serial
Number String Distinguished name:
SERIALNUMBER
- street
Addresses List<String> Distinguished name:
STREET
Package Details
- Repository
- TLS pulumi/pulumi-tls
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
tls
Terraform Provider.