Skip to content

Commit

Permalink
Merge pull request #27464 from brittandeyoung/b-aws_lb_target_group-i…
Browse files Browse the repository at this point in the history
…p_address_type-

BugFix: Resolve import issues on `aws_lb_target_group` when specifying `ip_address_type` of `ipv4`
  • Loading branch information
ewbankkit committed Oct 25, 2022
2 parents 82408c7 + dd9433f commit e3c56e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/27464.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_lb_target_group: Fix import issues on `aws_lb_target_group` when specifying `ip_address_type` of `ipv4`
```
1 change: 1 addition & 0 deletions internal/service/elbv2/target_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ func flattenTargetGroupResource(d *schema.ResourceData, meta interface{}, target
d.Set("arn_suffix", TargetGroupSuffixFromARN(targetGroup.TargetGroupArn))
d.Set("name", targetGroup.TargetGroupName)
d.Set("target_type", targetGroup.TargetType)
d.Set("ip_address_type", targetGroup.IpAddressType)

if err := d.Set("health_check", flattenLbTargetGroupHealthCheck(targetGroup)); err != nil {
return fmt.Errorf("setting health_check: %w", err)
Expand Down
11 changes: 11 additions & 0 deletions internal/service/elbv2/target_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,17 @@ func TestAccELBV2TargetGroup_ipAddressType(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "ip_address_type", "ipv6"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"connection_termination",
"lambda_multi_value_headers_enabled",
"proxy_protocol_v2",
"slow_start",
},
},
},
})
}
Expand Down

0 comments on commit e3c56e8

Please sign in to comment.