Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix: Resolve import issues on aws_lb_target_group when specifying ip_address_type of ipv4 #27464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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