[英]Failed to decode planned changes for aws_lb_listener
我正在嘗試使用aws_lb_listener
創建一個負載平衡的 EC2 和其中的一部分,該計划可以很好地創建,並且大致如下:
# aws_lb_listener.app will be created
+ resource "aws_lb_listener" "app" {
+ arn = (known after apply)
+ id = (known after apply)
+ load_balancer_arn = "arn:aws:elasticloadbalancing:xxx:xxx:loadbalancer/app/xxx-lb/xxx"
+ port = 80
+ protocol = "HTTP"
+ ssl_policy = (known after apply)
+ default_action {
+ order = (known after apply)
+ target_group_arn = "arn:aws:elasticloadbalancing:xxx:xxx:targetgroup/tf-xxx-lb/xxx"
+ type = "forward"
}
}
但是在申請時我收到錯誤消息:
Error: failed to decode planned changes for aws_lb_listener.app: error decoding ‘after’ value: an object with 10 attributes is required (9 given)
這是監聽器的實際定義:
resource "aws_lb_listener" "app" {
load_balancer_arn = aws_lb.app.arn
port = "80"
protocol = "HTTP"
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.blue.arn
}
}
這是負載均衡器的定義:
resource "aws_lb" "app" {
name = "xxx"
internal = false
load_balancer_type = "application"
subnets = module.vpc.public_subnets
security_groups = [module.lb_security_group.this_security_group_id]
}
請幫忙。
嘿發現了問題,這是使用舊 terraform (0.14.08) 和 aws 提供程序版本 (~3.0) 的問題。 將 terraform 更新到 (0.14.10) 和 aws provider (3.36.0) 解決了這個問題....
我認為錯誤消息可能更有幫助......:D
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.