1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. Certificate
Rancher 2 v9.0.0 published on Wednesday, Apr 16, 2025 by Pulumi

rancher2.Certificate

Explore with Pulumi AI

Provides a Rancher v2 certificate resource. This can be used to create certificates for Rancher v2 environments and retrieve their information.

There are 2 types of Rancher v2 certificates:

  • Project certificate: Available to all namespaces in the project_id
  • Namespaced certificate: Available to just namespace_id in the project_id

Create Certificate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
@overload
def Certificate(resource_name: str,
                args: CertificateArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def Certificate(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                certs: Optional[str] = None,
                key: Optional[str] = None,
                project_id: Optional[str] = None,
                annotations: Optional[Mapping[str, str]] = None,
                description: Optional[str] = None,
                labels: Optional[Mapping[str, str]] = None,
                name: Optional[str] = None,
                namespace_id: Optional[str] = None)
func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
public Certificate(String name, CertificateArgs args)
public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
type: rancher2:Certificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CertificateArgs
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 certificateResource = new Rancher2.Certificate("certificateResource", new()
{
    Certs = "string",
    Key = "string",
    ProjectId = "string",
    Annotations = 
    {
        { "string", "string" },
    },
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    NamespaceId = "string",
});
Copy
example, err := rancher2.NewCertificate(ctx, "certificateResource", &rancher2.CertificateArgs{
	Certs:     pulumi.String("string"),
	Key:       pulumi.String("string"),
	ProjectId: pulumi.String("string"),
	Annotations: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:        pulumi.String("string"),
	NamespaceId: pulumi.String("string"),
})
Copy
var certificateResource = new Certificate("certificateResource", CertificateArgs.builder()
    .certs("string")
    .key("string")
    .projectId("string")
    .annotations(Map.of("string", "string"))
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .namespaceId("string")
    .build());
Copy
certificate_resource = rancher2.Certificate("certificateResource",
    certs="string",
    key="string",
    project_id="string",
    annotations={
        "string": "string",
    },
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    namespace_id="string")
Copy
const certificateResource = new rancher2.Certificate("certificateResource", {
    certs: "string",
    key: "string",
    projectId: "string",
    annotations: {
        string: "string",
    },
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    namespaceId: "string",
});
Copy
type: rancher2:Certificate
properties:
    annotations:
        string: string
    certs: string
    description: string
    key: string
    labels:
        string: string
    name: string
    namespaceId: string
    projectId: string
Copy

Certificate 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 Certificate resource accepts the following input properties:

Certs This property is required. string
Base64 encoded public certs (string)
Key This property is required. string
Base64 encoded private key (string)
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The project id where the certificate should be created (string)
Annotations Dictionary<string, string>
Annotations for certificate object (map)
Description string
A certificate description (string)
Labels Dictionary<string, string>
Labels for certificate object (map)
Name Changes to this property will trigger replacement. string
The name of the certificate (string)
NamespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
Certs This property is required. string
Base64 encoded public certs (string)
Key This property is required. string
Base64 encoded private key (string)
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The project id where the certificate should be created (string)
Annotations map[string]string
Annotations for certificate object (map)
Description string
A certificate description (string)
Labels map[string]string
Labels for certificate object (map)
Name Changes to this property will trigger replacement. string
The name of the certificate (string)
NamespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
certs This property is required. String
Base64 encoded public certs (string)
key This property is required. String
Base64 encoded private key (string)
projectId
This property is required.
Changes to this property will trigger replacement.
String
The project id where the certificate should be created (string)
annotations Map<String,String>
Annotations for certificate object (map)
description String
A certificate description (string)
labels Map<String,String>
Labels for certificate object (map)
name Changes to this property will trigger replacement. String
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. String
The namespace id where the namespaced certificate should be created (string)
certs This property is required. string
Base64 encoded public certs (string)
key This property is required. string
Base64 encoded private key (string)
projectId
This property is required.
Changes to this property will trigger replacement.
string
The project id where the certificate should be created (string)
annotations {[key: string]: string}
Annotations for certificate object (map)
description string
A certificate description (string)
labels {[key: string]: string}
Labels for certificate object (map)
name Changes to this property will trigger replacement. string
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
certs This property is required. str
Base64 encoded public certs (string)
key This property is required. str
Base64 encoded private key (string)
project_id
This property is required.
Changes to this property will trigger replacement.
str
The project id where the certificate should be created (string)
annotations Mapping[str, str]
Annotations for certificate object (map)
description str
A certificate description (string)
labels Mapping[str, str]
Labels for certificate object (map)
name Changes to this property will trigger replacement. str
The name of the certificate (string)
namespace_id Changes to this property will trigger replacement. str
The namespace id where the namespaced certificate should be created (string)
certs This property is required. String
Base64 encoded public certs (string)
key This property is required. String
Base64 encoded private key (string)
projectId
This property is required.
Changes to this property will trigger replacement.
String
The project id where the certificate should be created (string)
annotations Map<String>
Annotations for certificate object (map)
description String
A certificate description (string)
labels Map<String>
Labels for certificate object (map)
name Changes to this property will trigger replacement. String
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. String
The namespace id where the namespaced certificate should be created (string)

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Certificate Resource

Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        annotations: Optional[Mapping[str, str]] = None,
        certs: Optional[str] = None,
        description: Optional[str] = None,
        key: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        namespace_id: Optional[str] = None,
        project_id: Optional[str] = None) -> Certificate
