Skip to content

Commit

Permalink
Merge pull request #4317 from loivis/ds-lb-listener
Browse files Browse the repository at this point in the history
data-source/lb_listener: set optional arguments as computed
  • Loading branch information
bflad authored Apr 23, 2018
2 parents 05e39f3 + 58686cc commit bd91f3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aws/data_source_aws_lb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ func dataSourceAwsLbListener() *schema.Resource {
"arn": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ConflictsWith: []string{"load_balancer_arn", "port"},
},

"load_balancer_arn": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ConflictsWith: []string{"arn"},
},
"port": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
ConflictsWith: []string{"arn"},
},

Expand Down
12 changes: 12 additions & 0 deletions aws/data_source_aws_lb_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ data "aws_lb_listener" "from_lb_and_port" {
load_balancer_arn = "${aws_lb.alb_test.arn}"
port = "${aws_lb_listener.front_end.port}"
}
output "front_end_load_balancer_arn" {
value = "${data.aws_lb_listener.front_end.load_balancer_arn}"
}
output "front_end_port" {
value = "${data.aws_lb_listener.front_end.port}"
}
output "from_lb_and_port_arn" {
value = "${data.aws_lb_listener.from_lb_and_port.arn}"
}
`, lbName, targetGroupName)
}

Expand Down

0 comments on commit bd91f3a

Please sign in to comment.