tls.CertRequest
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as std from "@pulumi/std";
import * as tls from "@pulumi/tls";
const example = new tls.CertRequest("example", {
privateKeyPem: std.file({
input: "private_key.pem",
}).then(invoke => invoke.result),
subject: {
commonName: "example.com",
organization: "ACME Examples, Inc",
},
});
import pulumi
import pulumi_std as std
import pulumi_tls as tls
example = tls.CertRequest("example",
private_key_pem=std.file(input="private_key.pem").result,
subject={
"common_name": "example.com",
"organization": "ACME Examples, Inc",
})
package main
import (
"github.com/pulumi/pulumi-std/sdk/go/std"
"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 {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "private_key.pem",
}, nil)
if err != nil {
return err
}
_, err = tls.NewCertRequest(ctx, "example", &tls.CertRequestArgs{
PrivateKeyPem: pulumi.String(invokeFile.Result),
Subject: &tls.CertRequestSubjectArgs{
CommonName: pulumi.String("example.com"),
Organization: pulumi.String("ACME Examples, Inc"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Std = Pulumi.Std;
using Tls = Pulumi.Tls;
return await Deployment.RunAsync(() =>
{
var example = new Tls.CertRequest("example", new()
{
PrivateKeyPem = Std.File.Invoke(new()
{
Input = "private_key.pem",
}).Apply(invoke => invoke.Result),
Subject = new Tls.Inputs.CertRequestSubjectArgs
{
CommonName = "example.com",
Organization = "ACME Examples, Inc",
},
});
});
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(StdFunctions.file(FileArgs.builder()
.input("private_key.pem")
.build()).result())
.subject(CertRequestSubjectArgs.builder()
.commonName("example.com")
.organization("ACME Examples, Inc")
.build())
.build());
}
}
resources:
example:
type: tls:CertRequest
properties:
privateKeyPem:
fn::invoke:
Function: std:file
Arguments:
input: private_key.pem
Return: result
subject:
commonName: example.com
organization: ACME Examples, Inc
Create CertRequest Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CertRequest(name: string, args: CertRequestArgs, opts?: CustomResourceOptions);
@overload
def CertRequest(resource_name: str,
args: CertRequestArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CertRequest(resource_name: str,
opts: Optional[ResourceOptions] = None,
private_key_pem: Optional[str] = None,
dns_names: Optional[Sequence[str]] = None,
ip_addresses: Optional[Sequence[str]] = None,
subject: Optional[CertRequestSubjectArgs] = None,
uris: Optional[Sequence[str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var certRequestResource = new Tls.CertRequest("certRequestResource", new()
{
PrivateKeyPem = "string",
DnsNames = new[]
{
"string",
},
IpAddresses = new[]
{
"string",
},
Subject = new Tls.Inputs.CertRequestSubjectArgs
{
CommonName = "string",
Country = "string",
Locality = "string",
Organization = "string",
OrganizationalUnit = "string",
PostalCode = "string",
Province = "string",
SerialNumber = "string",
StreetAddresses = new[]
{
"string",
},
},
Uris = new[]
{
"string",
},
});
example, err := tls.NewCertRequest(ctx, "certRequestResource", &tls.CertRequestArgs{
PrivateKeyPem: pulumi.String("string"),
DnsNames: pulumi.StringArray{
pulumi.String("string"),
},
IpAddresses: pulumi.StringArray{
pulumi.String("string"),
},
Subject: &tls.CertRequestSubjectArgs{
CommonName: pulumi.String("string"),
Country: pulumi.String("string"),
Locality: pulumi.String("string"),
Organization: pulumi.String("string"),
OrganizationalUnit: pulumi.String("string"),
PostalCode: pulumi.String("string"),
Province: pulumi.String("string"),
SerialNumber: pulumi.String("string"),
StreetAddresses: pulumi.StringArray{
pulumi.String("string"),
},
},
Uris: pulumi.StringArray{
pulumi.String("string"),
},
})
var certRequestResource = new CertRequest("certRequestResource", CertRequestArgs.builder()
.privateKeyPem("string")
.dnsNames("string")
.ipAddresses("string")
.subject(CertRequestSubjectArgs.builder()
.commonName("string")
.country("string")
.locality("string")
.organization("string")
.organizationalUnit("string")
.postalCode("string")
.province("string")
.serialNumber("string")
.streetAddresses("string")
.build())
.uris("string")
.build());
cert_request_resource = tls.CertRequest("certRequestResource",
private_key_pem="string",
dns_names=["string"],
ip_addresses=["string"],
subject={
"common_name": "string",
"country": "string",
"locality": "string",
"organization": "string",
"organizational_unit": "string",
"postal_code": "string",
"province": "string",
"serial_number": "string",
"street_addresses": ["string"],
},
uris=["string"])
const certRequestResource = new tls.CertRequest("certRequestResource", {
privateKeyPem: "string",
dnsNames: ["string"],
ipAddresses: ["string"],
subject: {
commonName: "string",
country: "string",
locality: "string",
organization: "string",
organizationalUnit: "string",
postalCode: "string",
province: "string",
serialNumber: "string",
streetAddresses: ["string"],
},
uris: ["string"],
});
type: tls:CertRequest
properties:
dnsNames:
- string
ipAddresses:
- string
privateKeyPem: string
subject:
commonName: string
country: string
locality: string
organization: string
organizationalUnit: string
postalCode: string
province: string
serialNumber: string
streetAddresses:
- string
uris:
- string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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. - 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).
- Subject
Cert
Request Subject - 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. - 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).
- 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. - 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).
- subject
Cert
Request Subject - 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. - 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).
- subject
Cert
Request Subject - 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. - 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).
- 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. - 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).
- 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.
- Key
Algorithm string - Name of the algorithm used when generating the private key provided in
private_key_pem
.
- 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.
- Key
Algorithm string - Name of the algorithm used when generating the private key provided in
private_key_pem
.
- 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.
- key
Algorithm String - Name of the algorithm used when generating the private key provided in
private_key_pem
.
- 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.
- key
Algorithm string - Name of the algorithm used when generating the private key provided in
private_key_pem
.
- 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.
- key_
algorithm str - Name of the algorithm used when generating the private key provided in
private_key_pem
.
- 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.
- key
Algorithm String - Name of the algorithm used when generating the private key provided in
private_key_pem
.
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
. - 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. - Subject
Cert
Request Subject - 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
. - 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. - 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
. - 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. - subject
Cert
Request Subject - 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
. - 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. - subject
Cert
Request Subject - 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
. - 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. - 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
. - 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. - 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, CertRequestSubjectArgs
- 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.