Skip to content

Commit 1f1dda7

Browse files
authored
feat(s2s_vpn): support single tunnel ip auto-alloc (#5321)
1 parent 3d8e361 commit 1f1dda7

File tree

5 files changed

+46
-14
lines changed

5 files changed

+46
-14
lines changed

cmd/scw/testdata/test-all-usage-s2s-vpn-vpn-gateway-create-usage.golden

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ USAGE:
66
scw s2s-vpn vpn-gateway create [arg=value ...]
77

88
ARGS:
9-
[project-id] Project ID to use. If none is passed the default project ID will be used
10-
name Name of the VPN gateway
11-
[tags.{index}] List of tags to apply to the VPN gateway
12-
gateway-type VPN gateway type (commercial offer type)
13-
[public-config.ipam-ipv4-id]
14-
[public-config.ipam-ipv6-id]
15-
private-network-id ID of the Private Network to attach to the VPN gateway
16-
[ipam-private-ipv4-id] ID of the IPAM private IPv4 address to attach to the VPN gateway
17-
[ipam-private-ipv6-id] ID of the IPAM private IPv6 address to attach to the VPN gateway
18-
[zone] Availability Zone where the VPN gateway should be provisioned. If no zone is specified, the VPN gateway will be automatically placed.
19-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
[project-id] Project ID to use. If none is passed the default project ID will be used
10+
name Name of the VPN gateway
11+
[tags.{index}] List of tags to apply to the VPN gateway
12+
gateway-type VPN gateway type (commercial offer type)
13+
[public-config.ipam-ipv4-id]
14+
[public-config.ipam-ipv6-id]
15+
private-network-id ID of the Private Network to attach to the VPN gateway
16+
[public-tunnel-config.single-ipv4-tunnel.ipam-id]
17+
[public-tunnel-config.single-ipv6-tunnel.ipam-id]
18+
[public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv4-id]
19+
[public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv6-id]
20+
[ipam-private-ipv4-id] ID of the IPAM private IPv4 address to attach to the VPN gateway
21+
[ipam-private-ipv6-id] ID of the IPAM private IPv6 address to attach to the VPN gateway
22+
[zone] Availability Zone where the VPN gateway should be provisioned. If no zone is specified, the VPN gateway will be automatically placed.
23+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2024

2125
FLAGS:
2226
-h, --help help for create

docs/commands/s2s-vpn.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ scw s2s-vpn vpn-gateway create [arg=value ...]
547547
| public-config.ipam-ipv4-id | | |
548548
| public-config.ipam-ipv6-id | | |
549549
| private-network-id | Required | ID of the Private Network to attach to the VPN gateway |
550+
| public-tunnel-config.single-ipv4-tunnel.ipam-id | | |
551+
| public-tunnel-config.single-ipv6-tunnel.ipam-id | | |
552+
| public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv4-id | | |
553+
| public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv6-id | | |
550554
| ipam-private-ipv4-id | | ID of the IPAM private IPv4 address to attach to the VPN gateway |
551555
| ipam-private-ipv6-id | | ID of the IPAM private IPv6 address to attach to the VPN gateway |
552556
| zone | | Availability Zone where the VPN gateway should be provisioned. If no zone is specified, the VPN gateway will be automatically placed. |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.26.3
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260205134439-552c4fd7bb15
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260206103045-4df7d84ec970
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.10.2
2929
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
468468
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
469469
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
470470
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
471-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260205134439-552c4fd7bb15 h1:1TEkXowNZybCaCrgTA+id+AjsPGt3n0xiTPBuaUgoTo=
472-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260205134439-552c4fd7bb15/go.mod h1:VbEqG0nAXcEFyHLKWwbhgbDNimnLf24Qat73/12DU9o=
471+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260206103045-4df7d84ec970 h1:A/OcpyqcTj9J2al+2jXbAfcR5CHG6iKpxzWTaNUnj14=
472+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260206103045-4df7d84ec970/go.mod h1:VbEqG0nAXcEFyHLKWwbhgbDNimnLf24Qat73/12DU9o=
473473
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
474474
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
475475
github.com/secure-systems-lab/go-securesystemslib v0.9.1 h1:nZZaNz4DiERIQguNy0cL5qTdn9lR8XKHf4RUyG1Sx3g=

internal/namespaces/s2s_vpn/v1alpha1/s2s_vpn_cli.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,30 @@ func s2sVpnVpnGatewayCreate() *core.Command {
341341
Deprecated: false,
342342
Positional: false,
343343
},
344+
{
345+
Name: "public-tunnel-config.single-ipv4-tunnel.ipam-id",
346+
Required: false,
347+
Deprecated: false,
348+
Positional: false,
349+
},
350+
{
351+
Name: "public-tunnel-config.single-ipv6-tunnel.ipam-id",
352+
Required: false,
353+
Deprecated: false,
354+
Positional: false,
355+
},
356+
{
357+
Name: "public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv4-id",
358+
Required: false,
359+
Deprecated: false,
360+
Positional: false,
361+
},
362+
{
363+
Name: "public-tunnel-config.dual-ipv4v6-tunnel.ipam-ipv6-id",
364+
Required: false,
365+
Deprecated: false,
366+
Positional: false,
367+
},
344368
{
345369
Name: "ipam-private-ipv4-id",
346370
Short: `ID of the IPAM private IPv4 address to attach to the VPN gateway`,

0 commit comments

Comments
 (0)