1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getCertificate
Hetzner Cloud v1.20.4 published on Tuesday, Sep 24, 2024 by Pulumi

hcloud.getCertificate

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.20.4 published on Tuesday, Sep 24, 2024 by Pulumi

    Provides details about a specific Hetzner Cloud Certificate.

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const sampleCertificate1 = hcloud.getCertificate({
        name: "sample-certificate-1",
    });
    const sampleCertificate2 = hcloud.getCertificate({
        id: 4711,
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    sample_certificate1 = hcloud.get_certificate(name="sample-certificate-1")
    sample_certificate2 = hcloud.get_certificate(id=4711)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := hcloud.LookupCertificate(ctx, &hcloud.LookupCertificateArgs{
    			Name: pulumi.StringRef("sample-certificate-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupCertificate(ctx, &hcloud.LookupCertificateArgs{
    			Id: pulumi.IntRef(4711),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var sampleCertificate1 = HCloud.GetCertificate.Invoke(new()
        {
            Name = "sample-certificate-1",
        });
    
        var sampleCertificate2 = HCloud.GetCertificate.Invoke(new()
        {
            Id = 4711,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.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 sampleCertificate1 = HcloudFunctions.getCertificate(GetCertificateArgs.builder()
                .name("sample-certificate-1")
                .build());
    
            final var sampleCertificate2 = HcloudFunctions.getCertificate(GetCertificateArgs.builder()
                .id("4711")
                .build());
    
        }
    }
    
    variables:
      sampleCertificate1:
        fn::invoke:
          Function: hcloud:getCertificate
          Arguments:
            name: sample-certificate-1
      sampleCertificate2:
        fn::invoke:
          Function: hcloud:getCertificate
          Arguments:
            id: '4711'
    

    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(id: Optional[int] = None,
                        name: Optional[str] = None,
                        with_selector: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetCertificateResult
    def get_certificate_output(id: Optional[pulumi.Input[int]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        with_selector: 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: hcloud:index/getCertificate:getCertificate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id int
    ID of the certificate.
    Name string
    Name of the certificate.
    WithSelector string
    Label selector
    Id int
    ID of the certificate.
    Name string
    Name of the certificate.
    WithSelector string
    Label selector
    id Integer
    ID of the certificate.
    name String
    Name of the certificate.
    withSelector String
    Label selector
    id number
    ID of the certificate.
    name string
    Name of the certificate.
    withSelector string
    Label selector
    id int
    ID of the certificate.
    name str
    Name of the certificate.
    with_selector str
    Label selector
    id Number
    ID of the certificate.
    name String
    Name of the certificate.
    withSelector String
    Label selector

    getCertificate Result

    The following output properties are available:

    Certificate string
    (string) PEM encoded TLS certificate.
    Created string
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    DomainNames List<string>
    (list) Domains and subdomains covered by the certificate.
    Fingerprint string
    (string) Fingerprint of the certificate.
    Id int
    (int) Unique ID of the certificate.
    Labels Dictionary<string, string>
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    NotValidAfter string
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    NotValidBefore string
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    Type string
    Name string
    (string) Name of the Certificate.
    WithSelector string
    Certificate string
    (string) PEM encoded TLS certificate.
    Created string
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    DomainNames []string
    (list) Domains and subdomains covered by the certificate.
    Fingerprint string
    (string) Fingerprint of the certificate.
    Id int
    (int) Unique ID of the certificate.
    Labels map[string]string
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    NotValidAfter string
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    NotValidBefore string
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    Type string
    Name string
    (string) Name of the Certificate.
    WithSelector string
    certificate String
    (string) PEM encoded TLS certificate.
    created String
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    domainNames List<String>
    (list) Domains and subdomains covered by the certificate.
    fingerprint String
    (string) Fingerprint of the certificate.
    id Integer
    (int) Unique ID of the certificate.
    labels Map<String,String>
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    notValidAfter String
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    notValidBefore String
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    type String
    name String
    (string) Name of the Certificate.
    withSelector String
    certificate string
    (string) PEM encoded TLS certificate.
    created string
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    domainNames string[]
    (list) Domains and subdomains covered by the certificate.
    fingerprint string
    (string) Fingerprint of the certificate.
    id number
    (int) Unique ID of the certificate.
    labels {[key: string]: string}
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    notValidAfter string
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    notValidBefore string
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    type string
    name string
    (string) Name of the Certificate.
    withSelector string
    certificate str
    (string) PEM encoded TLS certificate.
    created str
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    domain_names Sequence[str]
    (list) Domains and subdomains covered by the certificate.
    fingerprint str
    (string) Fingerprint of the certificate.
    id int
    (int) Unique ID of the certificate.
    labels Mapping[str, str]
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    not_valid_after str
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    not_valid_before str
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    type str
    name str
    (string) Name of the Certificate.
    with_selector str
    certificate String
    (string) PEM encoded TLS certificate.
    created String
    (string) Point in time when the Certificate was created at Hetzner Cloud (in ISO-8601 format).
    domainNames List<String>
    (list) Domains and subdomains covered by the certificate.
    fingerprint String
    (string) Fingerprint of the certificate.
    id Number
    (int) Unique ID of the certificate.
    labels Map<String>
    (map) User-defined labels (key-value pairs) assigned to the certificate.
    notValidAfter String
    (string) Point in time when the Certificate stops being valid (in ISO-8601 format).
    notValidBefore String
    (string) Point in time when the Certificate becomes valid (in ISO-8601 format).
    type String
    name String
    (string) Name of the Certificate.
    withSelector String

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.20.4 published on Tuesday, Sep 24, 2024 by Pulumi