1. Packages
  2. Digitalocean Provider
  3. API Docs
  4. getCertificate
DigitalOcean v4.35.1 published on Monday, Nov 25, 2024 by Pulumi

digitalocean.getCertificate

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.35.1 published on Monday, Nov 25, 2024 by Pulumi

    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:

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = digitalocean.getCertificate({
        name: "example",
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.get_certificate(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, &digitalocean.LookupCertificateArgs{
    			Name: "example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var example = DigitalOcean.GetCertificate.Invoke(new()
        {
            Name = "example",
        });
    
    });
    
    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());
    
        }
    }
    
    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>
    Domains for which the certificate was issued.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    NotAfter string
    The expiration date and time of the certificate.
    Sha1Fingerprint string
    The SHA1 fingerprint of the certificate.
    State string
    the current state of the certificate.
    Type string
    The type of the certificate.
    Uuid string
    The ID of the certificate.
    Domains []string
    Domains for which the certificate was issued.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    NotAfter string
    The expiration date and time of the certificate.
    Sha1Fingerprint string
    The SHA1 fingerprint of the certificate.
    State string
    the current state of the certificate.
    Type string
    The type of the certificate.
    Uuid string
    The ID of the certificate.
    domains List<String>
    Domains for which the certificate was issued.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    notAfter String
    The expiration date and time of the certificate.
    sha1Fingerprint String
    The SHA1 fingerprint of the certificate.
    state String
    the current state of the certificate.
    type String
    The type of the certificate.
    uuid String
    The ID of the certificate.
    domains string[]
    Domains for which the certificate was issued.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    notAfter string
    The expiration date and time of the certificate.
    sha1Fingerprint string
    The SHA1 fingerprint of the certificate.
    state string
    the current state of the certificate.
    type string
    The type of the certificate.
    uuid string
    The ID of the certificate.
    domains Sequence[str]
    Domains for which the certificate was issued.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    not_after str
    The expiration date and time of the certificate.
    sha1_fingerprint str
    The SHA1 fingerprint of the certificate.
    state str
    the current state of the certificate.
    type str
    The type of the certificate.
    uuid str
    The ID of the certificate.
    domains List<String>
    Domains for which the certificate was issued.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    notAfter String
    The expiration date and time of the certificate.
    sha1Fingerprint String
    The SHA1 fingerprint of the certificate.
    state String
    the current state of the certificate.
    type String
    The type of the certificate.
    uuid String
    The ID of the certificate.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.35.1 published on Monday, Nov 25, 2024 by Pulumi