From 206c4c0aadc798fc6ee5a093c8e55d809ba49b70 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 28 Mar 2018 13:06:39 -0400 Subject: [PATCH] resource/aws_lb_target_group: Prevent crash from missing matcher during read --- aws/resource_aws_lb_target_group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_lb_target_group.go b/aws/resource_aws_lb_target_group.go index 072f52238d6..7222b853300 100644 --- a/aws/resource_aws_lb_target_group.go +++ b/aws/resource_aws_lb_target_group.go @@ -465,7 +465,7 @@ func flattenAwsLbTargetGroupResource(d *schema.ResourceData, meta interface{}, t if targetGroup.HealthCheckPath != nil { healthCheck["path"] = *targetGroup.HealthCheckPath } - if targetGroup.Matcher.HttpCode != nil { + if targetGroup.Matcher != nil && targetGroup.Matcher.HttpCode != nil { healthCheck["matcher"] = *targetGroup.Matcher.HttpCode }