Skip to content

Commit 5962287

Browse files
committed
support acl from frontend resource too
1 parent 181a44f commit 5962287

File tree

5 files changed

+1564
-1530
lines changed

5 files changed

+1564
-1530
lines changed

internal/services/lb/acl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func resourceLbACLCreate(ctx context.Context, d *schema.ResourceData, m any) dia
174174
FrontendID: frontID,
175175
Name: d.Get("name").(string),
176176
Action: expandLbACLAction(d.Get("action")),
177-
Match: expandLbACLMatch(d, d.Get("match")),
177+
Match: expandLbACLMatch(d, d.Get("match"), 0),
178178
Index: int32(d.Get("index").(int)),
179179
Description: d.Get("description").(string),
180180
}
@@ -236,7 +236,7 @@ func resourceLbACLUpdate(ctx context.Context, d *schema.ResourceData, m any) dia
236236
Name: d.Get("name").(string),
237237
Action: expandLbACLAction(d.Get("action")),
238238
Index: int32(d.Get("index").(int)),
239-
Match: expandLbACLMatch(d, d.Get("match")),
239+
Match: expandLbACLMatch(d, d.Get("match"), 0),
240240
Description: types.ExpandUpdatedStringPtr(d.Get("description")),
241241
}
242242

internal/services/lb/frontend.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ func ResourceFrontend() *schema.Resource {
189189
Optional: true,
190190
Description: `If set to true, the condition will be of type "unless"`,
191191
},
192+
"ips_edge_services": {
193+
Type: schema.TypeBool,
194+
Optional: true,
195+
Description: `Defines whether Edge Services IPs should be matched`,
196+
},
192197
},
193198
},
194199
},
@@ -445,8 +450,8 @@ func expandsLBACLs(d *schema.ResourceData, raw any) []*lbSDK.ACL {
445450
r := raw.([]any)
446451
newACL := make([]*lbSDK.ACL, 0)
447452

448-
for _, rawACL := range r {
449-
newACL = append(newACL, expandLbACL(d, rawACL))
453+
for index, rawACL := range r {
454+
newACL = append(newACL, expandLbACL(d, rawACL, index))
450455
}
451456

452457
return newACL

0 commit comments

Comments
 (0)