Skip to content

Commit f290354

Browse files
authored
feat(s2svpn): support prefix filers update (#3611)
1 parent 2eabe0c commit f290354

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/services/s2svpn/routing_policy.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func routingPolicySchema() map[string]*schema.Schema {
5555
"prefix_filter_in": {
5656
Type: schema.TypeList,
5757
Optional: true,
58-
ForceNew: true,
5958
Description: "IP prefixes to accept from the peer (ranges of route announcements to accept)",
6059
Elem: &schema.Schema{
6160
Type: schema.TypeString,
@@ -65,7 +64,6 @@ func routingPolicySchema() map[string]*schema.Schema {
6564
"prefix_filter_out": {
6665
Type: schema.TypeList,
6766
Optional: true,
68-
ForceNew: true,
6967
Description: "IP prefix filters to advertise to the peer (ranges of routes to advertise)",
7068
Elem: &schema.Schema{
7169
Type: schema.TypeString,
@@ -195,6 +193,16 @@ func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m
195193
hasChanged = true
196194
}
197195

196+
if d.HasChange("prefix_filter_in") {
197+
req.PrefixFilterIn = types.ExpandStringsPtr(d.Get("prefix_filter_in"))
198+
hasChanged = true
199+
}
200+
201+
if d.HasChange("prefix_filter_out") {
202+
req.PrefixFilterOut = types.ExpandStringsPtr(d.Get("prefix_filter_out"))
203+
hasChanged = true
204+
}
205+
198206
if hasChanged {
199207
_, err = api.UpdateRoutingPolicy(req, scw.WithContext(ctx))
200208
if err != nil {

0 commit comments

Comments
 (0)