Skip to content

Resource: awsLightsailLbCertificateAttachment

Attaches a Lightsail Load Balancer Certificate to a Lightsail Load Balancer.

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");
const awsLightsailLbCertificateAttachmentTest =
  new aws.lightsailLbCertificateAttachment.LightsailLbCertificateAttachment(
    this,
    "test_2",
    {
      certificateName: awsLightsailLbCertificateTest.name,
      lbName: awsLightsailLbTest.name,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsLightsailLbCertificateAttachmentTest.overrideLogicalId("test");

Argument Reference

The following arguments are supported:

  • lbName - (Required) The name of the load balancer to which you want to associate the SSL/TLS certificate.
  • certificateName - (Required) The name of your SSL/TLS certificate.

Attributes Reference

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

  • id - A combination of attributes to create a unique id: lbName,certificateName

Import

awsLightsailLbCertificateAttachment can be imported by using the name attribute, e.g.,

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