Skip to content

Resource: awsLightsailLbCertificate

Creates a Lightsail load balancer Certificate resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsLightsailLbTest = new aws.lightsailLb.LightsailLb(this, "test", {
  healthCheckPath: "/",
  instancePort: "80",
  name: "test-load-balancer",
  tags: {
    foo: "bar",
  },
});
const awsLightsailLbCertificateTest =
  new aws.lightsailLbCertificate.LightsailLbCertificate(this, "test_1", {
    domainName: "test.com",
    lbName: awsLightsailLbTest.id,
    name: "test-load-balancer-certificate",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsLightsailLbCertificateTest.overrideLogicalId("test");

Argument Reference

The following arguments are supported:

  • domainName - (Required) The domain name (e.g., example.com) for your SSL/TLS certificate.
  • lbName - (Required) The load balancer name where you want to create the SSL/TLS certificate.
  • name - (Required) The SSL/TLS certificate name.
  • name - (Required) The SSL/TLS certificate name.
  • subjectAlternativeNames - (Optional) Set of domains that should be SANs in the issued certificate. domainName attribute is automatically added as a Subject Alternative Name.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - A combination of attributes to create a unique id: lbName,name
  • arn - The ARN of the lightsail certificate.
  • createdAt - The timestamp when the instance was created.
  • domainValidationOptions - 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.

Import

awsLightsailLbCertificate can be imported by using the id attribute, e.g.,

$ terraform import aws_lightsail_lb_certificate.test example-load-balancer,example-load-balancer-certificate