Skip to content

Commit 323cffb

Browse files
committed
fix ipam test
1 parent 122db31 commit 323cffb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/services/ipam/ips_data_source.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func DataSourceIPAMIPsRead(ctx context.Context, d *schema.ResourceData, m any) d
158158
req := &ipam.ListIPsRequest{
159159
Region: region,
160160
ProjectID: types.ExpandStringPtr(d.Get("project_id")),
161-
Zonal: types.ExpandStringPtr(d.Get("zonal")),
162161
PrivateNetworkID: types.ExpandStringPtr(d.Get("private_network_id")),
163162
ResourceID: types.ExpandStringPtr(expandLastID(d.Get("resource.0.id"))),
164163
ResourceType: ipam.ResourceType(d.Get("resource.0.type").(string)),
@@ -168,6 +167,13 @@ func DataSourceIPAMIPsRead(ctx context.Context, d *schema.ResourceData, m any) d
168167
OrganizationID: types.ExpandStringPtr(d.Get("organization_id")),
169168
}
170169

170+
rawConfig, diagError := d.GetRawConfigAt(cty.GetAttrPath("zonal"))
171+
if diagError == nil && rawConfig.IsKnown() && !rawConfig.IsNull() {
172+
if rawConfig.AsString() != "" {
173+
req.Zonal = types.ExpandStringPtr(rawConfig.AsString())
174+
}
175+
}
176+
171177
attached, attachedExists := d.GetOk("attached")
172178
if attachedExists {
173179
req.Attached = types.ExpandBoolPtr(attached)

0 commit comments

Comments
 (0)