func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
resources:  _:    type: rancher2:Certificate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Annotations Dictionary<string, string>
Annotations for certificate object (map)
Certs string
Base64 encoded public certs (string)
Description string
A certificate description (string)
Key string
Base64 encoded private key (string)
Labels Dictionary<string, string>
Labels for certificate object (map)
Name Changes to this property will trigger replacement. string
The name of the certificate (string)
NamespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
ProjectId Changes to this property will trigger replacement. string
The project id where the certificate should be created (string)
Annotations map[string]string
Annotations for certificate object (map)
Certs string
Base64 encoded public certs (string)
Description string
A certificate description (string)
Key string
Base64 encoded private key (string)
Labels map[string]string
Labels for certificate object (map)
Name Changes to this property will trigger replacement. string
The name of the certificate (string)
NamespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
ProjectId Changes to this property will trigger replacement. string
The project id where the certificate should be created (string)
annotations Map<String,String>
Annotations for certificate object (map)
certs String
Base64 encoded public certs (string)
description String
A certificate description (string)
key String
Base64 encoded private key (string)
labels Map<String,String>
Labels for certificate object (map)
name Changes to this property will trigger replacement. String
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. String
The namespace id where the namespaced certificate should be created (string)
projectId Changes to this property will trigger replacement. String
The project id where the certificate should be created (string)
annotations {[key: string]: string}
Annotations for certificate object (map)
certs string
Base64 encoded public certs (string)
description string
A certificate description (string)
key string
Base64 encoded private key (string)
labels {[key: string]: string}
Labels for certificate object (map)
name Changes to this property will trigger replacement. string
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. string
The namespace id where the namespaced certificate should be created (string)
projectId Changes to this property will trigger replacement. string
The project id where the certificate should be created (string)
annotations Mapping[str, str]
Annotations for certificate object (map)
certs str
Base64 encoded public certs (string)
description str
A certificate description (string)
key str
Base64 encoded private key (string)
labels Mapping[str, str]
Labels for certificate object (map)
name Changes to this property will trigger replacement. str
The name of the certificate (string)
namespace_id Changes to this property will trigger replacement. str
The namespace id where the namespaced certificate should be created (string)
project_id Changes to this property will trigger replacement. str
The project id where the certificate should be created (string)
annotations Map<String>
Annotations for certificate object (map)
certs String
Base64 encoded public certs (string)
description String
A certificate description (string)
key String
Base64 encoded private key (string)
labels Map<String>
Labels for certificate object (map)
name Changes to this property will trigger replacement. String
The name of the certificate (string)
namespaceId Changes to this property will trigger replacement. String
The namespace id where the namespaced certificate should be created (string)
projectId Changes to this property will trigger replacement. String
The project id where the certificate should be created (string)

Package Details

Repository
Rancher2 pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.