Skip to content

Resource: awsLightsailLb

Creates a Lightsail load balancer 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";
new aws.lightsailLb.LightsailLb(this, "test", {
  healthCheckPath: "/",
  instancePort: "80",
  name: "test-load-balancer",
  tags: {
    foo: "bar",
  },
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Lightsail load balancer.
  • instancePort - (Required) The instance port the load balancer will connect.
  • healthCheckPath - (Optional) The health check path of the load balancer. Default value "/".
  • tags - (Optional) A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

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

  • id - The name used for this load balancer (matches name).
  • arn - The ARN of the Lightsail load balancer.
  • createdAt - The timestamp when the load balancer was created.
  • dnsName - The DNS name of the load balancer.
  • protocol - The protocol of the load balancer.
  • publicPorts - The public ports of the load balancer.
  • supportCode - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

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

$ terraform import aws_lightsail_lb.test example-load-balancer