Skip to content

Commit 1805b16

Browse files
authored
feat(vpn): onboarding VPN gateway (#1453)
relates to STACKITTPR-633
1 parent 5cbcbec commit 1805b16

21 files changed

Lines changed: 1903 additions & 3 deletions

File tree

docs/data-sources/logs_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ data "stackit_logs_instance" "logs" {
4545
- `query_range_url` (String) The Logs instance's query range URL
4646
- `query_url` (String) The Logs instance's query URL
4747
- `retention_days` (Number) The log retention time in days
48-
- `status` (String) The status of the Logs instance, possible values: Possible values are: `active`, `deleting`, `reconciling`.
48+
- `status` (String) The status of the Logs instance. Possible values are: `active`, `deleting`, `reconciling`.

docs/data-sources/vpn_gateway.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_vpn_gateway Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
VPN Gateway data source schema. Uses the default_region specified in the provider configuration as a fallback in case no region is defined on datasource level.
7+
---
8+
9+
# stackit_vpn_gateway (Data Source)
10+
11+
VPN Gateway data source schema. Uses the `default_region` specified in the provider configuration as a fallback in case no `region` is defined on datasource level.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_vpn_gateway" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
gateway_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `gateway_id` (String) The server-generated UUID of the VPN gateway.
28+
- `project_id` (String) STACKIT project ID associated with the VPN gateway.
29+
30+
### Read-Only
31+
32+
- `availability_zones` (Attributes) Availability zones for the two tunnel endpoints. (see [below for nested schema](#nestedatt--availability_zones))
33+
- `bgp` (Attributes) BGP configuration. Only applicable when routing_type is BGP_ROUTE_BASED. (see [below for nested schema](#nestedatt--bgp))
34+
- `display_name` (String) A user-friendly name for the VPN gateway.
35+
- `id` (String) Terraform's internal resource identifier. Structured as "`project_id`,`region`,`gateway_id`".
36+
- `labels` (Map of String) Map of custom labels (key-value string pairs).
37+
- `plan_id` (String) The service plan identifier (e.g. `p500`). For guidance on finding available plans, see [List available service plans](https://docs.stackit.cloud/products/network/connectivity-hybrid-multi-cloud/vpn/getting-started/gateway-create/#list-available-service-plans).
38+
- `region` (String) STACKIT region name the resource is located in. If not defined, the provider region is used.
39+
- `routing_type` (String) Routing architecture. Possible values are: `POLICY_BASED`, `ROUTE_BASED`, `BGP_ROUTE_BASED`.
40+
- `state` (String) The current lifecycle state of the gateway. Possible values are: `PENDING`, `READY`, `ERROR`, `DELETING`.
41+
42+
<a id="nestedatt--availability_zones"></a>
43+
### Nested Schema for `availability_zones`
44+
45+
Read-Only:
46+
47+
- `tunnel1` (String) Availability zone for tunnel 1.
48+
- `tunnel2` (String) Availability zone for tunnel 2.
49+
50+
51+
<a id="nestedatt--bgp"></a>
52+
### Nested Schema for `bgp`
53+
54+
Read-Only:
55+
56+
- `local_asn` (Number) Local ASN for BGP (private ASN range, 64512-4294967294).
57+
- `override_advertised_routes` (List of String) List of IPv4 CIDRs to advertise via BGP. If omitted, SNA network ranges are advertised.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,4 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
214214
- `telemetryrouter_custom_endpoint` (String) Custom endpoint for the Telemetry Router service
215215
- `token_custom_endpoint` (String) Custom endpoint for the token API, which is used to request access tokens when using the key flow
216216
- `use_oidc` (Boolean) Enables OIDC for Authentication. This can also be sourced from the `STACKIT_USE_OIDC` Environment Variable. Defaults to `false`.
217+
- `vpn_custom_endpoint` (String) Custom endpoint for the VPN service

docs/resources/logs_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ import {
6363
- `instance_id` (String) The Logs instance ID
6464
- `query_range_url` (String) The Logs instance's query range URL
6565
- `query_url` (String) The Logs instance's query URL
66-
- `status` (String) The status of the Logs instance, possible values: Possible values are: `active`, `deleting`, `reconciling`.
66+
- `status` (String) The status of the Logs instance. Possible values are: `active`, `deleting`, `reconciling`.

docs/resources/vpn_gateway.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_vpn_gateway Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
VPN Gateway resource schema. Uses the default_region specified in the provider configuration as a fallback in case no region is defined on resource level.
7+
---
8+
9+
# stackit_vpn_gateway (Resource)
10+
11+
VPN Gateway resource schema. Uses the `default_region` specified in the provider configuration as a fallback in case no `region` is defined on resource level.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_vpn_gateway" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
display_name = "example-vpn-gateway"
19+
plan_id = "p500"
20+
routing_type = "ROUTE_BASED"
21+
22+
availability_zones = {
23+
tunnel1 = "eu01-1"
24+
tunnel2 = "eu01-2"
25+
}
26+
}
27+
28+
# Only use the import statement, if you want to import an existing VPN gateway
29+
import {
30+
to = stackit_vpn_gateway.example
31+
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
32+
}
33+
```
34+
35+
<!-- schema generated by tfplugindocs -->
36+
## Schema
37+
38+
### Required
39+
40+
- `availability_zones` (Attributes) Availability zones for the two tunnel endpoints. (see [below for nested schema](#nestedatt--availability_zones))
41+
- `display_name` (String) A user-friendly name for the VPN gateway.
42+
- `plan_id` (String) The service plan identifier (e.g. `p500`). For guidance on finding available plans, see [List available service plans](https://docs.stackit.cloud/products/network/connectivity-hybrid-multi-cloud/vpn/getting-started/gateway-create/#list-available-service-plans).
43+
- `project_id` (String) STACKIT project ID associated with the VPN gateway.
44+
- `routing_type` (String) Routing architecture. Possible values are: `POLICY_BASED`, `ROUTE_BASED`, `BGP_ROUTE_BASED`.
45+
46+
### Optional
47+
48+
- `bgp` (Attributes) BGP configuration. Only applicable when routing_type is BGP_ROUTE_BASED. (see [below for nested schema](#nestedatt--bgp))
49+
- `labels` (Map of String) Map of custom labels (key-value string pairs).
50+
- `region` (String) STACKIT region name the resource is located in. If not defined, the provider region is used.
51+
52+
### Read-Only
53+
54+
- `gateway_id` (String) The server-generated UUID of the VPN gateway.
55+
- `id` (String) Terraform's internal resource identifier. Structured as "`project_id`,`region`,`gateway_id`".
56+
- `state` (String) The current lifecycle state of the gateway. Possible values are: `PENDING`, `READY`, `ERROR`, `DELETING`.
57+
58+
<a id="nestedatt--availability_zones"></a>
59+
### Nested Schema for `availability_zones`
60+
61+
Required:
62+
63+
- `tunnel1` (String) Availability zone for tunnel 1.
64+
- `tunnel2` (String) Availability zone for tunnel 2.
65+
66+
67+
<a id="nestedatt--bgp"></a>
68+
### Nested Schema for `bgp`
69+
70+
Required:
71+
72+
- `local_asn` (Number) Local ASN for BGP (private ASN range, 64512-4294967294).
73+
74+
Optional:
75+
76+
- `override_advertised_routes` (List of String) List of IPv4 CIDRs to advertise via BGP. If omitted, SNA network ranges are advertised.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "stackit_vpn_gateway" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
gateway_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
resource "stackit_vpn_gateway" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
display_name = "example-vpn-gateway"
4+
plan_id = "p500"
5+
routing_type = "ROUTE_BASED"
6+
7+
availability_zones = {
8+
tunnel1 = "eu01-1"
9+
tunnel2 = "eu01-2"
10+
}
11+
}
12+
13+
# Only use the import statement, if you want to import an existing VPN gateway
14+
import {
15+
to = stackit_vpn_gateway.example
16+
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
17+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ require (
4646
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.11.0
4747
github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.2.0
4848
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.3.0
49+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0
4950
github.com/teambition/rrule-go v1.8.2
5051
golang.org/x/mod v0.36.0
5152
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.2.0 h1:U1mQoCk0
738738
github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.2.0/go.mod h1:hgw8janWmDfP2bnuZensxqcAePr49BX5ug8Rq85o+h8=
739739
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.3.0 h1:MEvzGItcbig+9A4JvK2E5W6/mqXDPafiGkDZ1BprBAI=
740740
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.3.0/go.mod h1:WUmgKtwpe90Yq3YbgNxc2clTTULVxCu0ha6lMTjUnII=
741+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0 h1:LMgbzhPunuelsIsfyEj/5O/aYfNcg/eGHsnZ7AZOhYg=
742+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.14.0/go.mod h1:toIjQk1dhxdUFVyCWJJja0w/0nFpDid8MWX0ukQfvfo=
741743
github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP9hWRrXQDU4Cm/g=
742744
github.com/stbenjam/no-sprintf-host-port v0.3.1/go.mod h1:ODbZesTCHMVKthBHskvUUexdcNHAQRXk9NpSsL8p/HQ=
743745
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

stackit/internal/core/core.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ type ProviderData struct {
7474
ServiceAccountCustomEndpoint string
7575
TelemetryLinkCustomEndpoint string
7676
TelemetryRouterCustomEndpoint string
77+
VpnCustomEndpoint string
7778
EnableBetaResources bool
7879
Experiments []string
7980

0 commit comments

Comments
 (0)