aws.lightsail.LbCertificate
Explore with Pulumi AI
Creates a Lightsail load balancer Certificate resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.lightsail.Lb("test", {
    name: "test-load-balancer",
    healthCheckPath: "/",
    instancePort: 80,
    tags: {
        foo: "bar",
    },
});
const testLbCertificate = new aws.lightsail.LbCertificate("test", {
    name: "test-load-balancer-certificate",
    lbName: test.id,
    domainName: "test.com",
});
import pulumi
import pulumi_aws as aws
test = aws.lightsail.Lb("test",
    name="test-load-balancer",
    health_check_path="/",
    instance_port=80,
    tags={
        "foo": "bar",
    })
test_lb_certificate = aws.lightsail.LbCertificate("test",
    name="test-load-balancer-certificate",
    lb_name=test.id,
    domain_name="test.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 {
		test, err := lightsail.NewLb(ctx, "test", &lightsail.LbArgs{
			Name:            pulumi.String("test-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, "test", &lightsail.LbCertificateArgs{
			Name:       pulumi.String("test-load-balancer-certificate"),
			LbName:     test.ID(),
			DomainName: pulumi.String("test.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 test = new Aws.LightSail.Lb("test", new()
    {
        Name = "test-load-balancer",
        HealthCheckPath = "/",
        InstancePort = 80,
        Tags = 
        {
            { "foo", "bar" },
        },
    });
    var testLbCertificate = new Aws.LightSail.LbCertificate("test", new()
    {
        Name = "test-load-balancer-certificate",
        LbName = test.Id,
        DomainName = "test.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 test = new Lb("test", LbArgs.builder()
            .name("test-load-balancer")
            .healthCheckPath("/")
            .instancePort("80")
            .tags(Map.of("foo", "bar"))
            .build());
        var testLbCertificate = new LbCertificate("testLbCertificate", LbCertificateArgs.builder()
            .name("test-load-balancer-certificate")
            .lbName(test.id())
            .domainName("test.com")
            .build());
    }
}
resources:
  test:
    type: aws:lightsail:Lb
    properties:
      name: test-load-balancer
      healthCheckPath: /
      instancePort: '80'
      tags:
        foo: bar
  testLbCertificate:
    type: aws:lightsail:LbCertificate
    name: test
    properties:
      name: test-load-balancer-certificate
      lbName: ${test.id}
      domainName: test.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
- The load balancer name where you want to create the SSL/TLS certificate.
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- Name string
- The SSL/TLS certificate name.
- SubjectAlternative List<string>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- LbName string
- The load balancer name where you want to create the SSL/TLS certificate.
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- Name string
- The SSL/TLS certificate name.
- SubjectAlternative []stringNames 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- lbName String
- The load balancer name where you want to create the SSL/TLS certificate.
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- name String
- The SSL/TLS certificate name.
- subjectAlternative List<String>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- lbName string
- The load balancer name where you want to create the SSL/TLS certificate.
- domainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- name string
- The SSL/TLS certificate name.
- subjectAlternative string[]Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- lb_name str
- The load balancer name where you want to create the SSL/TLS certificate.
- domain_name str
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- name str
- The SSL/TLS certificate name.
- subject_alternative_ Sequence[str]names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- lbName String
- The load balancer name where you want to create the SSL/TLS certificate.
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- name String
- The SSL/TLS certificate name.
- subjectAlternative List<String>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute 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
- The ARN of the lightsail certificate.
- CreatedAt string
- The timestamp when the instance was created.
- DomainValidation List<LbRecords Certificate Domain Validation Record> 
- Id string
- The provider-assigned unique ID for this managed resource.
- SupportCode string
- Arn string
- The ARN of the lightsail certificate.
- CreatedAt string
- The timestamp when the instance was created.
- DomainValidation []LbRecords Certificate Domain Validation Record 
- Id string
- The provider-assigned unique ID for this managed resource.
- SupportCode string
- arn String
- The ARN of the lightsail certificate.
- createdAt String
- The timestamp when the instance was created.
- domainValidation List<LbRecords Certificate Domain Validation Record> 
- id String
- The provider-assigned unique ID for this managed resource.
- supportCode String
- arn string
- The ARN of the lightsail certificate.
- createdAt string
- The timestamp when the instance was created.
- domainValidation LbRecords Certificate Domain Validation Record[] 
- id string
- The provider-assigned unique ID for this managed resource.
- supportCode string
- arn str
- The ARN of the lightsail certificate.
- created_at str
- The timestamp when the instance was created.
- domain_validation_ Sequence[Lbrecords Certificate Domain Validation Record] 
- id str
- The provider-assigned unique ID for this managed resource.
- support_code str
- arn String
- The ARN of the lightsail certificate.
- createdAt String
- The timestamp when the instance was created.
- domainValidation List<Property Map>Records 
- id String
- The provider-assigned unique ID for this managed resource.
- supportCode String
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) -> LbCertificatefunc 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.
- Arn string
- The ARN of the lightsail certificate.
- CreatedAt string
- The timestamp when the instance was created.
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- DomainValidation List<LbRecords Certificate Domain Validation Record> 
- LbName string
- The load balancer name where you want to create the SSL/TLS certificate.
- Name string
- The SSL/TLS certificate name.
- SubjectAlternative List<string>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- SupportCode string
- Arn string
- The ARN of the lightsail certificate.
- CreatedAt string
- The timestamp when the instance was created.
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- DomainValidation []LbRecords Certificate Domain Validation Record Args 
- LbName string
- The load balancer name where you want to create the SSL/TLS certificate.
- Name string
- The SSL/TLS certificate name.
- SubjectAlternative []stringNames 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- SupportCode string
- arn String
- The ARN of the lightsail certificate.
- createdAt String
- The timestamp when the instance was created.
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- domainValidation List<LbRecords Certificate Domain Validation Record> 
- lbName String
- The load balancer name where you want to create the SSL/TLS certificate.
- name String
- The SSL/TLS certificate name.
- subjectAlternative List<String>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- supportCode String
- arn string
- The ARN of the lightsail certificate.
- createdAt string
- The timestamp when the instance was created.
- domainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- domainValidation LbRecords Certificate Domain Validation Record[] 
- lbName string
- The load balancer name where you want to create the SSL/TLS certificate.
- name string
- The SSL/TLS certificate name.
- subjectAlternative string[]Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- supportCode string
- arn str
- The ARN of the lightsail certificate.
- created_at str
- The timestamp when the instance was created.
- domain_name str
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- domain_validation_ Sequence[Lbrecords Certificate Domain Validation Record Args] 
- lb_name str
- The load balancer name where you want to create the SSL/TLS certificate.
- name str
- The SSL/TLS certificate name.
- subject_alternative_ Sequence[str]names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- support_code str
- arn String
- The ARN of the lightsail certificate.
- createdAt String
- The timestamp when the instance was created.
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- domainValidation List<Property Map>Records 
- lbName String
- The load balancer name where you want to create the SSL/TLS certificate.
- name String
- The SSL/TLS certificate name.
- subjectAlternative List<String>Names 
- Set of domains that should be SANs in the issued certificate. domain_nameattribute is automatically added as a Subject Alternative Name.
- supportCode String
Supporting Types
LbCertificateDomainValidationRecord, LbCertificateDomainValidationRecordArgs          
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- ResourceRecord stringName 
- ResourceRecord stringType 
- ResourceRecord stringValue 
- DomainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- ResourceRecord stringName 
- ResourceRecord stringType 
- ResourceRecord stringValue 
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- resourceRecord StringName 
- resourceRecord StringType 
- resourceRecord StringValue 
- domainName string
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- resourceRecord stringName 
- resourceRecord stringType 
- resourceRecord stringValue 
- domain_name str
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- resource_record_ strname 
- resource_record_ strtype 
- resource_record_ strvalue 
- domainName String
- The domain name (e.g., example.com) for your SSL/TLS certificate.
- resourceRecord StringName 
- resourceRecord StringType 
- resourceRecord StringValue 
Import
Using pulumi import, import aws_lightsail_lb_certificate using the id attribute. For example:
$ pulumi import aws:lightsail/lbCertificate:LbCertificate test 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 awsTerraform Provider.