Skip to content

Resource: awsLbListenerCertificate

Provides a Load Balancer Listener Certificate resource.

This resource is for additional certificates and does not replace the default certificate on the listener.

\~> Note: awsAlbListenerCertificate is known as awsLbListenerCertificate. The functionality is identical.

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 awsAcmCertificateExample = new aws.acmCertificate.AcmCertificate(
  this,
  "example",
  {}
);
new aws.lb.Lb(this, "front_end", {});
const awsLbListenerFrontEnd = new aws.lbListener.LbListener(
  this,
  "front_end_2",
  {}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsLbListenerFrontEnd.overrideLogicalId("front_end");
const awsLbListenerCertificateExample =
  new aws.lbListenerCertificate.LbListenerCertificate(this, "example_3", {
    certificateArn: awsAcmCertificateExample.arn,
    listenerArn: awsLbListenerFrontEnd.arn,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsLbListenerCertificateExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • listenerArn - (Required, Forces New Resource) The ARN of the listener to which to attach the certificate.
  • certificateArn - (Required, Forces New Resource) The ARN of the certificate to attach to the listener.

Attributes Reference

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

  • id - The listenerArn and certificateArn separated by a _.

Import

Listener Certificates can be imported by using the listener arn and certificate arn, separated by an underscore (_), e.g.,

$ terraform import aws_lb_listener_certificate.example arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/test/8e4497da625e2d8a/9ab28ade35828f96/67b3d2d36dd7c26b_arn:aws:iam::123456789012:server-certificate/tf-acc-test-6453083910015726063