AWS Elastic Load Balancing V2 Listener Certificate

This page shows how to write Terraform and CloudFormation for Elastic Load Balancing V2 Listener Certificate and write them securely.

aws_lb_listener_certificate (Terraform)

The Listener Certificate in Elastic Load Balancing V2 can be configured in Terraform with the resource name aws_lb_listener_certificate. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

alb-listener-certificates.tf#L1
resource "aws_lb_listener_certificate" "alb" {
  count           = var.alb ? length(var.extra_certificate_arns) : 0
  listener_arn    = element(aws_lb_listener.ecs_https.*.arn, 0)
  certificate_arn = var.extra_certificate_arns[count.index]
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Load Balancer Listener Certificate resource. This resource is for additional certificates and does not replace the default certificate on the listener.

Note: aws_alb_listener_certificate is known as aws_lb_listener_certificate. The functionality is identical.

AWS::ElasticLoadBalancingV2::ListenerCertificate (CloudFormation)

The ListenerCertificate in ElasticLoadBalancingV2 can be configured in CloudFormation with the resource name AWS::ElasticLoadBalancingV2::ListenerCertificate. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

Specifies an SSL server certificate to add to the certificate list for an HTTPS or TLS listener.

Frequently asked questions

What is AWS Elastic Load Balancing V2 Listener Certificate?

AWS Elastic Load Balancing V2 Listener Certificate is a resource for Elastic Load Balancing V2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Elastic Load Balancing V2 Listener Certificate?

For Terraform, the DNXLabs/terraform-aws-ecs source code example is useful. See the Terraform Example section for further details.