getCertificate

Get information on a certificate. This data source provides the name, type, state, domains, expiry date, and the sha1 fingerprint as configured on your DigitalOcean account. This is useful if the certificate in question is not managed by this provider or you need to utilize any of the certificates data.

An error is triggered if the provided certificate name does not exist.

Example Usage

Get the certificate

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var example = DigitalOcean.GetCertificate.Invoke(new()
    {
        Name = "example",
    });

});
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.LookupCertificate(ctx, &GetCertificateArgs{
			Name: "example",
		}, nil)
		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.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetCertificateArgs;
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) {
        final var example = DigitaloceanFunctions.getCertificate(GetCertificateArgs.builder()
            .name("example")
            .build());

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_certificate(name="example")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = pulumi.output(digitalocean.getCertificate({
    name: "example",
}));
variables:
  example:
    Fn::Invoke:
      Function: digitalocean:getCertificate
      Arguments:
        name: example

Using getCertificate

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getCertificate(args: GetCertificateArgs, opts?: InvokeOptions): Promise<GetCertificateResult>
function getCertificateOutput(args: GetCertificateOutputArgs, opts?: InvokeOptions): Output<GetCertificateResult>
def get_certificate(name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetCertificateResult
def get_certificate_output(name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetCertificateResult]
func LookupCertificate(ctx *Context, args *LookupCertificateArgs, opts ...InvokeOption) (*LookupCertificateResult, error)
func LookupCertificateOutput(ctx *Context, args *LookupCertificateOutputArgs, opts ...InvokeOption) LookupCertificateResultOutput

> Note: This function is named LookupCertificate in the Go SDK.

public static class GetCertificate 
{
    public static Task<GetCertificateResult> InvokeAsync(GetCertificateArgs args, InvokeOptions? opts = null)
    public static Output<GetCertificateResult> Invoke(GetCertificateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCertificateResult> getCertificate(GetCertificateArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: digitalocean:index/getCertificate:getCertificate
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of certificate.

Name string

The name of certificate.

name String

The name of certificate.

name string

The name of certificate.

name str

The name of certificate.

name String

The name of certificate.

getCertificate Result

The following output properties are available:

Domains List<string>
Id string

The provider-assigned unique ID for this managed resource.

Name string
NotAfter string
Sha1Fingerprint string
State string
Type string
Uuid string
Domains []string
Id string

The provider-assigned unique ID for this managed resource.

Name string
NotAfter string
Sha1Fingerprint string
State string
Type string
Uuid string
domains List<String>
id String

The provider-assigned unique ID for this managed resource.

name String
notAfter String
sha1Fingerprint String
state String
type String
uuid String
domains string[]
id string

The provider-assigned unique ID for this managed resource.

name string
notAfter string
sha1Fingerprint string
state string
type string
uuid string
domains Sequence[str]
id str

The provider-assigned unique ID for this managed resource.

name str
not_after str
sha1_fingerprint str
state str
type str
uuid str
domains List<String>
id String

The provider-assigned unique ID for this managed resource.

name String
notAfter String
sha1Fingerprint String
state String
type String
uuid String

Package Details

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

This Pulumi package is based on the digitalocean Terraform Provider.