1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. LbCertificate
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

aws.lightsail.LbCertificate

Explore with Pulumi AI

aws logo
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

    Manages a Lightsail Load Balancer Certificate.

    Use this resource to create and manage SSL/TLS certificates for Lightsail Load Balancers. The certificate must be validated before it can be attached to a load balancer to enable HTTPS traffic.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Lb("example", {
        name: "example-load-balancer",
        healthCheckPath: "/",
        instancePort: 80,
        tags: {
            foo: "bar",
        },
    });
    const exampleLbCertificate = new aws.lightsail.LbCertificate("example", {
        name: "example-load-balancer-certificate",
        lbName: example.id,
        domainName: "example.com",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Lb("example",
        name="example-load-balancer",
        health_check_path="/",
        instance_port=80,
        tags={
            "foo": "bar",
        })
    example_lb_certificate = aws.lightsail.LbCertificate("example",
        name="example-load-balancer-certificate",
        lb_name=example.id,
        domain_name="example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := lightsail.NewLb(ctx, "example", &lightsail.LbArgs{
    			Name:            pulumi.String("example-load-balancer"),
    			HealthCheckPath: pulumi.String("/"),
    			InstancePort:    pulumi.Int(80),
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lightsail.NewLbCertificate(ctx, "example", &lightsail.LbCertificateArgs{
    			Name:       pulumi.String("example-load-balancer-certificate"),
    			LbName:     example.ID(),
    			DomainName: pulumi.String("example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.LightSail.Lb("example", new()
        {
            Name = "example-load-balancer",
            HealthCheckPath = "/",
            InstancePort = 80,
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
        var exampleLbCertificate = new Aws.LightSail.LbCertificate("example", new()
        {
            Name = "example-load-balancer-certificate",
            LbName = example.Id,
            DomainName = "example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Lb;
    import com.pulumi.aws.lightsail.LbArgs;
    import com.pulumi.aws.lightsail.LbCertificate;
    import com.pulumi.aws.lightsail.LbCertificateArgs;
    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 example = new Lb("example", LbArgs.builder()
                .name("example-load-balancer")
                .healthCheckPath("/")
                .instancePort(80)
                .tags(Map.of("foo", "bar"))
                .build());
    
            var exampleLbCertificate = new LbCertificate("exampleLbCertificate", LbCertificateArgs.builder()
                .name("example-load-balancer-certificate")
                .lbName(example.id())
                .domainName("example.com")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Lb
        properties:
          name: example-load-balancer
          healthCheckPath: /
          instancePort: '80'
          tags:
            foo: bar
      exampleLbCertificate:
        type: aws:lightsail:LbCertificate
        name: example
        properties:
          name: example-load-balancer-certificate
          lbName: ${example.id}
          domainName: example.com
    

    Create LbCertificate Resource

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

    Constructor syntax

    new LbCertificate(name: string, args: LbCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def LbCertificate(resource_name: str,
                      args: LbCertificateArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def LbCertificate(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      lb_name: Optional[str] = None,
                      domain_name: Optional[str] = None,
                      name: Optional[str] = None,
                      subject_alternative_names: Optional[Sequence[str]] = None)
    func NewLbCertificate(ctx *Context, name string, args LbCertificateArgs, opts ...ResourceOption) (*LbCertificate, error)
    public LbCertificate(string name, LbCertificateArgs args, CustomResourceOptions? opts = null)
    public LbCertificate(String name, LbCertificateArgs args)
    public LbCertificate(String name, LbCertificateArgs args, CustomResourceOptions options)
    
    type: aws:lightsail:LbCertificate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LbCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args LbCertificateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args LbCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LbCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LbCertificateArgs
    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 lbCertificateResource = new Aws.LightSail.LbCertificate("lbCertificateResource", new()
    {
        LbName = "string",
        DomainName = "string",
        Name = "string",
        SubjectAlternativeNames = new[]
        {
            "string",
        },
    });
    
    example, err := lightsail.NewLbCertificate(ctx, "lbCertificateResource", &lightsail.LbCertificateArgs{
    	LbName:     pulumi.String("string"),
    	DomainName: pulumi.String("string"),
    	Name:       pulumi.String("string"),
    	SubjectAlternativeNames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var lbCertificateResource = new LbCertificate("lbCertificateResource", LbCertificateArgs.builder()
        .lbName("string")
        .domainName("string")
        .name("string")
        .subjectAlternativeNames("string")
        .build());
    
    lb_certificate_resource = aws.lightsail.LbCertificate("lbCertificateResource",
        lb_name="string",
        domain_name="string",
        name="string",
        subject_alternative_names=["string"])
    
    const lbCertificateResource = new aws.lightsail.LbCertificate("lbCertificateResource", {
        lbName: "string",
        domainName: "string",
        name: "string",
        subjectAlternativeNames: ["string"],
    });
    
    type: aws:lightsail:LbCertificate
    properties:
        domainName: string
        lbName: string
        name: string
        subjectAlternativeNames:
            - string
    

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

    LbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    Name string

    SSL/TLS certificate name.

    The following arguments are optional:

    SubjectAlternativeNames List<string>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    LbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    Name string

    SSL/TLS certificate name.

    The following arguments are optional:

    SubjectAlternativeNames []string
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    lbName String
    Load balancer name where you want to create the SSL/TLS certificate.
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    name String

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames List<String>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    lbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    domainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    name string

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames string[]
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    lb_name str
    Load balancer name where you want to create the SSL/TLS certificate.
    domain_name str
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    name str

    SSL/TLS certificate name.

    The following arguments are optional:

    subject_alternative_names Sequence[str]
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    lbName String
    Load balancer name where you want to create the SSL/TLS certificate.
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    name String

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames List<String>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.

    Outputs

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

    Arn string
    ARN of the lightsail certificate.
    CreatedAt string
    Timestamp when the instance was created.
    DomainValidationRecords List<LbCertificateDomainValidationRecord>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    Id string
    The provider-assigned unique ID for this managed resource.
    SupportCode string
    Support code for the certificate.
    Arn string
    ARN of the lightsail certificate.
    CreatedAt string
    Timestamp when the instance was created.
    DomainValidationRecords []LbCertificateDomainValidationRecord
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    Id string
    The provider-assigned unique ID for this managed resource.
    SupportCode string
    Support code for the certificate.
    arn String
    ARN of the lightsail certificate.
    createdAt String
    Timestamp when the instance was created.
    domainValidationRecords List<LbCertificateDomainValidationRecord>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    id String
    The provider-assigned unique ID for this managed resource.
    supportCode String
    Support code for the certificate.
    arn string
    ARN of the lightsail certificate.
    createdAt string
    Timestamp when the instance was created.
    domainValidationRecords LbCertificateDomainValidationRecord[]
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    id string
    The provider-assigned unique ID for this managed resource.
    supportCode string
    Support code for the certificate.
    arn str
    ARN of the lightsail certificate.
    created_at str
    Timestamp when the instance was created.
    domain_validation_records Sequence[LbCertificateDomainValidationRecord]
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    id str
    The provider-assigned unique ID for this managed resource.
    support_code str
    Support code for the certificate.
    arn String
    ARN of the lightsail certificate.
    createdAt String
    Timestamp when the instance was created.
    domainValidationRecords List<Property Map>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    id String
    The provider-assigned unique ID for this managed resource.
    supportCode String
    Support code for the certificate.

    Look up Existing LbCertificate Resource

    Get an existing LbCertificate 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?: LbCertificateState, opts?: CustomResourceOptions): LbCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            created_at: Optional[str] = None,
            domain_name: Optional[str] = None,
            domain_validation_records: Optional[Sequence[LbCertificateDomainValidationRecordArgs]] = None,
            lb_name: Optional[str] = None,
            name: Optional[str] = None,
            subject_alternative_names: Optional[Sequence[str]] = None,
            support_code: Optional[str] = None) -> LbCertificate
    func GetLbCertificate(ctx *Context, name string, id IDInput, state *LbCertificateState, opts ...ResourceOption) (*LbCertificate, error)
    public static LbCertificate Get(string name, Input<string> id, LbCertificateState? state, CustomResourceOptions? opts = null)
    public static LbCertificate get(String name, Output<String> id, LbCertificateState state, CustomResourceOptions options)
    resources:  _:    type: aws:lightsail:LbCertificate    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Arn string
    ARN of the lightsail certificate.
    CreatedAt string
    Timestamp when the instance was created.
    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    DomainValidationRecords List<LbCertificateDomainValidationRecord>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    LbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    Name string

    SSL/TLS certificate name.

    The following arguments are optional:

    SubjectAlternativeNames List<string>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    SupportCode string
    Support code for the certificate.
    Arn string
    ARN of the lightsail certificate.
    CreatedAt string
    Timestamp when the instance was created.
    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    DomainValidationRecords []LbCertificateDomainValidationRecordArgs
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    LbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    Name string

    SSL/TLS certificate name.

    The following arguments are optional:

    SubjectAlternativeNames []string
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    SupportCode string
    Support code for the certificate.
    arn String
    ARN of the lightsail certificate.
    createdAt String
    Timestamp when the instance was created.
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    domainValidationRecords List<LbCertificateDomainValidationRecord>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    lbName String
    Load balancer name where you want to create the SSL/TLS certificate.
    name String

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames List<String>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    supportCode String
    Support code for the certificate.
    arn string
    ARN of the lightsail certificate.
    createdAt string
    Timestamp when the instance was created.
    domainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    domainValidationRecords LbCertificateDomainValidationRecord[]
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    lbName string
    Load balancer name where you want to create the SSL/TLS certificate.
    name string

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames string[]
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    supportCode string
    Support code for the certificate.
    arn str
    ARN of the lightsail certificate.
    created_at str
    Timestamp when the instance was created.
    domain_name str
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    domain_validation_records Sequence[LbCertificateDomainValidationRecordArgs]
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    lb_name str
    Load balancer name where you want to create the SSL/TLS certificate.
    name str

    SSL/TLS certificate name.

    The following arguments are optional:

    subject_alternative_names Sequence[str]
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    support_code str
    Support code for the certificate.
    arn String
    ARN of the lightsail certificate.
    createdAt String
    Timestamp when the instance was created.
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    domainValidationRecords List<Property Map>
    Set of domain validation objects which can be used to complete certificate validation. Can have more than one element, e.g., if SANs are defined.
    lbName String
    Load balancer name where you want to create the SSL/TLS certificate.
    name String

    SSL/TLS certificate name.

    The following arguments are optional:

    subjectAlternativeNames List<String>
    Set of domains that should be SANs in the issued certificate. domain_name attribute is automatically added as a Subject Alternative Name.
    supportCode String
    Support code for the certificate.

    Supporting Types

    LbCertificateDomainValidationRecord, LbCertificateDomainValidationRecordArgs

    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    ResourceRecordName string
    ResourceRecordType string
    ResourceRecordValue string
    DomainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    ResourceRecordName string
    ResourceRecordType string
    ResourceRecordValue string
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    resourceRecordName String
    resourceRecordType String
    resourceRecordValue String
    domainName string
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    resourceRecordName string
    resourceRecordType string
    resourceRecordValue string
    domain_name str
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    resource_record_name str
    resource_record_type str
    resource_record_value str
    domainName String
    Domain name (e.g., example.com) for your SSL/TLS certificate.
    resourceRecordName String
    resourceRecordType String
    resourceRecordValue String

    Import

    Using pulumi import, import aws_lightsail_lb_certificate using the id attribute. For example:

    $ pulumi import aws:lightsail/lbCertificate:LbCertificate example example-load-balancer,example-load-balancer-certificate
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi