1 Answer
- Newest
- Most votes
- Most comments
0
It appears your variable data.terraform_remote_state.global.outputs.certificate_arn
is incorrect.
I recommend you do a 'terraform plan' from the command line to see what value is being applied to the aws_lb_listener.https.certificate_arn
attribute.
Here is my code where I use an ACM Certificate datasource to locate my certificate, and my terraform plan
output. Note the format of the output:
data "aws_acm_certificate" "amazon_issued_tyler" {
domain = "awstyler.myinternalhostname.aws.dev"
types = ["AMAZON_ISSUED"]
most_recent = true
}
resource "aws_lb_listener" "https" {
load_balancer_arn = aws_lb.main.arn
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-2016-08"
certificate_arn = data.aws_acm_certificate.amazon_issued_tyler.arn
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.main.arn
}
}
Plan Output:
# aws_lb_listener.https will be created
+ resource "aws_lb_listener" "https" {
+ arn = (known after apply)
+ certificate_arn = "arn:aws:acm:us-east-1:000000000000:certificate/00000000-e59e-4e8b-a45a-543f9d85c86d"
+ id = (known after apply)
+ load_balancer_arn = (known after apply)
+ port = 443
+ protocol = "HTTPS"
+ ssl_policy = "ELBSecurityPolicy-2016-08"
+ tags_all = (known after apply)
+ default_action {
+ order = (known after apply)
+ target_group_arn = (known after apply)
+ type = "forward"
}
}
answered a year ago
Relevant content
- Accepted Answerasked 2 years ago
- asked 2 years ago
- How can I troubleshoot issues when I use the AWS Load Balancer Controller to create a load balancer?AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 17 days ago
- AWS OFFICIALUpdated 3 months ago