Skip to content

Commit 7107ebc

Browse files
feat(vpn): basic connection commands (#1433)
feat(vpn): basic connection commands - implement create, describe, list, delete, status for vpn connection - add helpers for string based enum flags - make JoinStringPtr generic to accept string based enum slices STACKITCLI-384
1 parent f7592e8 commit 7107ebc

30 files changed

Lines changed: 3095 additions & 2 deletions

docs/stackit_beta.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ stackit beta [flags]
4747
* [stackit beta intake](./stackit_beta_intake.md) - Provides functionality for intake
4848
* [stackit beta sfs](./stackit_beta_sfs.md) - Provides functionality for SFS (STACKIT File Storage)
4949
* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
50+
* [stackit beta vpn](./stackit_beta_vpn.md) - Provides functionality for VPN
5051

docs/stackit_beta_vpn.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## stackit beta vpn
2+
3+
Provides functionality for VPN
4+
5+
### Synopsis
6+
7+
Provides functionality for VPN.
8+
9+
```
10+
stackit beta vpn [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta vpn"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
25+
-p, --project-id string Project ID
26+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
33+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
34+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## stackit beta vpn connection
2+
3+
Provides functionality for VPN connections
4+
5+
### Synopsis
6+
7+
Provides functionality for VPN connections.
8+
9+
```
10+
stackit beta vpn connection [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta vpn connection"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
25+
-p, --project-id string Project ID
26+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit beta vpn](./stackit_beta_vpn.md) - Provides functionality for VPN
33+
* [stackit beta vpn connection create](./stackit_beta_vpn_connection_create.md) - Creates a VPN connection
34+
* [stackit beta vpn connection delete](./stackit_beta_vpn_connection_delete.md) - Deletes a VPN connection
35+
* [stackit beta vpn connection describe](./stackit_beta_vpn_connection_describe.md) - Shows details of a VPN connection
36+
* [stackit beta vpn connection list](./stackit_beta_vpn_connection_list.md) - Lists all VPN connections of a gateway
37+
* [stackit beta vpn connection status](./stackit_beta_vpn_connection_status.md) - Shows the status of a VPN connection
38+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## stackit beta vpn connection create
2+
3+
Creates a VPN connection
4+
5+
### Synopsis
6+
7+
Creates a VPN connection.
8+
9+
```
10+
stackit beta vpn connection create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a VPN connection
17+
$ stackit beta vpn connection create --gateway-id xxx --display-name my-connection --tunnel1-remote-address 1.2.3.4 --tunnel2-remote-address 5.6.7.8
18+
```
19+
20+
### Options
21+
22+
```
23+
--display-name string Required: A user friendly name for the connection.
24+
--enabled Enable the connection (default true)
25+
--gateway-id string Required: Gateway ID
26+
-h, --help Help for "stackit beta vpn connection create"
27+
--labels stringToString Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the LabelValue except that it cannot be empty. (example: foo=bar) (default [])
28+
--local-subnets strings Defaults to 0.0.0.0/0 for Route-based VPN configurations. Mandatory for Policy-based.
29+
--remote-subnets strings Defaults to 0.0.0.0/0 for Route-based VPN configurations. Mandatory for Policy-based.
30+
--static-routes strings Use this for route-based VPN.
31+
--tunnel1-bgp-remote-asn int Required: Tunnel 1 BGP Remote ASN.
32+
ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996).
33+
--tunnel1-peering-local-address string Tunnel 1 Peering Local Address.
34+
The peering object defines the point-to-point IP configuration for the Tunnel Interface. These addresses serve as next-hop identifiers and are used for BGP peering sessions and can be used in Static Route-Based connectivity.
35+
--tunnel1-peering-remote-address string Tunnel 1 Peering Remote Address
36+
--tunnel1-phase1-dh-groups strings Tunnel 1 Phase 1 DH Groups.
37+
The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. (possible values: [modp1024, modp2048, ecp256, ecp384, modp2048s256]) (default [])
38+
--tunnel1-phase1-encryption-algorithms strings Required: Tunnel 1 Phase 1 Encryption Algorithms (possible values: [aes256, aes128gcm16, aes256gcm16]) (default [])
39+
--tunnel1-phase1-integrity-algorithms strings Required: Tunnel 1 Phase 1 Integrity Algorithms (possible values: [sha1, sha2_256, sha2_384]) (default [])
40+
--tunnel1-phase1-rekey-time int Tunnel 1 Phase 1 Rekey Time.
41+
Time to schedule a IKE re-keying (in seconds).
42+
--tunnel1-phase2-dh-groups strings Tunnel 1 Phase 2 DH Groups (possible values: [modp1024, modp2048, ecp256, ecp384, modp2048s256]) (default [])
43+
--tunnel1-phase2-dpd-action string Tunnel 1 Phase 2 DPD Action.
44+
Action to perform for this CHILD_SA on DPD timeout. "clear": Closes the CHILD_SA and does not take further action. "restart": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. (possible values: [clear, restart])
45+
--tunnel1-phase2-encryption-algorithms strings Required: Tunnel 1 Phase 2 Encryption Algorithms (possible values: [aes256, aes128gcm16, aes256gcm16]) (default [])
46+
--tunnel1-phase2-integrity-algorithms strings Required: Tunnel 1 Phase 2 Integrity Algorithms (possible values: [sha1, sha2_256, sha2_384]) (default [])
47+
--tunnel1-phase2-rekey-time int Tunnel 1 Phase 2 Rekey Time.
48+
Time to schedule a Child SA re-keying (in seconds).
49+
--tunnel1-phase2-start-action string Tunnel 1 Phase 2 Start Action.
50+
Action to perform after loading the connection configuration. "none": The connection will be loaded but needs to be manually initiated. "start": initiates the connection actively. (possible values: [none, start])
51+
--tunnel1-pre-shared-key string Required: Tunnel 1 Pre Shared Key.
52+
A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
53+
--tunnel1-remote-address string Tunnel 1 Remote Address
54+
--tunnel2-bgp-remote-asn int Tunnel 2 BGP Remote ASN
55+
--tunnel2-peering-local-address string Tunnel 2 Peering Local Address.
56+
The peering object defines the point-to-point IP configuration for the Tunnel Interface. These addresses serve as next-hop identifiers and are used for BGP peering sessions and can be used in Static Route-Based connectivity.
57+
--tunnel2-peering-remote-address string Tunnel 2 Peering Remote Address
58+
--tunnel2-phase1-dh-groups strings Tunnel 2 Phase 1 DH Groups
59+
The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. (possible values: [modp1024, modp2048, ecp256, ecp384, modp2048s256]) (default [])
60+
--tunnel2-phase1-encryption-algorithms strings Required: Tunnel 2 Phase 1 Encryption Algorithms (possible values: [aes256, aes128gcm16, aes256gcm16]) (default [])
61+
--tunnel2-phase1-integrity-algorithms strings Required: Tunnel 2 Phase 1 Integrity Algorithms (possible values: [sha1, sha2_256, sha2_384]) (default [])
62+
--tunnel2-phase1-rekey-time int Tunnel 2 Phase 1 Rekey Time.
63+
Time to schedule a IKE re-keying (in seconds).
64+
--tunnel2-phase2-dh-groups strings Tunnel 2 Phase 2 DH Groups (possible values: [modp1024, modp2048, ecp256, ecp384, modp2048s256]) (default [])
65+
--tunnel2-phase2-dpd-action string Tunnel 2 Phase 2 DPD Action.
66+
Action to perform for this CHILD_SA on DPD timeout. "clear": Closes the CHILD_SA and does not take further action. "restart": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. (possible values: [clear, restart])
67+
--tunnel2-phase2-encryption-algorithms strings Required: Tunnel 2 Phase 2 Encryption Algorithms (possible values: [aes256, aes128gcm16, aes256gcm16]) (default [])
68+
--tunnel2-phase2-integrity-algorithms strings Required: Tunnel 2 Phase 2 Integrity Algorithms (possible values: [sha1, sha2_256, sha2_384]) (default [])
69+
--tunnel2-phase2-rekey-time int Tunnel 2 Phase 2 Rekey Time.
70+
Time to schedule a Child SA re-keying (in seconds).
71+
--tunnel2-phase2-start-action string Tunnel 2 Phase 2 Start Action.
72+
Default: "start"
73+
Enum: "none" "start"
74+
Action to perform after loading the connection configuration. "none": The connection will be loaded but needs to be manually initiated. "start": initiates the connection actively. (possible values: [none, start])
75+
--tunnel2-pre-shared-key string Required: Tunnel 2 Pre Shared Key.
76+
A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
77+
--tunnel2-remote-address string Tunnel 2 Remote Address
78+
```
79+
80+
### Options inherited from parent commands
81+
82+
```
83+
-y, --assume-yes If set, skips all confirmation prompts
84+
--async If set, runs the command asynchronously
85+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
86+
-p, --project-id string Project ID
87+
--region string Target region for region-specific requests
88+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
89+
```
90+
91+
### SEE ALSO
92+
93+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
94+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit beta vpn connection delete
2+
3+
Deletes a VPN connection
4+
5+
### Synopsis
6+
7+
Deletes a VPN connection.
8+
9+
```
10+
stackit beta vpn connection delete CONNECTION_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete a VPN connection
17+
$ stackit beta vpn connection delete xxx --gateway-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
--gateway-id string Gateway ID
24+
-h, --help Help for "stackit beta vpn connection delete"
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
-y, --assume-yes If set, skips all confirmation prompts
31+
--async If set, runs the command asynchronously
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
33+
-p, --project-id string Project ID
34+
--region string Target region for region-specific requests
35+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
41+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit beta vpn connection describe
2+
3+
Shows details of a VPN connection
4+
5+
### Synopsis
6+
7+
Shows details of a VPN connection.
8+
9+
```
10+
stackit beta vpn connection describe CONNECTION_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Show details of a VPN connection
17+
$ stackit beta vpn connection describe xxx --gateway-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
--gateway-id string Gateway ID
24+
-h, --help Help for "stackit beta vpn connection describe"
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
-y, --assume-yes If set, skips all confirmation prompts
31+
--async If set, runs the command asynchronously
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
33+
-p, --project-id string Project ID
34+
--region string Target region for region-specific requests
35+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
41+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit beta vpn connection list
2+
3+
Lists all VPN connections of a gateway
4+
5+
### Synopsis
6+
7+
Lists all VPN connections of a gateway.
8+
9+
```
10+
stackit beta vpn connection list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all VPN connections of a gateway
17+
$ stackit beta vpn connection list --gateway-id xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
--gateway-id string Gateway ID
24+
-h, --help Help for "stackit beta vpn connection list"
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
-y, --assume-yes If set, skips all confirmation prompts
31+
--async If set, runs the command asynchronously
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
33+
-p, --project-id string Project ID
34+
--region string Target region for region-specific requests
35+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
41+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit beta vpn connection status
2+
3+
Shows the status of a VPN connection
4+
5+
### Synopsis
6+
7+
Shows the status of a VPN connection.
8+
9+
```
10+
stackit beta vpn connection status CONNECTION_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Show status of a VPN connection
17+
$ stackit beta vpn connection status xxx --gateway-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
--gateway-id string Gateway ID
24+
-h, --help Help for "stackit beta vpn connection status"
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
-y, --assume-yes If set, skips all confirmation prompts
31+
--async If set, runs the command asynchronously
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
33+
-p, --project-id string Project ID
34+
--region string Target region for region-specific requests
35+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit beta vpn connection](./stackit_beta_vpn_connection.md) - Provides functionality for VPN connections
41+

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ require (
3636
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0
3737
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.7
3838
github.com/stackitcloud/stackit-sdk-go/services/ske v1.11.0
39+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0
3940
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.11.0
4041
github.com/zalando/go-keyring v0.2.6
4142
golang.org/x/mod v0.34.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ github.com/stackitcloud/stackit-sdk-go/services/sfs v0.9.0 h1:JWAFnskRbNKT8x62pZ
654654
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.9.0/go.mod h1:jMlBoXqrPNX5nXbo6oT7exalqilw1jiLPoIp4Cn0CdI=
655655
github.com/stackitcloud/stackit-sdk-go/services/ske v1.11.0 h1:QoKyQPe8FqDqJLNgE5uRlZ/y1c1GUxjV1DDLu5QEBD8=
656656
github.com/stackitcloud/stackit-sdk-go/services/ske v1.11.0/go.mod h1:KhVYCR58wETqdI7Quwhe3OR3BhB2T/b7DzaMsfDnr8g=
657+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0 h1:LMgbzhPunuelsIsfyEj/5O/aYfNcg/eGHsnZ7AZOhYg=
658+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0/go.mod h1:toIjQk1dhxdUFVyCWJJja0w/0nFpDid8MWX0ukQfvfo=
657659
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.11.0 h1:PwjQeupEnXxhu+uWCUzO/hUfL4yqNblOcZbP2jvaQtU=
658660
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.11.0/go.mod h1:AiUoMAqQcOlMgDtkVJlqI7P/VGD5xjN3dYjERGnwN/M=
659661
github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP9hWRrXQDU4Cm/g=

0 commit comments

Comments
 (0)