1. Packages
  2. Scaleway
  3. API Docs
  4. getLoadbalancerCertificate
Scaleway v1.39.0 published on Thursday, Dec 4, 2025 by pulumiverse
scaleway logo
Scaleway v1.39.0 published on Thursday, Dec 4, 2025 by pulumiverse
    Deprecated: scaleway.index/getloadbalancercertificate.getLoadbalancerCertificate has been deprecated in favor of scaleway.loadbalancers/getcertificate.getCertificate

    Get information about Scaleway Load Balancer certificates.

    This data source can prove useful when a module accepts a Load Balancer certificate as an input variable and needs to, for example, determine the security of a certificate for the frontend associated with your domain.

    For more information, see the main documentation or API documentation.

    Examples

    Let’s Encrypt

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    import * as std from "@pulumi/std";
    
    const main = new scaleway.loadbalancers.Ip("main", {});
    const mainLoadBalancer = new scaleway.loadbalancers.LoadBalancer("main", {
        ipId: main.id,
        name: "data-test-lb-cert",
        type: "LB-S",
    });
    const mainCertificate = new scaleway.loadbalancers.Certificate("main", {
        lbId: mainLoadBalancer.id,
        name: "data-test-lb-cert",
        letsencrypt: {
            commonName: pulumi.all([mainLoadBalancer.ipAddress, mainLoadBalancer.region]).apply(([ipAddress, region]) => `${std.index.replace({
                text: ipAddress,
                search: ".",
                replace: "-",
            }).result}.lb.${region}.scw.cloud`),
        },
    });
    const byID = scaleway.loadbalancers.getCertificateOutput({
        certificateId: mainCertificate.id,
    });
    const byName = scaleway.loadbalancers.getCertificateOutput({
        name: mainCertificate.name,
        lbId: mainLoadBalancer.id,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumi_std as std
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.loadbalancers.Ip("main")
    main_load_balancer = scaleway.loadbalancers.LoadBalancer("main",
        ip_id=main.id,
        name="data-test-lb-cert",
        type="LB-S")
    main_certificate = scaleway.loadbalancers.Certificate("main",
        lb_id=main_load_balancer.id,
        name="data-test-lb-cert",
        letsencrypt={
            "common_name": pulumi.Output.all(
                ip_address=main_load_balancer.ip_address,
                region=main_load_balancer.region
    ).apply(lambda resolved_outputs: f"{std.index.replace(text=resolved_outputs['ip_address'],
                search='.',
                replace='-')['result']}.lb.{resolved_outputs['region']}.scw.cloud")
    ,
        })
    by_id = scaleway.loadbalancers.get_certificate_output(certificate_id=main_certificate.id)
    by_name = scaleway.loadbalancers.get_certificate_output(name=main_certificate.name,
        lb_id=main_load_balancer.id)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/loadbalancers"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    main, err := loadbalancers.NewIp(ctx, "main", nil)
    if err != nil {
    return err
    }
    mainLoadBalancer, err := loadbalancers.NewLoadBalancer(ctx, "main", &loadbalancers.LoadBalancerArgs{
    IpId: main.ID(),
    Name: pulumi.String("data-test-lb-cert"),
    Type: pulumi.String("LB-S"),
    })
    if err != nil {
    return err
    }
    invokeReplace, err := std.Replace(ctx, map[string]interface{}{
    "text": ipAddress,
    "search": ".",
    "replace": "-",
    }, nil)
    if err != nil {
    return err
    }
    mainCertificate, err := loadbalancers.NewCertificate(ctx, "main", &loadbalancers.CertificateArgs{
    LbId: mainLoadBalancer.ID(),
    Name: pulumi.String("data-test-lb-cert"),
    Letsencrypt: &loadbalancers.CertificateLetsencryptArgs{
    CommonName: pulumi.All(mainLoadBalancer.IpAddress,mainLoadBalancer.Region).ApplyT(func(_args []interface{}) (string, error) {
    ipAddress := _args[0].(string)
    region := _args[1].(string)
    %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
    },
    })
    if err != nil {
    return err
    }
    _ = loadbalancers.LookupCertificateOutput(ctx, loadbalancers.GetCertificateOutputArgs{
    CertificateId: mainCertificate.ID(),
    }, nil);
    _ = loadbalancers.LookupCertificateOutput(ctx, loadbalancers.GetCertificateOutputArgs{
    Name: mainCertificate.Name,
    LbId: mainLoadBalancer.ID(),
    }, nil);
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.Loadbalancers.Ip("main");
    
        var mainLoadBalancer = new Scaleway.Loadbalancers.LoadBalancer("main", new()
        {
            IpId = main.Id,
            Name = "data-test-lb-cert",
            Type = "LB-S",
        });
    
        var mainCertificate = new Scaleway.Loadbalancers.Certificate("main", new()
        {
            LbId = mainLoadBalancer.Id,
            Name = "data-test-lb-cert",
            Letsencrypt = new Scaleway.Loadbalancers.Inputs.CertificateLetsencryptArgs
            {
                CommonName = Output.Tuple(mainLoadBalancer.IpAddress, mainLoadBalancer.Region).Apply(values =>
                {
                    var ipAddress = values.Item1;
                    var region = values.Item2;
                    return $"{Std.Index.Replace.Invoke(new()
                    {
                        Text = ipAddress,
                        Search = ".",
                        Replace = "-",
                    }).Result}.lb.{region}.scw.cloud";
                }),
            },
        });
    
        var byID = Scaleway.Loadbalancers.GetCertificate.Invoke(new()
        {
            CertificateId = mainCertificate.Id,
        });
    
        var byName = Scaleway.Loadbalancers.GetCertificate.Invoke(new()
        {
            Name = mainCertificate.Name,
            LbId = mainLoadBalancer.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.loadbalancers.Ip;
    import com.pulumi.scaleway.loadbalancers.LoadBalancer;
    import com.pulumi.scaleway.loadbalancers.LoadBalancerArgs;
    import com.pulumi.scaleway.loadbalancers.Certificate;
    import com.pulumi.scaleway.loadbalancers.CertificateArgs;
    import com.pulumi.scaleway.loadbalancers.inputs.CertificateLetsencryptArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.scaleway.loadbalancers.LoadbalancersFunctions;
    import com.pulumi.scaleway.loadbalancers.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) {
            var main = new Ip("main");
    
            var mainLoadBalancer = new LoadBalancer("mainLoadBalancer", LoadBalancerArgs.builder()
                .ipId(main.id())
                .name("data-test-lb-cert")
                .type("LB-S")
                .build());
    
            var mainCertificate = new Certificate("mainCertificate", CertificateArgs.builder()
                .lbId(mainLoadBalancer.id())
                .name("data-test-lb-cert")
                .letsencrypt(CertificateLetsencryptArgs.builder()
                    .commonName(Output.tuple(mainLoadBalancer.ipAddress(), mainLoadBalancer.region()).applyValue(values -> {
                        var ipAddress = values.t1;
                        var region = values.t2;
                        return String.format("%s.lb.%s.scw.cloud", StdFunctions.replace(Map.ofEntries(
                            Map.entry("text", ipAddress),
                            Map.entry("search", "."),
                            Map.entry("replace", "-")
                        )).result(),region);
                    }))
                    .build())
                .build());
    
            final var byID = LoadbalancersFunctions.getCertificate(GetCertificateArgs.builder()
                .certificateId(mainCertificate.id())
                .build());
    
            final var byName = LoadbalancersFunctions.getCertificate(GetCertificateArgs.builder()
                .name(mainCertificate.name())
                .lbId(mainLoadBalancer.id())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:loadbalancers:Ip
      mainLoadBalancer:
        type: scaleway:loadbalancers:LoadBalancer
        name: main
        properties:
          ipId: ${main.id}
          name: data-test-lb-cert
          type: LB-S
      mainCertificate:
        type: scaleway:loadbalancers:Certificate
        name: main
        properties:
          lbId: ${mainLoadBalancer.id}
          name: data-test-lb-cert
          letsencrypt:
            commonName:
              fn::join:
                - ""
                - - fn::invoke:
                      function: std:replace
                      arguments:
                        text: ${mainLoadBalancer.ipAddress}
                        search: .
                        replace: '-'
                      return: result
                  - .lb.
                  - ${mainLoadBalancer.region}
                  - .scw.cloud
    variables:
      byID:
        fn::invoke:
          function: scaleway:loadbalancers:getCertificate
          arguments:
            certificateId: ${mainCertificate.id}
      byName:
        fn::invoke:
          function: scaleway:loadbalancers:getCertificate
          arguments:
            name: ${mainCertificate.name}
            lbId: ${mainLoadBalancer.id}
    

    Using getLoadbalancerCertificate

    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 getLoadbalancerCertificate(args: GetLoadbalancerCertificateArgs, opts?: InvokeOptions): Promise<GetLoadbalancerCertificateResult>
    function getLoadbalancerCertificateOutput(args: GetLoadbalancerCertificateOutputArgs, opts?: InvokeOptions): Output<GetLoadbalancerCertificateResult>
    def get_loadbalancer_certificate(certificate_id: Optional[str] = None,
                                     lb_id: Optional[str] = None,
                                     name: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetLoadbalancerCertificateResult
    def get_loadbalancer_certificate_output(certificate_id: Optional[pulumi.Input[str]] = None,
                                     lb_id: Optional[pulumi.Input[str]] = None,
                                     name: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetLoadbalancerCertificateResult]
    func LookupLoadbalancerCertificate(ctx *Context, args *LookupLoadbalancerCertificateArgs, opts ...InvokeOption) (*LookupLoadbalancerCertificateResult, error)
    func LookupLoadbalancerCertificateOutput(ctx *Context, args *LookupLoadbalancerCertificateOutputArgs, opts ...InvokeOption) LookupLoadbalancerCertificateResultOutput

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

    public static class GetLoadbalancerCertificate 
    {
        public static Task<GetLoadbalancerCertificateResult> InvokeAsync(GetLoadbalancerCertificateArgs args, InvokeOptions? opts = null)
        public static Output<GetLoadbalancerCertificateResult> Invoke(GetLoadbalancerCertificateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLoadbalancerCertificateResult> getLoadbalancerCertificate(GetLoadbalancerCertificateArgs args, InvokeOptions options)
    public static Output<GetLoadbalancerCertificateResult> getLoadbalancerCertificate(GetLoadbalancerCertificateArgs args, InvokeOptions options)
    
    fn::invoke:
      function: scaleway:index/getLoadbalancerCertificate:getLoadbalancerCertificate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CertificateId string
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    LbId string
    The Load Balancer ID this certificate is attached to.
    Name string
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id
    CertificateId string
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    LbId string
    The Load Balancer ID this certificate is attached to.
    Name string
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id
    certificateId String
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    lbId String
    The Load Balancer ID this certificate is attached to.
    name String
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id
    certificateId string
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    lbId string
    The Load Balancer ID this certificate is attached to.
    name string
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id
    certificate_id str
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    lb_id str
    The Load Balancer ID this certificate is attached to.
    name str
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id
    certificateId String
    The certificate ID.

    • Only one of name and certificate_id should be specified.
    lbId String
    The Load Balancer ID this certificate is attached to.
    name String
    The name of the Load Balancer certificate.

    • When using a certificate name you should specify the lb-id

    getLoadbalancerCertificate Result

    The following output properties are available:

    commonName String
    customCertificates List<Property Map>
    fingerprint String
    id String
    The provider-assigned unique ID for this managed resource.
    letsencrypts List<Property Map>
    notValidAfter String
    notValidBefore String
    status String
    subjectAlternativeNames List<String>
    certificateId String
    lbId String
    name String

    Supporting Types

    GetLoadbalancerCertificateCustomCertificate

    CertificateChain string
    The full PEM-formatted certificate chain
    CertificateChain string
    The full PEM-formatted certificate chain
    certificateChain String
    The full PEM-formatted certificate chain
    certificateChain string
    The full PEM-formatted certificate chain
    certificate_chain str
    The full PEM-formatted certificate chain
    certificateChain String
    The full PEM-formatted certificate chain

    GetLoadbalancerCertificateLetsencrypt

    CommonName string
    The main domain name of the certificate
    SubjectAlternativeNames List<string>
    The alternative domain names of the certificate
    CommonName string
    The main domain name of the certificate
    SubjectAlternativeNames []string
    The alternative domain names of the certificate
    commonName String
    The main domain name of the certificate
    subjectAlternativeNames List<String>
    The alternative domain names of the certificate
    commonName string
    The main domain name of the certificate
    subjectAlternativeNames string[]
    The alternative domain names of the certificate
    common_name str
    The main domain name of the certificate
    subject_alternative_names Sequence[str]
    The alternative domain names of the certificate
    commonName String
    The main domain name of the certificate
    subjectAlternativeNames List<String>
    The alternative domain names of the certificate

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.39.0 published on Thursday, Dec 4, 2025 by pulumiverse
      Meet Neo: Your AI Platform Teammate