From d72f67fd72edc7a3c1892b105ef50be564b1e2de Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 10:57:02 +0100 Subject: [PATCH 1/7] feat(s2s-vpn): add s2s vpn resources --- docs/resources/s2s_vpn_connection.md | 162 ++ docs/resources/s2s_vpn_customer_gateway.md | 84 + docs/resources/s2s_vpn_routing_policy.md | 64 + docs/resources/s2s_vpn_vpn_gateway.md | 77 + go.mod | 6 +- go.sum | 12 +- internal/locality/zonal/schemas.go | 11 + internal/services/s2svpn/connection.go | 393 +++ internal/services/s2svpn/connection_test.go | 172 ++ internal/services/s2svpn/customer_gateway.go | 208 ++ .../services/s2svpn/customer_gateway_test.go | 100 + internal/services/s2svpn/helpers_s2svpn.go | 33 + internal/services/s2svpn/routing_policy.go | 217 ++ .../services/s2svpn/routing_policy_test.go | 100 + internal/services/s2svpn/sweep_test.go | 16 + .../testdata/connection-basic.cassette.yaml | 2310 +++++++++++++++++ .../customer-gateway-basic.cassette.yaml | 495 ++++ .../routing-policy-basic.cassette.yaml | 297 +++ .../testdata/vpn-gateway-basic.cassette.yaml | 1377 ++++++++++ internal/services/s2svpn/testfuncs/sweep.go | 145 ++ internal/services/s2svpn/types.go | 177 ++ internal/services/s2svpn/vpn_gateway.go | 257 ++ internal/services/s2svpn/vpn_gateway_test.go | 116 + internal/services/s2svpn/waiters.go | 31 + provider/sdkv2.go | 5 + .../resources/s2s_vpn_connection.md.tmpl | 163 ++ .../s2s_vpn_customer_gateway.md.tmpl | 85 + .../resources/s2s_vpn_routing_policy.md.tmpl | 65 + .../resources/s2s_vpn_vpn_gateway.md.tmpl | 78 + 29 files changed, 7247 insertions(+), 9 deletions(-) create mode 100644 docs/resources/s2s_vpn_connection.md create mode 100644 docs/resources/s2s_vpn_customer_gateway.md create mode 100644 docs/resources/s2s_vpn_routing_policy.md create mode 100644 docs/resources/s2s_vpn_vpn_gateway.md create mode 100644 internal/services/s2svpn/connection.go create mode 100644 internal/services/s2svpn/connection_test.go create mode 100644 internal/services/s2svpn/customer_gateway.go create mode 100644 internal/services/s2svpn/customer_gateway_test.go create mode 100644 internal/services/s2svpn/helpers_s2svpn.go create mode 100644 internal/services/s2svpn/routing_policy.go create mode 100644 internal/services/s2svpn/routing_policy_test.go create mode 100644 internal/services/s2svpn/sweep_test.go create mode 100644 internal/services/s2svpn/testdata/connection-basic.cassette.yaml create mode 100644 internal/services/s2svpn/testdata/customer-gateway-basic.cassette.yaml create mode 100644 internal/services/s2svpn/testdata/routing-policy-basic.cassette.yaml create mode 100644 internal/services/s2svpn/testdata/vpn-gateway-basic.cassette.yaml create mode 100644 internal/services/s2svpn/testfuncs/sweep.go create mode 100644 internal/services/s2svpn/types.go create mode 100644 internal/services/s2svpn/vpn_gateway.go create mode 100644 internal/services/s2svpn/vpn_gateway_test.go create mode 100644 internal/services/s2svpn/waiters.go create mode 100644 templates/resources/s2s_vpn_connection.md.tmpl create mode 100644 templates/resources/s2s_vpn_customer_gateway.md.tmpl create mode 100644 templates/resources/s2s_vpn_routing_policy.md.tmpl create mode 100644 templates/resources/s2s_vpn_vpn_gateway.md.tmpl diff --git a/docs/resources/s2s_vpn_connection.md b/docs/resources/s2s_vpn_connection.md new file mode 100644 index 0000000000..9ba10792a4 --- /dev/null +++ b/docs/resources/s2s_vpn_connection.md @@ -0,0 +1,162 @@ +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_connection" +--- + +# Resource: scaleway_s2s_vpn_connection + +Creates and manages Scaleway Site-to-Site VPN Connections. +A connection links a Scaleway VPN Gateway to a Customer Gateway and establishes an IPSec tunnel with BGP routing. + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic Connection + +```terraform +resource "scaleway_vpc" "vpc" { + name = "my-vpc" +} + +resource "scaleway_vpc_private_network" "pn" { + name = "my-private-network" + vpc_id = scaleway_vpc.vpc.id + ipv4_subnet { + subnet = "10.0.1.0/24" + } +} + +resource "scaleway_s2s_vpn_gateway" "gateway" { + name = "my-vpn-gateway" + gateway_type = "VGW-S" + private_network_id = scaleway_vpc_private_network.pn.id +} + +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { + name = "my-customer-gateway" + ipv4_public = "203.0.113.1" + asn = 65000 +} + +resource "scaleway_s2s_vpn_routing_policy" "policy" { + name = "my-routing-policy" + prefix_filter_in = ["10.0.2.0/24"] + prefix_filter_out = ["10.0.1.0/24"] +} + +resource "scaleway_s2s_vpn_connection" "main" { + name = "my-vpn-connection" + vpn_gateway_id = scaleway_s2s_vpn_gateway.gateway.id + customer_gateway_id = scaleway_s2s_vpn_customer_gateway.customer_gw.id + initiation_policy = "customer_gateway" + enable_route_propagation = true + + bgp_config_ipv4 { + routing_policy_id = scaleway_s2s_vpn_routing_policy.policy.id + private_ip = "169.254.0.1/30" + peer_private_ip = "169.254.0.2/30" + } + + ikev2_ciphers { + encryption = "aes256" + integrity = "sha256" + dh_group = "modp2048" + } + + esp_ciphers { + encryption = "aes256" + integrity = "sha256" + dh_group = "modp2048" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +- `vpn_gateway_id` - (Required) The ID of the VPN gateway to attach to the connection. +- `customer_gateway_id` - (Required) The ID of the customer gateway to attach to the connection. +- `initiation_policy` - (Optional) Defines who initiates the IPSec tunnel. +- `enable_route_propagation` - (Optional) Defines whether route propagation is enabled or not. +- `bgp_config_ipv4` - (Optional) BGP configuration for IPv4. See [BGP Config](#bgp-config) below. +- `bgp_config_ipv6` - (Optional) BGP configuration for IPv6. See [BGP Config](#bgp-config) below. +- `ikev2_ciphers` - (Optional) IKEv2 cipher configuration for Phase 1 (tunnel establishment). See [Cipher Config](#cipher-config) below. +- `esp_ciphers` - (Optional) ESP cipher configuration for Phase 2 (data encryption). See [Cipher Config](#cipher-config) below. +- `name` - (Optional) The name of the connection. +- `tags` - (Optional) The list of tags to apply to the connection. +- `is_ipv6` - (Optional) Defines IP version of the IPSec Tunnel. Defaults to `false` (IPv4). +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the connection should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the connection is associated with. + +### BGP Config + +The `bgp_config_ipv4` and `bgp_config_ipv6` blocks support: + +- `routing_policy_id` - (Required) The ID of the routing policy to use for BGP route filtering. +- `private_ip` - (Optional) The BGP peer IP on Scaleway side (within the IPSec tunnel), in CIDR notation (e.g., `169.254.0.1/30`). If not provided, Scaleway will assign it automatically. +- `peer_private_ip` - (Optional) The BGP peer IP on customer side (within the IPSec tunnel), in CIDR notation (e.g., `169.254.0.2/30`). If not provided, Scaleway will assign it automatically. + +### Cipher Config + +The `ikev2_ciphers` and `esp_ciphers` blocks support: + +- `encryption` - (Required) The encryption algorithm. +- `integrity` - (Optional) The integrity/hash algorithm. +- `dh_group` - (Optional) The Diffie-Hellman group. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the connection. +- `status` - The status of the connection. +- `tunnel_status` - The status of the IPSec tunnel. +- `bgp_status_ipv4` - The status of the BGP IPv4 session. +- `bgp_status_ipv6` - The status of the BGP IPv6 session. +- `bgp_session_ipv4` - The BGP IPv4 session information. See [BGP Session](#bgp-session) below. +- `bgp_session_ipv6` - The BGP IPv6 session information. See [BGP Session](#bgp-session) below. +- `secret_id` - The ID of the secret containing the pre-shared key (PSK) for the connection. +- `secret_version` - The version of the secret containing the PSK. +- `route_propagation_enabled` - Whether route propagation is enabled. +- `created_at` - The date and time of the creation of the connection (RFC 3339 format). +- `updated_at` - The date and time of the last update of the connection (RFC 3339 format). +- `organization_id` - The Organization ID the connection is associated with. + +### BGP Session + +The `bgp_session_ipv4` and `bgp_session_ipv6` blocks contain (read-only): + +- `routing_policy_id` - The routing policy ID used for this BGP session. +- `private_ip` - The BGP peer IP on Scaleway side (within the tunnel). +- `peer_private_ip` - The BGP peer IP on customer side (within the tunnel). + +~> **Important:** Connections' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +~> **Important:** The pre-shared key (PSK) is auto-generated when the connection is created and stored in Scaleway Secret Manager. You can retrieve it using the `scaleway_secret_version` datasource or via the API. + +## Retrieving the Pre-Shared Key (PSK) + +The PSK is stored in Secret Manager and can be retrieved using: + +```terraform +data "scaleway_secret_version" "s2s_psk" { + secret_id = scaleway_s2s_vpn_connection.main.secret_id + revision = tostring(scaleway_s2s_vpn_connection.main.secret_version) +} + +# The PSK is available as base64-encoded data +output "psk" { + value = data.scaleway_secret_version.s2s_psk.data + sensitive = true +} +``` + +## Import + +Connections can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_connection.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/docs/resources/s2s_vpn_customer_gateway.md b/docs/resources/s2s_vpn_customer_gateway.md new file mode 100644 index 0000000000..1fd717bc8b --- /dev/null +++ b/docs/resources/s2s_vpn_customer_gateway.md @@ -0,0 +1,84 @@ +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_customer_gateway" +--- + +# Resource: scaleway_s2s_vpn_customer_gateway + +Creates and manages Scaleway Site-to-Site VPN Customer Gateways. +A customer gateway represents your external VPN endpoint (e.g., a firewall, router, or VPN appliance). + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { + name = "my-customer-gateway" + ipv4_public = "203.0.113.1" + asn = 65000 +} +``` + +### With IPv6 + +```terraform +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { + name = "my-customer-gateway" + ipv4_public = "203.0.113.1" + ipv6_public = "2001:db8::1" + asn = 65000 +} +``` + +### Using Instance Public IP + +```terraform +resource "scaleway_instance_ip" "vpn_endpoint_ip" {} + +resource "scaleway_instance_server" "vpn_endpoint" { + name = "vpn-endpoint" + type = "DEV1-S" + image = "ubuntu_jammy" + ip_ids = [scaleway_instance_ip.vpn_endpoint_ip.id] +} + +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { + name = "my-customer-gateway" + ipv4_public = scaleway_instance_ip.vpn_endpoint_ip.address + asn = 65000 +} +``` + +## Argument Reference + +The following arguments are supported: + +- `asn` - (Required) The AS Number of the customer gateway. Must be different from Scaleway's ASN (12876). For testing, you can use a private ASN (64512-65535). +- `ipv4_public` - (Optional) The public IPv4 address of the customer gateway (your VPN endpoint). +- `ipv6_public` - (Optional) The public IPv6 address of the customer gateway (your VPN endpoint). +- `name` - (Optional) The name of the customer gateway. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the customer gateway. +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the customer gateway should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the customer gateway is associated with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the customer gateway. +- `created_at` - The date and time of the creation of the customer gateway (RFC 3339 format). +- `updated_at` - The date and time of the last update of the customer gateway (RFC 3339 format). +- `organization_id` - The Organization ID the customer gateway is associated with. + +~> **Important:** Customer Gateways' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +Customer Gateways can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_customer_gateway.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/docs/resources/s2s_vpn_routing_policy.md b/docs/resources/s2s_vpn_routing_policy.md new file mode 100644 index 0000000000..b662b9d8ed --- /dev/null +++ b/docs/resources/s2s_vpn_routing_policy.md @@ -0,0 +1,64 @@ +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_routing_policy" +--- + +# Resource: scaleway_s2s_vpn_routing_policy + +Creates and manages Scaleway Site-to-Site VPN Routing Policies. +A routing policy defines which routes are accepted from and advertised to the peer gateway via BGP. + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_s2s_vpn_routing_policy" "policy" { + name = "my-routing-policy" + prefix_filter_in = ["10.0.2.0/24"] + prefix_filter_out = ["10.0.1.0/24"] +} +``` + +### Multiple Prefixes + +```terraform +resource "scaleway_s2s_vpn_routing_policy" "policy" { + name = "my-routing-policy" + prefix_filter_in = ["10.0.2.0/24", "10.0.3.0/24"] + prefix_filter_out = ["10.0.1.0/24", "172.16.0.0/16"] +} +``` + +## Argument Reference + +The following arguments are supported: + +- `prefix_filter_in` - (Optional) List of IP prefixes (in CIDR notation) to accept from the peer gateway. These are the routes that the customer gateway can announce to Scaleway. +- `prefix_filter_out` - (Optional) List of IP prefixes (in CIDR notation) to advertise to the peer gateway. These are the routes that Scaleway will announce to the customer gateway. +- `name` - (Optional) The name of the routing policy. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the routing policy. +- `is_ipv6` - (Optional) Defines whether the routing policy is for IPv6 prefixes. Defaults to `false` (IPv4). +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the routing policy should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the routing policy is associated with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the routing policy. +- `created_at` - The date and time of the creation of the routing policy (RFC 3339 format). +- `updated_at` - The date and time of the last update of the routing policy (RFC 3339 format). +- `organization_id` - The Organization ID the routing policy is associated with. + +~> **Important:** Routing Policies' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +Routing Policies can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_routing_policy.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/docs/resources/s2s_vpn_vpn_gateway.md b/docs/resources/s2s_vpn_vpn_gateway.md new file mode 100644 index 0000000000..3b0130488a --- /dev/null +++ b/docs/resources/s2s_vpn_vpn_gateway.md @@ -0,0 +1,77 @@ +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_gateway" +--- + +# Resource: scaleway_s2s_vpn_gateway + +Creates and manages Scaleway Site-to-Site VPN Gateways. +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_vpc" "vpc" { + name = "my-vpc" +} + +resource "scaleway_vpc_private_network" "pn" { + name = "my-private-network" + vpc_id = scaleway_vpc.vpc.id + ipv4_subnet { + subnet = "10.0.1.0/24" + } +} + +resource "scaleway_s2s_vpn_gateway" "gateway" { + name = "my-vpn-gateway" + gateway_type = "VGW-S" + private_network_id = scaleway_vpc_private_network.pn.id +} +``` + +## Argument Reference + +The following arguments are supported: + +- `gateway_type` - (Required) The VPN gateway type (commercial offer type). +- `private_network_id` - (Required) The ID of the Private Network to attach to the VPN gateway. +- `name` - (Optional) The name of the VPN gateway. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the VPN gateway. +- `public_config` - (Optional) The public endpoint configuration of the VPN gateway. See [Public Config](#public-config) below. +- `ipam_private_ipv4_id` - (Optional) The ID of the IPAM private IPv4 address to attach to the VPN gateway. +- `ipam_private_ipv6_id` - (Optional) The ID of the IPAM private IPv6 address to attach to the VPN gateway. +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the VPN gateway should be created. +- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the VPN gateway should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the VPN gateway is associated with. + +### Public Config + +The `public_config` block supports: + +- `ipam_ipv4_id` - (Optional) The ID of the IPAM IPv4 address to use as the public IP for the VPN gateway. +- `ipam_ipv6_id` - (Optional) The ID of the IPAM IPv6 address to use as the public IP for the VPN gateway. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the VPN gateway. +- `asn` - The AS Number of the VPN gateway (typically 12876 for Scaleway). +- `status` - The status of the VPN gateway. +- `public_config` - The public endpoint configuration, including the assigned public IPs. +- `created_at` - The date and time of the creation of the VPN gateway (RFC 3339 format). +- `updated_at` - The date and time of the last update of the VPN gateway (RFC 3339 format). +- `organization_id` - The Organization ID the VPN gateway is associated with. + +~> **Important:** VPN Gateways' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +VPN Gateways can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_gateway.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/go.mod b/go.mod index ecc15d8ff6..0c4a49e41f 100644 --- a/go.mod +++ b/go.mod @@ -31,12 +31,12 @@ require ( github.com/nats-io/jwt/v2 v2.8.0 github.com/nats-io/nats.go v1.46.1 github.com/robfig/cron/v3 v3.0.1 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251125140454-267e13d60597 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251203154337-b29f160ed139 github.com/stretchr/testify v1.11.1 golang.org/x/crypto v0.45.0 golang.org/x/sync v0.18.0 gopkg.in/dnaeon/go-vcr.v3 v3.2.0 - gopkg.in/dnaeon/go-vcr.v4 v4.0.5 + gopkg.in/dnaeon/go-vcr.v4 v4.0.6 ) require ( @@ -87,7 +87,6 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/goccy/go-yaml v1.18.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gookit/color v1.5.1 // indirect @@ -162,6 +161,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect go.opentelemetry.io/otel/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.yaml.in/yaml/v4 v4.0.0-rc.3 // indirect golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect golang.org/x/mod v0.29.0 // indirect golang.org/x/net v0.47.0 // indirect diff --git a/go.sum b/go.sum index d1523840d5..b4859ddb44 100644 --- a/go.sum +++ b/go.sum @@ -203,8 +203,6 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= -github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -459,8 +457,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251125140454-267e13d60597 h1:PfrwuNnzQ7H8nB+qUkDBgB7wsX9fL3yUjO/kjc8WCg8= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251125140454-267e13d60597/go.mod h1:BBENv1W9QH4COViJkDJB/0D1T6CweMAkDP7XehRsHQ8= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251203154337-b29f160ed139 h1:NgBQDfBv1NosmW4DsEnEjmYRn2zxcBkqi1dPXEqZy7k= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251203154337-b29f160ed139/go.mod h1:h/elW4JdNo225GP5FZHJ/RPyCNz79lxaeub3PyGzE9o= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -548,6 +546,8 @@ go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJr go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= +go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go= +go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -897,8 +897,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/dnaeon/go-vcr.v3 v3.2.0 h1:Rltp0Vf+Aq0u4rQXgmXgtgoRDStTnFN83cWgSGSoRzM= gopkg.in/dnaeon/go-vcr.v3 v3.2.0/go.mod h1:2IMOnnlx9I6u9x+YBsM3tAMx6AlOxnJ0pWxQAzZ79Ag= -gopkg.in/dnaeon/go-vcr.v4 v4.0.5 h1:I0hpTIvD5rII+8LgYGrHMA2d4SQPoL6u7ZvJakWKsiA= -gopkg.in/dnaeon/go-vcr.v4 v4.0.5/go.mod h1:dRos81TkW9C1WJt6tTaE+uV2Lo8qJT3AG2b35+CB/nQ= +gopkg.in/dnaeon/go-vcr.v4 v4.0.6 h1:PiJkrakkmzc5s7EfBnZOnyiLwi7o7A9fwPzN0X2uwe0= +gopkg.in/dnaeon/go-vcr.v4 v4.0.6/go.mod h1:sbq5oMEcM4PXngbcNbHhzfCP9OdZodLhrbRYoyg09HY= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/internal/locality/zonal/schemas.go b/internal/locality/zonal/schemas.go index 3250a78ece..d7cf541b4d 100644 --- a/internal/locality/zonal/schemas.go +++ b/internal/locality/zonal/schemas.go @@ -36,3 +36,14 @@ func Schema() *schema.Schema { DiffSuppressFunc: locality.SuppressSDKNullAssignment, } } + +func OptionalSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "IThe zone you want to attach the resource to", + ValidateDiagFunc: verify.ValidateStringInSliceWithWarning(AllZones(), "zone"), + DiffSuppressFunc: locality.SuppressSDKNullAssignment, + } +} diff --git a/internal/services/s2svpn/connection.go b/internal/services/s2svpn/connection.go new file mode 100644 index 0000000000..e98c68c695 --- /dev/null +++ b/internal/services/s2svpn/connection.go @@ -0,0 +1,393 @@ +package s2svpn + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/verify" +) + +func ResourceConnection() *schema.Resource { + return &schema.Resource{ + CreateContext: ResourceConnectionCreate, + ReadContext: ResourceConnectionRead, + UpdateContext: ResourceConnectionUpdate, + DeleteContext: ResourceConnectionDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 0, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The name of the connection", + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Description: "The list of tags to apply to the connection", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "is_ipv6": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + Description: "Defines IP version of the IPSec Tunnel", + }, + "initiation_policy": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Defines who initiates the IPsec tunnel", + ValidateDiagFunc: verify.ValidateEnum[s2s_vpn.CreateConnectionRequestInitiationPolicy](), + }, + "ikev2_ciphers": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The list of IKE v2 ciphers proposed for the IPsec tunnel", + Elem: ResourceConnectionCipher(), + }, + "esp_ciphers": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The list of ESP ciphers proposed for the IPsec tunnel", + Elem: ResourceConnectionCipher(), + }, + "enable_route_propagation": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + Description: "Defines whether route propagation is enabled or not", + }, + "vpn_gateway_id": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The ID of the VPN gateway to attach to the connection", + }, + "customer_gateway_id": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The ID of the customer gateway to attach to the connection", + }, + "bgp_config_ipv4": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The list of IKE v2 ciphers proposed for the IPsec tunnel", + Elem: ResourceConnectionRequestBgpConfig(), + }, + "bgp_config_ipv6": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The list of IKE v2 ciphers proposed for the IPsec tunnel", + Elem: ResourceConnectionRequestBgpConfig(), + }, + "bgp_status_ipv4": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the BGP IPv4 session", + }, + "bgp_status_ipv6": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the BGP IPv6 session", + }, + "bgp_session_ipv4": { + Type: schema.TypeList, + Computed: true, + Description: "The BGP IPv4 session information (read-only)", + Elem: ResourceConnectionBgpSession(), + }, + "bgp_session_ipv6": { + Type: schema.TypeList, + Computed: true, + Description: "The BGP IPv6 session information (read-only)", + Elem: ResourceConnectionBgpSession(), + }, + "route_propagation_enabled": { + Type: schema.TypeBool, + Computed: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the creation of the TLS stage", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the last update of the TLS stage", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN gateway", + }, + "tunnel_status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN gateway", + }, + "secret_id": { + Type: schema.TypeString, + Computed: true, + Description: "The BGP peer IP on customer side", + }, + "secret_version": { + Type: schema.TypeInt, + Computed: true, + Description: "The BGP peer IP on customer side", + }, + "region": regional.Schema(), + "project_id": account.ProjectIDSchema(), + "organization_id": { + Type: schema.TypeString, + Computed: true, + Description: "Organization ID of the Project", + }, + }, + } +} + +func ResourceConnectionCipher() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "encryption": { + Type: schema.TypeString, + Required: true, + }, + "integrity": { + Type: schema.TypeString, + Optional: true, + }, + "dh_group": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func ResourceConnectionRequestBgpConfig() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "routing_policy_id": { + Type: schema.TypeString, + Required: true, + }, + "private_ip": { + Type: schema.TypeString, + Optional: true, + }, + "peer_private_ip": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func ResourceConnectionBgpSession() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "routing_policy_id": { + Type: schema.TypeString, + Computed: true, + Description: "The routing policy ID", + }, + "private_ip": { + Type: schema.TypeString, + Computed: true, + Description: "The BGP peer IP on Scaleway side", + }, + "peer_private_ip": { + Type: schema.TypeString, + Computed: true, + Description: "The BGP peer IP on customer side", + }, + }, + } +} + +func ResourceConnectionCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, err := NewAPIWithRegion(d, m) + if err != nil { + return diag.FromErr(err) + } + + bgpConfigIpv4Config, err := expandConnectionRequestBgpConfig(d.Get("bgp_config_ipv4")) + if err != nil { + return diag.FromErr(err) + } + + bgpConfigIpv6Config, err := expandConnectionRequestBgpConfig(d.Get("bgp_config_ipv6")) + if err != nil { + return diag.FromErr(err) + } + + req := &s2s_vpn.CreateConnectionRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + Name: types.ExpandOrGenerateString(d.Get("name").(string), "connection"), + Tags: types.ExpandStrings(d.Get("tags")), + IsIPv6: d.Get("is_ipv6").(bool), + EnableRoutePropagation: d.Get("enable_route_propagation").(bool), + InitiationPolicy: s2s_vpn.CreateConnectionRequestInitiationPolicy(d.Get("initiation_policy").(string)), + VpnGatewayID: regional.ExpandID(d.Get("vpn_gateway_id").(string)).ID, + CustomerGatewayID: regional.ExpandID(d.Get("customer_gateway_id").(string)).ID, + Ikev2Ciphers: expandConnectionCiphers(d.Get("ikev2_ciphers")), + EspCiphers: expandConnectionCiphers(d.Get("esp_ciphers")), + } + + if bgpConfigIpv4Config != nil { + req.BgpConfigIPv4 = bgpConfigIpv4Config + } + + if bgpConfigIpv6Config != nil { + req.BgpConfigIPv6 = bgpConfigIpv6Config + } + + res, err := api.CreateConnection(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(regional.NewIDString(region, res.Connection.ID)) + + return ResourceConnectionRead(ctx, d, m) +} + +func ResourceConnectionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + connection, err := api.GetConnection(&s2s_vpn.GetConnectionRequest{ + ConnectionID: id, + Region: region, + }, scw.WithContext(ctx)) + if err != nil { + if httperrors.Is404(err) { + d.SetId("") + return nil + } + return diag.FromErr(err) + } + + _ = d.Set("name", connection.Name) + _ = d.Set("region", connection.Region) + _ = d.Set("project_id", connection.ProjectID) + _ = d.Set("organization_id", connection.OrganizationID) + _ = d.Set("tags", connection.Tags) + _ = d.Set("created_at", types.FlattenTime(connection.CreatedAt)) + _ = d.Set("updated_at", types.FlattenTime(connection.UpdatedAt)) + _ = d.Set("status", connection.Status.String()) + _ = d.Set("is_ipv6", connection.IsIPv6) + _ = d.Set("initiation_policy", connection.InitiationPolicy.String()) + _ = d.Set("route_propagation_enabled", connection.RoutePropagationEnabled) + _ = d.Set("vpn_gateway_id", regional.NewIDString(region, connection.VpnGatewayID)) + _ = d.Set("customer_gateway_id", regional.NewIDString(region, connection.CustomerGatewayID)) + _ = d.Set("tunnel_status", connection.TunnelStatus.String()) + _ = d.Set("ikev2_ciphers", flattenConnectionCiphers(connection.Ikev2Ciphers)) + _ = d.Set("esp_ciphers", flattenConnectionCiphers(connection.EspCiphers)) + _ = d.Set("bgp_status_ipv4", connection.BgpStatusIPv4.String()) + _ = d.Set("bgp_status_ipv6", connection.BgpStatusIPv6.String()) + _ = d.Set("secret_id", regional.NewIDString(region, connection.SecretID)) + _ = d.Set("secret_version", int(connection.SecretRevision)) + + bgpSessionIPv4, err := flattenBGPSession(region, connection.BgpSessionIPv4) + if err != nil { + return diag.FromErr(err) + } + _ = d.Set("bgp_session_ipv4", bgpSessionIPv4) + + bgpSessionIPv6, err := flattenBGPSession(region, connection.BgpSessionIPv6) + if err != nil { + return diag.FromErr(err) + } + _ = d.Set("bgp_session_ipv6", bgpSessionIPv6) + + return nil +} + +func ResourceConnectionUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + hasChanged := false + + req := &s2s_vpn.UpdateConnectionRequest{ + Region: region, + ConnectionID: id, + } + + if d.HasChange("name") { + req.Name = types.ExpandUpdatedStringPtr(d.Get("name")) + hasChanged = true + } + + if d.HasChange("tags") { + req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) + hasChanged = true + } + + if d.HasChange("initiation_policy") { + req.InitiationPolicy = s2s_vpn.CreateConnectionRequestInitiationPolicy(d.Get("initiation_policy").(string)) + hasChanged = true + } + + if d.HasChange("ikev2_ciphers") { + req.Ikev2Ciphers = expandConnectionCiphers(d.Get("ikev2_ciphers")) + hasChanged = true + } + + if d.HasChange("esp_ciphers") { + req.EspCiphers = expandConnectionCiphers(d.Get("esp_ciphers")) + hasChanged = true + } + + if hasChanged { + _, err = api.UpdateConnection(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } + + return ResourceConnectionRead(ctx, d, m) +} + +func ResourceConnectionDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = api.DeleteConnection(&s2s_vpn.DeleteConnectionRequest{ + Region: region, + ConnectionID: id, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/internal/services/s2svpn/connection_test.go b/internal/services/s2svpn/connection_test.go new file mode 100644 index 0000000000..751f016bd9 --- /dev/null +++ b/internal/services/s2svpn/connection_test.go @@ -0,0 +1,172 @@ +package s2svpn_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn" +) + +func TestAccConnection_Basic(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + ProtoV6ProviderFactories: tt.ProviderFactories, + CheckDestroy: resource.ComposeTestCheckFunc( + testAccCheckConnectionDestroy(tt), + testAccCheckVPNGatewayDestroy(tt), + testAccCheckCustomerGatewayDestroy(tt), + testAccCheckRoutingPolicyDestroy(tt), + ), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_vpc" "main" { + name = "tf-test-vpc-connection" + } + + resource "scaleway_vpc_private_network" "main" { + vpc_id = scaleway_vpc.main.id + ipv4_subnet { + subnet = "10.0.0.0/24" + } + } + + resource "scaleway_instance_ip" "customer_ip" {} + + resource "scaleway_s2s_vpn_gateway" "main" { + name = "tf-test-vpn-gateway-connection" + gateway_type = "VGW-S" + private_network_id = scaleway_vpc_private_network.main.id + region = "fr-par" + zone = "fr-par-1" + } + + resource "scaleway_s2s_vpn_customer_gateway" "main" { + name = "tf-test-customer-gateway-connection" + ipv4_public = scaleway_instance_ip.customer_ip.address + asn = 65000 + region = "fr-par" + } + + resource "scaleway_s2s_vpn_routing_policy" "main" { + name = "tf-test-routing-policy-connection" + prefix_filter_in = ["10.0.1.0/24"] + prefix_filter_out = ["10.0.0.0/24"] + region = "fr-par" + } + + resource "scaleway_s2s_vpn_connection" "main" { + name = "tf-test-connection" + vpn_gateway_id = scaleway_s2s_vpn_gateway.main.id + customer_gateway_id = scaleway_s2s_vpn_customer_gateway.main.id + initiation_policy = "customer_gateway" + enable_route_propagation = true + region = "fr-par" + + bgp_config_ipv4 { + routing_policy_id = scaleway_s2s_vpn_routing_policy.main.id + private_ip = "169.254.0.1/30" + peer_private_ip = "169.254.0.2/30" + } + + ikev2_ciphers { + encryption = "aes256" + integrity = "sha256" + dh_group = "modp2048" + } + + esp_ciphers { + encryption = "aes256" + integrity = "sha256" + dh_group = "modp2048" + } + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckConnectionExists(tt, "scaleway_s2s_vpn_connection.main"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "name", "tf-test-connection"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "initiation_policy", "customer_gateway"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "enable_route_propagation", "true"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_connection.main", "id"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_connection.main", "status"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_connection.main", "secret_id"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_connection.main", "secret_version"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "bgp_config_ipv4.0.private_ip", "169.254.0.1/30"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "bgp_config_ipv4.0.peer_private_ip", "169.254.0.2/30"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "ikev2_ciphers.0.encryption", "aes256"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "ikev2_ciphers.0.integrity", "sha256"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "ikev2_ciphers.0.dh_group", "modp2048"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "esp_ciphers.0.encryption", "aes256"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "esp_ciphers.0.integrity", "sha256"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_connection.main", "esp_ciphers.0.dh_group", "modp2048"), + ), + }, + }, + }) +} + +func testAccCheckConnectionExists(tt *acctest.TestTools, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource not found: %s", n) + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + connection, err := api.GetConnection(&s2s_vpn.GetConnectionRequest{ + ConnectionID: id, + Region: region, + }) + + if err != nil { + return err + } + + if connection.Status.String() == "error" { + return fmt.Errorf("connection is in error state") + } + + return nil + } +} + +func testAccCheckConnectionDestroy(tt *acctest.TestTools) resource.TestCheckFunc { + return func(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "scaleway_s2s_vpn_connection" { + continue + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetConnection(&s2s_vpn.GetConnectionRequest{ + ConnectionID: id, + Region: region, + }) + + if err == nil { + return fmt.Errorf("s2svpn connection (%s) still exists", rs.Primary.ID) + } + + if !httperrors.Is404(err) { + return err + } + } + + return nil + } +} diff --git a/internal/services/s2svpn/customer_gateway.go b/internal/services/s2svpn/customer_gateway.go new file mode 100644 index 0000000000..fc12da9f0a --- /dev/null +++ b/internal/services/s2svpn/customer_gateway.go @@ -0,0 +1,208 @@ +package s2svpn + +import ( + "context" + "net" + + _ "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func ResourceCustomerGateway() *schema.Resource { + return &schema.Resource{ + CreateContext: ResourceCustomerGatewayCreate, + ReadContext: ResourceCustomerGatewayRead, + UpdateContext: ResourceCustomerGatewayUpdate, + DeleteContext: ResourceCustomerGatewayDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 0, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The name of the customer gateway", + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Description: "The list of tags to apply to the customer gateway", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "ipv4_public": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The public IPv4 address of the customer gateway", + }, + "ipv6_public": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The public IPv6 address of the customer gateway", + }, + "asn": { + Type: schema.TypeInt, + Required: true, + Description: "The AS Number of the customer gateway", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the creation of the TLS stage", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the last update of the TLS stage", + }, + "region": regional.Schema(), + "project_id": account.ProjectIDSchema(), + "organization_id": { + Type: schema.TypeString, + Computed: true, + Description: "Organization ID of the Project", + }, + }, + } +} + +func ResourceCustomerGatewayCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, err := NewAPIWithRegion(d, m) + if err != nil { + return diag.FromErr(err) + } + + req := &s2s_vpn.CreateCustomerGatewayRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + Name: types.ExpandOrGenerateString(d.Get("name").(string), "connection"), + Tags: types.ExpandStrings(d.Get("tags")), + Asn: uint32(d.Get("asn").(int)), + } + + if d.Get("ipv4_public").(string) != "" { + req.IPv4Public = scw.IPPtr(net.ParseIP(d.Get("ipv4_public").(string))) + } + + if d.Get("ipv6_public").(string) != "" { + req.IPv6Public = scw.IPPtr(net.ParseIP(d.Get("ipv6_public").(string))) + } + + res, err := api.CreateCustomerGateway(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(regional.NewIDString(region, res.ID)) + + return ResourceCustomerGatewayRead(ctx, d, m) +} + +func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + gateway, err := api.GetCustomerGateway(&s2s_vpn.GetCustomerGatewayRequest{ + GatewayID: id, + Region: region, + }, scw.WithContext(ctx)) + if err != nil { + if httperrors.Is404(err) { + d.SetId("") + return nil + } + return diag.FromErr(err) + } + + _ = d.Set("name", gateway.Name) + _ = d.Set("project_id", gateway.ProjectID) + _ = d.Set("organization_id", gateway.OrganizationID) + _ = d.Set("tags", gateway.Tags) + _ = d.Set("created_at", types.FlattenTime(gateway.CreatedAt)) + _ = d.Set("updated_at", types.FlattenTime(gateway.UpdatedAt)) + _ = d.Set("ipv4_public", types.FlattenIPPtr(gateway.PublicIPv4)) + _ = d.Set("ipv6_public", types.FlattenIPPtr(gateway.PublicIPv6)) + _ = d.Set("asn", gateway.Asn) + + return nil +} + +func ResourceCustomerGatewayUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + hasChanged := false + + req := &s2s_vpn.UpdateCustomerGatewayRequest{ + Region: region, + GatewayID: id, + } + + if d.HasChange("name") { + req.Name = types.ExpandUpdatedStringPtr(d.Get("name")) + hasChanged = true + } + + if d.HasChange("tags") { + req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) + hasChanged = true + } + + if d.HasChange("ipv4_public") { + req.IPv4Public = scw.IPPtr(net.ParseIP(d.Get("ipv4_public").(string))) + hasChanged = true + } + + if d.HasChange("ipv6_public") { + req.IPv6Public = scw.IPPtr(net.ParseIP(d.Get("ipv6_public").(string))) + hasChanged = true + } + + if d.HasChange("asn") { + req.Asn = types.ExpandUint32Ptr(d.Get("asn")) + hasChanged = true + } + + if hasChanged { + _, err = api.UpdateCustomerGateway(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } + + return ResourceCustomerGatewayRead(ctx, d, m) +} + +func ResourceCustomerGatewayDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = api.DeleteCustomerGateway(&s2s_vpn.DeleteCustomerGatewayRequest{ + Region: region, + GatewayID: id, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/internal/services/s2svpn/customer_gateway_test.go b/internal/services/s2svpn/customer_gateway_test.go new file mode 100644 index 0000000000..80f55948ae --- /dev/null +++ b/internal/services/s2svpn/customer_gateway_test.go @@ -0,0 +1,100 @@ +package s2svpn_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn" +) + +func TestAccCustomerGateway_Basic(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + ProtoV6ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckCustomerGatewayDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_instance_ip" "main" {} + + resource "scaleway_s2s_vpn_customer_gateway" "main" { + name = "tf-test-customer-gateway" + ipv4_public = scaleway_instance_ip.main.address + asn = 65000 + region = "fr-par" + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckCustomerGatewayExists(tt, "scaleway_s2s_vpn_customer_gateway.main"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_customer_gateway.main", "name", "tf-test-customer-gateway"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_customer_gateway.main", "asn", "65000"), + resource.TestCheckResourceAttrPair("scaleway_s2s_vpn_customer_gateway.main", "ipv4_public", "scaleway_instance_ip.main", "address"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_customer_gateway.main", "updated_at"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_customer_gateway.main", "created_at"), + ), + }, + }, + }) +} + +func testAccCheckCustomerGatewayExists(tt *acctest.TestTools, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource not found: %s", n) + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetCustomerGateway(&s2s_vpn.GetCustomerGatewayRequest{ + GatewayID: id, + Region: region, + }) + + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckCustomerGatewayDestroy(tt *acctest.TestTools) resource.TestCheckFunc { + return func(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "scaleway_s2s_vpn_customer_gateway" { + continue + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetCustomerGateway(&s2s_vpn.GetCustomerGatewayRequest{ + GatewayID: id, + Region: region, + }) + + if err == nil { + return fmt.Errorf("customer gateway (%s) still exists", rs.Primary.ID) + } + + if !httperrors.Is404(err) { + return err + } + } + + return nil + } +} diff --git a/internal/services/s2svpn/helpers_s2svpn.go b/internal/services/s2svpn/helpers_s2svpn.go new file mode 100644 index 0000000000..d2d487d3db --- /dev/null +++ b/internal/services/s2svpn/helpers_s2svpn.go @@ -0,0 +1,33 @@ +package s2svpn + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + s2svpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta" +) + +// NewAPIWithRegion returns a new s2svpn API and the region for a Create request +func NewAPIWithRegion(d *schema.ResourceData, m interface{}) (*s2svpn.API, scw.Region, error) { + s2svpnAPI := s2svpn.NewAPI(meta.ExtractScwClient(m)) + + region, err := meta.ExtractRegion(d, m) + if err != nil { + return nil, "", err + } + + return s2svpnAPI, region, nil +} + +// NewAPIWithRegionAndID returns a new s2svpn API with region and ID extracted from the state +func NewAPIWithRegionAndID(m interface{}, regionalID string) (*s2svpn.API, scw.Region, string, error) { + s2svpnAPI := s2svpn.NewAPI(meta.ExtractScwClient(m)) + + region, ID, err := regional.ParseID(regionalID) + if err != nil { + return nil, "", "", err + } + + return s2svpnAPI, region, ID, nil +} diff --git a/internal/services/s2svpn/routing_policy.go b/internal/services/s2svpn/routing_policy.go new file mode 100644 index 0000000000..19e5cf785e --- /dev/null +++ b/internal/services/s2svpn/routing_policy.go @@ -0,0 +1,217 @@ +package s2svpn + +import ( + "context" + + _ "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func ResourceRoutingPolicy() *schema.Resource { + return &schema.Resource{ + CreateContext: ResourceRoutingPolicyCreate, + ReadContext: ResourceRoutingPolicyRead, + UpdateContext: ResourceRoutingPolicyUpdate, + DeleteContext: ResourceRoutingPolicyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 0, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The name of the routing policy", + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Description: "The list of tags to apply to the routing policy", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "is_ipv6": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + Description: "IP prefixes version of the routing policy", + }, + "prefix_filter_in": { + Type: schema.TypeList, + Optional: true, + Description: "IP prefixes to accept from the peer (ranges of route announcements to accept)", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.IsCIDR, + }, + }, + "prefix_filter_out": { + Type: schema.TypeList, + Optional: true, + Description: "IP prefix filters to advertise to the peer (ranges of routes to advertise)", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.IsCIDR, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the creation of the TLS stage", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the last update of the TLS stage", + }, + "region": regional.Schema(), + "project_id": account.ProjectIDSchema(), + "organization_id": { + Type: schema.TypeString, + Computed: true, + Description: "Organization ID of the Project", + }, + }, + } +} + +func ResourceRoutingPolicyCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, err := NewAPIWithRegion(d, m) + if err != nil { + return diag.FromErr(err) + } + + prefixFilterIn, err := expandPrefixFilters(d.Get("prefix_filter_in")) + if err != nil { + return diag.FromErr(err) + } + + prefixFilterOut, err := expandPrefixFilters(d.Get("prefix_filter_out")) + if err != nil { + return diag.FromErr(err) + } + + req := &s2s_vpn.CreateRoutingPolicyRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + Name: types.ExpandOrGenerateString(d.Get("name").(string), "connection"), + Tags: types.ExpandStrings(d.Get("tags")), + IsIPv6: d.Get("is_ipv6").(bool), + PrefixFilterIn: prefixFilterIn, + PrefixFilterOut: prefixFilterOut, + } + + res, err := api.CreateRoutingPolicy(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(regional.NewIDString(region, res.ID)) + + return ResourceRoutingPolicyRead(ctx, d, m) +} + +func ResourceRoutingPolicyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + policy, err := api.GetRoutingPolicy(&s2s_vpn.GetRoutingPolicyRequest{ + RoutingPolicyID: id, + Region: region, + }, scw.WithContext(ctx)) + if err != nil { + if httperrors.Is404(err) { + d.SetId("") + return nil + } + return diag.FromErr(err) + } + + prefixFilterIn, err := FlattenPrefixFilters(policy.PrefixFilterIn) + if err != nil { + return diag.FromErr(err) + } + + prefixFilterOut, err := FlattenPrefixFilters(policy.PrefixFilterOut) + if err != nil { + return diag.FromErr(err) + } + + _ = d.Set("name", policy.Name) + _ = d.Set("region", policy.Region) + _ = d.Set("project_id", policy.ProjectID) + _ = d.Set("organization_id", policy.OrganizationID) + _ = d.Set("tags", policy.Tags) + _ = d.Set("created_at", types.FlattenTime(policy.CreatedAt)) + _ = d.Set("updated_at", types.FlattenTime(policy.UpdatedAt)) + _ = d.Set("is_ipv6", policy.IsIPv6) + _ = d.Set("prefix_filter_in", prefixFilterIn) + _ = d.Set("prefix_filter_out", prefixFilterOut) + + return nil +} + +func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + hasChanged := false + + req := &s2s_vpn.UpdateRoutingPolicyRequest{ + Region: region, + RoutingPolicyID: id, + } + + if d.HasChange("name") { + req.Name = types.ExpandUpdatedStringPtr(d.Get("name")) + hasChanged = true + } + + if d.HasChange("tags") { + req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) + hasChanged = true + } + + // ask why *[]string for prefix filters + + if hasChanged { + _, err = api.UpdateRoutingPolicy(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } + + return ResourceRoutingPolicyRead(ctx, d, m) +} + +func ResourceRoutingPolicyDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = api.DeleteRoutingPolicy(&s2s_vpn.DeleteRoutingPolicyRequest{ + Region: region, + RoutingPolicyID: id, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/internal/services/s2svpn/routing_policy_test.go b/internal/services/s2svpn/routing_policy_test.go new file mode 100644 index 0000000000..564dc9b0a5 --- /dev/null +++ b/internal/services/s2svpn/routing_policy_test.go @@ -0,0 +1,100 @@ +package s2svpn_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn" +) + +func TestAccRoutingPolicy_Basic(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + ProtoV6ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckRoutingPolicyDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_s2s_vpn_routing_policy" "main" { + name = "tf-test-routing-policy" + prefix_filter_in = ["10.0.1.0/24"] + prefix_filter_out = ["10.0.2.0/24"] + region = "fr-par" + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckRoutingPolicyExists(tt, "scaleway_s2s_vpn_routing_policy.main"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_routing_policy.main", "name", "tf-test-routing-policy"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_routing_policy.main", "is_ipv6", "false"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_routing_policy.main", "region", "fr-par"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_routing_policy.main", "prefix_filter_in.#", "1"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_routing_policy.main", "prefix_filter_out.#", "1"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_routing_policy.main", "created_at"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_routing_policy.main", "updated_at"), + ), + }, + }, + }) +} + +func testAccCheckRoutingPolicyExists(tt *acctest.TestTools, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource not found: %s", n) + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetRoutingPolicy(&s2s_vpn.GetRoutingPolicyRequest{ + RoutingPolicyID: id, + Region: region, + }) + + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckRoutingPolicyDestroy(tt *acctest.TestTools) resource.TestCheckFunc { + return func(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "scaleway_s2s_vpn_routing_policy" { + continue + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetRoutingPolicy(&s2s_vpn.GetRoutingPolicyRequest{ + RoutingPolicyID: id, + Region: region, + }) + + if err == nil { + return fmt.Errorf("routing policy (%s) still exists", rs.Primary.ID) + } + + if !httperrors.Is404(err) { + return err + } + } + + return nil + } +} diff --git a/internal/services/s2svpn/sweep_test.go b/internal/services/s2svpn/sweep_test.go new file mode 100644 index 0000000000..4cca056c76 --- /dev/null +++ b/internal/services/s2svpn/sweep_test.go @@ -0,0 +1,16 @@ +package s2svpn_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + s2svpntestfuncs "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn/testfuncs" +) + +func init() { + s2svpntestfuncs.AddTestSweepers() +} + +func TestMain(m *testing.M) { + resource.TestMain(m) +} diff --git a/internal/services/s2svpn/testdata/connection-basic.cassette.yaml b/internal/services/s2svpn/testdata/connection-basic.cassette.yaml new file mode 100644 index 0000000000..9391bc72f9 --- /dev/null +++ b/internal/services/s2svpn/testdata/connection-basic.cassette.yaml @@ -0,0 +1,2310 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 118 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf-test-vpc-connection","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":[],"enable_routing":false}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 420 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:05.998412Z","custom_routes_propagation_enabled":true,"id":"06aa0615-f37b-461a-85c1-c73a4d361ef5","is_default":false,"name":"tf-test-vpc-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:43:05.998412Z"}' + headers: + Content-Length: + - "420" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 388bf8ed-edf4-4358-bcc3-891621cd5b90 + status: 200 OK + code: 200 + duration: 506.759166ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 193 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-routing-policy-connection","tags":[],"is_ipv6":false,"prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.0.0/24"]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.027571Z","id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3","is_ipv6":false,"name":"tf-test-routing-policy-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.0.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:43:06.027571Z"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7eb5f2c6-a70c-4731-8690-0a7dc0936a25 + status: 200 OK + code: 200 + duration: 523.477875ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/06aa0615-f37b-461a-85c1-c73a4d361ef5 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 420 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:05.998412Z","custom_routes_propagation_enabled":true,"id":"06aa0615-f37b-461a-85c1-c73a4d361ef5","is_default":false,"name":"tf-test-vpc-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:43:05.998412Z"}' + headers: + Content-Length: + - "420" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 098cec14-d633-4c38-9306-021e70620846 + status: 200 OK + code: 200 + duration: 28.3055ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/3c5a789b-cc13-488b-af08-64c9a34f7bb3 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.027571Z","id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3","is_ipv6":false,"name":"tf-test-routing-policy-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.0.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:43:06.027571Z"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d0d62428-f295-47a8-80e3-e3962915dd83 + status: 200 OK + code: 200 + duration: 38.433458ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 50 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.138.130","id":"89b25544-96c1-4933-8937-41c38aecb0ce","ipam_id":"89b25544-96c1-4933-8937-41c38aecb0ce","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Location: + - https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/89b25544-96c1-4933-8937-41c38aecb0ce + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - feb720dd-96a9-4364-a45f-1287c8b9cff0 + status: 201 Created + code: 201 + duration: 709.55725ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/89b25544-96c1-4933-8937-41c38aecb0ce + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.138.130","id":"89b25544-96c1-4933-8937-41c38aecb0ce","ipam_id":"89b25544-96c1-4933-8937-41c38aecb0ce","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 05de7416-3ac6-4e97-baeb-47b194668f63 + status: 200 OK + code: 200 + duration: 75.853042ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 150 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-customer-gateway-connection","tags":[],"ipv4_public":"51.15.138.130","asn":65000}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 345 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:43:06.370544Z","id":"7c884776-0d7e-40d8-8af1-887e53292851","name":"tf-test-customer-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.138.130","tags":[],"updated_at":"2025-12-05T09:43:06.370544Z"}' + headers: + Content-Length: + - "345" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1eaa896a-f47e-4003-a708-0d5ef56ac2ef + status: 200 OK + code: 200 + duration: 73.140375ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/7c884776-0d7e-40d8-8af1-887e53292851 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 345 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:43:06.370544Z","id":"7c884776-0d7e-40d8-8af1-887e53292851","name":"tf-test-customer-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.138.130","tags":[],"updated_at":"2025-12-05T09:43:06.370544Z"}' + headers: + Content-Length: + - "345" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e5e5c22d-4fbc-4a33-91f7-1b8066daea62 + status: 200 OK + code: 200 + duration: 44.037875ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 211 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf-pn-hardcore-mestorf","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":[],"subnets":["10.0.0.0/24"],"vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5","default_route_propagation_enabled":false}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1089 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.088047Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","name":"tf-pn-hardcore-mestorf","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:43:06.088047Z","id":"ca77ff7a-ca70-4588-9a85-dbea9979458d","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"},{"created_at":"2025-12-05T09:43:06.088047Z","id":"d6b05c36-c4d5-4c25-9ba6-9aa41e463054","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:b00a::/64","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}],"tags":[],"updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}' + headers: + Content-Length: + - "1089" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b3924a56-9c43-42f9-8461-b07118fd6dd3 + status: 200 OK + code: 200 + duration: 567.432709ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/65b6ade4-db6e-4777-8a04-131b4d26ff6f + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1089 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.088047Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","name":"tf-pn-hardcore-mestorf","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:43:06.088047Z","id":"ca77ff7a-ca70-4588-9a85-dbea9979458d","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"},{"created_at":"2025-12-05T09:43:06.088047Z","id":"d6b05c36-c4d5-4c25-9ba6-9aa41e463054","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:b00a::/64","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}],"tags":[],"updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}' + headers: + Content-Length: + - "1089" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1a9f4181-ea61-48b6-811b-c52490739e54 + status: 200 OK + code: 200 + duration: 47.883083ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 204 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-vpn-gateway-connection","tags":[],"gateway_type":"VGW-S","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","zone":"fr-par-1"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:07 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 298a95a7-0181-406c-9f48-86abe2ac87ec + status: 200 OK + code: 200 + duration: 759.250042ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:07 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5dc12307-be52-448c-aebd-7a0be8db864d + status: 200 OK + code: 200 + duration: 27.027334ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:12 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 746f80d0-2cb5-4ea2-963b-65b2b3a95dfd + status: 200 OK + code: 200 + duration: 47.703167ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:17 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 946ce08d-2bb1-4be3-a6ac-780f0cb7e15b + status: 200 OK + code: 200 + duration: 49.421458ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:22 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 66d756aa-ffd5-42f0-85c5-d1391f0e0401 + status: 200 OK + code: 200 + duration: 56.44925ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:27 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cb9f2ba9-611e-42b0-a63d-09d0829125ef + status: 200 OK + code: 200 + duration: 55.174125ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:32 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b9dfff34-889f-4c2e-b7e4-3f52a1f5c877 + status: 200 OK + code: 200 + duration: 58.027416ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 97891eeb-a786-4690-8727-39d43650a863 + status: 200 OK + code: 200 + duration: 58.500958ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 781 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:07.297260Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "781" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:42 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 54b11e0e-fb9f-4e69-874b-e45353e0d498 + status: 200 OK + code: 200 + duration: 46.2965ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 775 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"active","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:47.365573Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "775" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:47 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 145efcd3-5c61-4118-a863-5307197e0ffa + status: 200 OK + code: 200 + duration: 72.912167ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 775 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"active","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:47.365573Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "775" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:47 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2c42183d-7dc4-4522-91a0-7487629e2717 + status: 200 OK + code: 200 + duration: 41.294333ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 607 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-connection","tags":[],"is_ipv6":false,"initiation_policy":"customer_gateway","ikev2_ciphers":[{"encryption":"aes256","integrity":"sha256","dh_group":"modp2048"}],"esp_ciphers":[{"encryption":"aes256","integrity":"sha256","dh_group":"modp2048"}],"enable_route_propagation":true,"vpn_gateway_id":"d20857c8-9303-4e60-b10d-40b7bf949474","customer_gateway_id":"7c884776-0d7e-40d8-8af1-887e53292851","bgp_config_ipv4":{"routing_policy_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3","private_ip":"169.254.0.1/30","peer_private_ip":"169.254.0.2/30"}}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1133 + uncompressed: false + body: '{"connection":{"bgp_session_ipv4":{"peer_private_ip":"169.254.0.2/30","private_ip":"169.254.0.1/30","routing_policy_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3"},"bgp_status_ipv4":"down","bgp_status_ipv6":"disabled","created_at":"2025-12-05T09:43:48.055138Z","customer_gateway_id":"7c884776-0d7e-40d8-8af1-887e53292851","esp_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"id":"da69ba2c-1966-42af-b5d8-07b02dcc865d","ikev2_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"initiation_policy":"customer_gateway","is_ipv6":false,"name":"tf-test-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","route_propagation_enabled":true,"secret_id":"6ae6a452-04ec-4933-8a19-169d16ace6e5","secret_revision":1,"status":"down","tags":[],"tunnel_status":"down","tunnel_status_ipv4":"unknown_tunnel_status","tunnel_status_ipv6":"unknown_tunnel_status","updated_at":"2025-12-05T09:43:48.055138Z","vpn_gateway_id":"d20857c8-9303-4e60-b10d-40b7bf949474"},"pre_shared_key":""}' + headers: + Content-Length: + - "1133" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:48 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d9fe6cd4-a719-4739-a415-15742fa707d8 + status: 200 OK + code: 200 + duration: 716.587125ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections/da69ba2c-1966-42af-b5d8-07b02dcc865d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1097 + uncompressed: false + body: '{"bgp_session_ipv4":{"peer_private_ip":"169.254.0.2/30","private_ip":"169.254.0.1/30","routing_policy_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3"},"bgp_status_ipv4":"down","bgp_status_ipv6":"disabled","created_at":"2025-12-05T09:43:48.055138Z","customer_gateway_id":"7c884776-0d7e-40d8-8af1-887e53292851","esp_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"id":"da69ba2c-1966-42af-b5d8-07b02dcc865d","ikev2_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"initiation_policy":"customer_gateway","is_ipv6":false,"name":"tf-test-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","route_propagation_enabled":true,"secret_id":"6ae6a452-04ec-4933-8a19-169d16ace6e5","secret_revision":1,"status":"down","tags":[],"tunnel_status":"down","tunnel_status_ipv4":"unknown_tunnel_status","tunnel_status_ipv6":"unknown_tunnel_status","updated_at":"2025-12-05T09:43:48.055138Z","vpn_gateway_id":"d20857c8-9303-4e60-b10d-40b7bf949474"}' + headers: + Content-Length: + - "1097" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:48 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 74658c3e-a237-4a60-a208-654b3006c8d2 + status: 200 OK + code: 200 + duration: 53.06625ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections/da69ba2c-1966-42af-b5d8-07b02dcc865d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1097 + uncompressed: false + body: '{"bgp_session_ipv4":{"peer_private_ip":"169.254.0.2/30","private_ip":"169.254.0.1/30","routing_policy_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3"},"bgp_status_ipv4":"down","bgp_status_ipv6":"disabled","created_at":"2025-12-05T09:43:48.055138Z","customer_gateway_id":"7c884776-0d7e-40d8-8af1-887e53292851","esp_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"id":"da69ba2c-1966-42af-b5d8-07b02dcc865d","ikev2_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"initiation_policy":"customer_gateway","is_ipv6":false,"name":"tf-test-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","route_propagation_enabled":true,"secret_id":"6ae6a452-04ec-4933-8a19-169d16ace6e5","secret_revision":1,"status":"down","tags":[],"tunnel_status":"down","tunnel_status_ipv4":"unknown_tunnel_status","tunnel_status_ipv6":"unknown_tunnel_status","updated_at":"2025-12-05T09:43:48.055138Z","vpn_gateway_id":"d20857c8-9303-4e60-b10d-40b7bf949474"}' + headers: + Content-Length: + - "1097" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:48 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 336d5dcf-fe7f-45a0-a7bf-2f100e94cccc + status: 200 OK + code: 200 + duration: 18.230375ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/06aa0615-f37b-461a-85c1-c73a4d361ef5 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 420 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:05.998412Z","custom_routes_propagation_enabled":true,"id":"06aa0615-f37b-461a-85c1-c73a4d361ef5","is_default":false,"name":"tf-test-vpc-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:43:05.998412Z"}' + headers: + Content-Length: + - "420" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9dc40120-2966-49f0-b4c2-84eba1c42414 + status: 200 OK + code: 200 + duration: 32.243541ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/3c5a789b-cc13-488b-af08-64c9a34f7bb3 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.027571Z","id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3","is_ipv6":false,"name":"tf-test-routing-policy-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.0.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:43:06.027571Z"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 15459b78-a6c5-4cf9-a7b8-e161bc740392 + status: 200 OK + code: 200 + duration: 44.289792ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/65b6ade4-db6e-4777-8a04-131b4d26ff6f + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1089 + uncompressed: false + body: '{"created_at":"2025-12-05T09:43:06.088047Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","name":"tf-pn-hardcore-mestorf","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:43:06.088047Z","id":"ca77ff7a-ca70-4588-9a85-dbea9979458d","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"},{"created_at":"2025-12-05T09:43:06.088047Z","id":"d6b05c36-c4d5-4c25-9ba6-9aa41e463054","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:b00a::/64","updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}],"tags":[],"updated_at":"2025-12-05T09:43:06.088047Z","vpc_id":"06aa0615-f37b-461a-85c1-c73a4d361ef5"}' + headers: + Content-Length: + - "1089" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0018a70e-bcc4-46f6-9516-dc56f541003e + status: 200 OK + code: 200 + duration: 27.074666ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/89b25544-96c1-4933-8937-41c38aecb0ce + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.138.130","id":"89b25544-96c1-4933-8937-41c38aecb0ce","ipam_id":"89b25544-96c1-4933-8937-41c38aecb0ce","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ba0b956e-5743-4250-abee-ac2df4540c97 + status: 200 OK + code: 200 + duration: 84.153292ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 780 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"configuring","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:48.673350Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "780" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5366876c-a48b-4816-83f2-4bac472ed71b + status: 200 OK + code: 200 + duration: 32.541375ms + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/7c884776-0d7e-40d8-8af1-887e53292851 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 345 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:43:06.370544Z","id":"7c884776-0d7e-40d8-8af1-887e53292851","name":"tf-test-customer-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.138.130","tags":[],"updated_at":"2025-12-05T09:43:06.370544Z"}' + headers: + Content-Length: + - "345" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fe1fa1a6-b61d-4a7a-b229-bb59061616d7 + status: 200 OK + code: 200 + duration: 44.827291ms + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 775 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"active","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:50.574479Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "775" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0dd844c0-f1ab-473b-a42d-69dedf55c349 + status: 200 OK + code: 200 + duration: 35.949208ms + - id: 31 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections/da69ba2c-1966-42af-b5d8-07b02dcc865d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1097 + uncompressed: false + body: '{"bgp_session_ipv4":{"peer_private_ip":"169.254.0.2/30","private_ip":"169.254.0.1/30","routing_policy_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3"},"bgp_status_ipv4":"down","bgp_status_ipv6":"disabled","created_at":"2025-12-05T09:43:48.055138Z","customer_gateway_id":"7c884776-0d7e-40d8-8af1-887e53292851","esp_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"id":"da69ba2c-1966-42af-b5d8-07b02dcc865d","ikev2_ciphers":[{"dh_group":"modp2048","encryption":"aes256","integrity":"sha256"}],"initiation_policy":"customer_gateway","is_ipv6":false,"name":"tf-test-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","route_propagation_enabled":true,"secret_id":"6ae6a452-04ec-4933-8a19-169d16ace6e5","secret_revision":1,"status":"down","tags":[],"tunnel_status":"down","tunnel_status_ipv4":"unknown_tunnel_status","tunnel_status_ipv6":"unknown_tunnel_status","updated_at":"2025-12-05T09:43:48.055138Z","vpn_gateway_id":"d20857c8-9303-4e60-b10d-40b7bf949474"}' + headers: + Content-Length: + - "1097" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1561b301-50d8-4031-9db9-5ca79099d33c + status: 200 OK + code: 200 + duration: 51.348417ms + - id: 32 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections/da69ba2c-1966-42af-b5d8-07b02dcc865d + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bbbbfdbc-b087-4a5c-95eb-2e28be4dc918 + status: 204 No Content + code: 204 + duration: 327.559125ms + - id: 33 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 780 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"configuring","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:54.469370Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "780" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bd7b25ea-37d5-4482-90dd-bc3a65e07840 + status: 200 OK + code: 200 + duration: 33.449292ms + - id: 34 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/7c884776-0d7e-40d8-8af1-887e53292851 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b3ac2903-db6e-4598-b105-4d8cb0d79e0f + status: 204 No Content + code: 204 + duration: 51.074667ms + - id: 35 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/3c5a789b-cc13-488b-af08-64c9a34f7bb3 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7aa90c91-2bef-45c4-9f81-1e3c76347329 + status: 204 No Content + code: 204 + duration: 56.960209ms + - id: 36 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/89b25544-96c1-4933-8937-41c38aecb0ce + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:55 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 00cec724-c5df-4b4e-bad7-2ff7776f34d5 + status: 204 No Content + code: 204 + duration: 250.276792ms + - id: 37 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 775 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"active","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:57.613391Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "775" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:59 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f8904f6d-c3fa-46d2-afdd-90406a44f858 + status: 200 OK + code: 200 + duration: 44.074708ms + - id: 38 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:59.895619Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "783" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:59 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2940c293-a655-4bc8-bff9-35ff13383882 + status: 200 OK + code: 200 + duration: 80.208542ms + - id: 39 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:43:07.297260Z","gateway_type":"VGW-S","id":"d20857c8-9303-4e60-b10d-40b7bf949474","ipam_private_ipv4_id":"eaf90da1-b987-41e6-a0dc-31c1dcd7ffc2","ipam_private_ipv6_id":"380b81aa-75d1-4eb1-9f43-e521587495bb","name":"tf-test-vpn-gateway-connection","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"65b6ade4-db6e-4777-8a04-131b4d26ff6f","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"d8d31d4c-c8d5-4e5e-9634-a2a2d141c8cc","ipam_ipv6_id":"e4a6aaf8-3d62-4606-9b14-88c521626bc3"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=163.172.176.240/32","public_ipv6=2001:bc8:711:1213::/64"],"updated_at":"2025-12-05T09:43:59.895619Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "783" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:43:59 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 435e9b9c-30d1-445d-b32f-b116c85b27a3 + status: 200 OK + code: 200 + duration: 63.799375ms + - id: 40 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"vpn_gateway","resource_id":"d20857c8-9303-4e60-b10d-40b7bf949474","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:05 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0dd7baf5-644c-4e5e-a133-902a4171ebcd + status: 404 Not Found + code: 404 + duration: 25.07875ms + - id: 41 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/65b6ade4-db6e-4777-8a04-131b4d26ff6f + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bf5f6b51-17ce-483e-a4c0-507199042c11 + status: 204 No Content + code: 204 + duration: 1.289485333s + - id: 42 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/06aa0615-f37b-461a-85c1-c73a4d361ef5 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3560a90c-3680-47dd-b117-d8966342a413 + status: 204 No Content + code: 204 + duration: 221.038625ms + - id: 43 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/connections/da69ba2c-1966-42af-b5d8-07b02dcc865d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 131 + uncompressed: false + body: '{"message":"resource is not found","resource":"connection","resource_id":"da69ba2c-1966-42af-b5d8-07b02dcc865d","type":"not_found"}' + headers: + Content-Length: + - "131" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6ac79211-c2a1-4137-8b39-e999183c5bba + status: 404 Not Found + code: 404 + duration: 22.986166ms + - id: 44 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/d20857c8-9303-4e60-b10d-40b7bf949474 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"vpn_gateway","resource_id":"d20857c8-9303-4e60-b10d-40b7bf949474","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 06886703-2c00-4fda-848f-a869bd7658bf + status: 404 Not Found + code: 404 + duration: 29.819375ms + - id: 45 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/7c884776-0d7e-40d8-8af1-887e53292851 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 137 + uncompressed: false + body: '{"message":"resource is not found","resource":"customer_gateway","resource_id":"7c884776-0d7e-40d8-8af1-887e53292851","type":"not_found"}' + headers: + Content-Length: + - "137" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bae2f159-c2cf-4502-9655-158afff2b8ef + status: 404 Not Found + code: 404 + duration: 25.166625ms + - id: 46 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/3c5a789b-cc13-488b-af08-64c9a34f7bb3 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 135 + uncompressed: false + body: '{"message":"resource is not found","resource":"routing_policy","resource_id":"3c5a789b-cc13-488b-af08-64c9a34f7bb3","type":"not_found"}' + headers: + Content-Length: + - "135" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:44:06 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - db7d6ce0-17bd-4e10-8b3e-c3f1bd5246bf + status: 404 Not Found + code: 404 + duration: 24.258833ms diff --git a/internal/services/s2svpn/testdata/customer-gateway-basic.cassette.yaml b/internal/services/s2svpn/testdata/customer-gateway-basic.cassette.yaml new file mode 100644 index 0000000000..7645823b74 --- /dev/null +++ b/internal/services/s2svpn/testdata/customer-gateway-basic.cassette.yaml @@ -0,0 +1,495 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 50 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.128.186","id":"947f8278-8cf9-4902-8ada-9d694107291e","ipam_id":"947f8278-8cf9-4902-8ada-9d694107291e","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:27 GMT + Location: + - https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/947f8278-8cf9-4902-8ada-9d694107291e + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9086d55d-eff1-434b-b2c5-32eedfea7aa7 + status: 201 Created + code: 201 + duration: 419.233375ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/947f8278-8cf9-4902-8ada-9d694107291e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.128.186","id":"947f8278-8cf9-4902-8ada-9d694107291e","ipam_id":"947f8278-8cf9-4902-8ada-9d694107291e","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:27 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fdd9ebba-442e-420c-a8a7-0b18709e342a + status: 200 OK + code: 200 + duration: 112.301875ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 139 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-customer-gateway","tags":[],"ipv4_public":"51.15.128.186","asn":65000}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:36:27.669033Z","id":"9ccfe336-9077-4f3d-90b8-cc401a049c16","name":"tf-test-customer-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.128.186","tags":[],"updated_at":"2025-12-05T09:36:27.669033Z"}' + headers: + Content-Length: + - "334" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:27 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0e7bf26a-ef0d-481d-a6c0-ae6e146e7354 + status: 200 OK + code: 200 + duration: 170.017584ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/9ccfe336-9077-4f3d-90b8-cc401a049c16 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:36:27.669033Z","id":"9ccfe336-9077-4f3d-90b8-cc401a049c16","name":"tf-test-customer-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.128.186","tags":[],"updated_at":"2025-12-05T09:36:27.669033Z"}' + headers: + Content-Length: + - "334" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:27 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b9205b2d-68d3-4475-ada0-e3b72af1ec41 + status: 200 OK + code: 200 + duration: 90.819375ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/9ccfe336-9077-4f3d-90b8-cc401a049c16 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:36:27.669033Z","id":"9ccfe336-9077-4f3d-90b8-cc401a049c16","name":"tf-test-customer-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.128.186","tags":[],"updated_at":"2025-12-05T09:36:27.669033Z"}' + headers: + Content-Length: + - "334" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:27 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7dac648b-01b6-4878-a89f-d009d4d5188d + status: 200 OK + code: 200 + duration: 94.136042ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/947f8278-8cf9-4902-8ada-9d694107291e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 365 + uncompressed: false + body: '{"ip":{"address":"51.15.128.186","id":"947f8278-8cf9-4902-8ada-9d694107291e","ipam_id":"947f8278-8cf9-4902-8ada-9d694107291e","organization":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix":null,"project":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","reverse":null,"server":null,"state":"detached","tags":[],"type":"routed_ipv4","zone":"fr-par-1"}}' + headers: + Content-Length: + - "365" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 25b699df-c5f5-4a87-9bb6-307b9f0b6b65 + status: 200 OK + code: 200 + duration: 99.399333ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/9ccfe336-9077-4f3d-90b8-cc401a049c16 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"asn":65000,"created_at":"2025-12-05T09:36:27.669033Z","id":"9ccfe336-9077-4f3d-90b8-cc401a049c16","name":"tf-test-customer-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_ipv4":"51.15.128.186","tags":[],"updated_at":"2025-12-05T09:36:27.669033Z"}' + headers: + Content-Length: + - "334" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d1a53954-d774-420e-a276-36cde1bfb176 + status: 200 OK + code: 200 + duration: 72.784458ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/9ccfe336-9077-4f3d-90b8-cc401a049c16 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fc5c0bd1-9545-411b-9765-6dd06eb504e6 + status: 204 No Content + code: 204 + duration: 54.810208ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/instance/v1/zones/fr-par-1/ips/947f8278-8cf9-4902-8ada-9d694107291e + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b58831c7-466a-438f-8be7-bb83e9bfaec6 + status: 204 No Content + code: 204 + duration: 193.136334ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/customer-gateways/9ccfe336-9077-4f3d-90b8-cc401a049c16 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 137 + uncompressed: false + body: '{"message":"resource is not found","resource":"customer_gateway","resource_id":"9ccfe336-9077-4f3d-90b8-cc401a049c16","type":"not_found"}' + headers: + Content-Length: + - "137" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:36:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 12b0a259-1964-4b53-b92c-100c23e92e33 + status: 404 Not Found + code: 404 + duration: 20.354042ms diff --git a/internal/services/s2svpn/testdata/routing-policy-basic.cassette.yaml b/internal/services/s2svpn/testdata/routing-policy-basic.cassette.yaml new file mode 100644 index 0000000000..faa993b4bb --- /dev/null +++ b/internal/services/s2svpn/testdata/routing-policy-basic.cassette.yaml @@ -0,0 +1,297 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 182 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-routing-policy","tags":[],"is_ipv6":false,"prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.2.0/24"]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 397 + uncompressed: false + body: '{"created_at":"2025-12-05T09:32:03.778567Z","id":"b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac","is_ipv6":false,"name":"tf-test-routing-policy","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.2.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:32:03.778567Z"}' + headers: + Content-Length: + - "397" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4b9cb6b4-ee3e-430e-b053-9a3623957a30 + status: 200 OK + code: 200 + duration: 225.773ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 397 + uncompressed: false + body: '{"created_at":"2025-12-05T09:32:03.778567Z","id":"b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac","is_ipv6":false,"name":"tf-test-routing-policy","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.2.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:32:03.778567Z"}' + headers: + Content-Length: + - "397" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d842b5c8-ccf7-4381-9a51-d993f5a7a2cd + status: 200 OK + code: 200 + duration: 81.742333ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 397 + uncompressed: false + body: '{"created_at":"2025-12-05T09:32:03.778567Z","id":"b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac","is_ipv6":false,"name":"tf-test-routing-policy","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.2.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:32:03.778567Z"}' + headers: + Content-Length: + - "397" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:04 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4b29ef45-7f81-4721-a5dd-d1134ca1ef68 + status: 200 OK + code: 200 + duration: 77.270917ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 397 + uncompressed: false + body: '{"created_at":"2025-12-05T09:32:03.778567Z","id":"b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac","is_ipv6":false,"name":"tf-test-routing-policy","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","prefix_filter_in":["10.0.1.0/24"],"prefix_filter_out":["10.0.2.0/24"],"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2025-12-05T09:32:03.778567Z"}' + headers: + Content-Length: + - "397" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:04 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0be6a96c-6687-41ac-97ac-cbef8c532c1f + status: 200 OK + code: 200 + duration: 60.706958ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:04 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 771462de-9f00-405e-ae68-ed4c75a312d9 + status: 204 No Content + code: 204 + duration: 83.256125ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/routing-policies/b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 135 + uncompressed: false + body: '{"message":"resource is not found","resource":"routing_policy","resource_id":"b0832ffa-3b4c-4a7e-a224-5c84fc7aa4ac","type":"not_found"}' + headers: + Content-Length: + - "135" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:32:04 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 51964991-82df-4691-81fd-37e6e48eadcf + status: 404 Not Found + code: 404 + duration: 19.848375ms diff --git a/internal/services/s2svpn/testdata/vpn-gateway-basic.cassette.yaml b/internal/services/s2svpn/testdata/vpn-gateway-basic.cassette.yaml new file mode 100644 index 0000000000..5cf3ce26f3 --- /dev/null +++ b/internal/services/s2svpn/testdata/vpn-gateway-basic.cassette.yaml @@ -0,0 +1,1377 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 119 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf-test-vpc-vpn-gateway","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":[],"enable_routing":false}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 421 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.526830Z","custom_routes_propagation_enabled":true,"id":"ba3039bd-bb43-438b-a465-d14dfedb6a26","is_default":false,"name":"tf-test-vpc-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:29:56.526830Z"}' + headers: + Content-Length: + - "421" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:56 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9f2f561e-1ad7-440e-ba7b-ba2931941f71 + status: 200 OK + code: 200 + duration: 513.67475ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ba3039bd-bb43-438b-a465-d14dfedb6a26 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 421 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.526830Z","custom_routes_propagation_enabled":true,"id":"ba3039bd-bb43-438b-a465-d14dfedb6a26","is_default":false,"name":"tf-test-vpc-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:29:56.526830Z"}' + headers: + Content-Length: + - "421" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:56 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 633d0475-bd52-49b1-9429-ebd7d071101a + status: 200 OK + code: 200 + duration: 60.206208ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 206 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf-pn-hungry-nash","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":[],"subnets":["10.0.0.0/24"],"vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26","default_route_propagation_enabled":false}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1084 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.676437Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"7896655c-1037-43ac-8713-1096c2b6461e","name":"tf-pn-hungry-nash","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:29:56.676437Z","id":"06d12828-cb7e-4904-9983-3c4a80a7ea1b","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"},{"created_at":"2025-12-05T09:29:56.676437Z","id":"6ec6dc79-b7e0-4f3a-8e72-a902df3b378c","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:efe3::/64","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}],"tags":[],"updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}' + headers: + Content-Length: + - "1084" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:57 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1ee0353f-bb16-4a1e-88e5-bc2001594621 + status: 200 OK + code: 200 + duration: 583.41ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/7896655c-1037-43ac-8713-1096c2b6461e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1084 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.676437Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"7896655c-1037-43ac-8713-1096c2b6461e","name":"tf-pn-hungry-nash","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:29:56.676437Z","id":"06d12828-cb7e-4904-9983-3c4a80a7ea1b","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"},{"created_at":"2025-12-05T09:29:56.676437Z","id":"6ec6dc79-b7e0-4f3a-8e72-a902df3b378c","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:efe3::/64","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}],"tags":[],"updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}' + headers: + Content-Length: + - "1084" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:57 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c55ec826-4f70-4f4c-a113-a00289b8c181 + status: 200 OK + code: 200 + duration: 25.33525ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 193 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","name":"tf-test-vpn-gateway","tags":[],"gateway_type":"VGW-S","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","zone":"fr-par-1"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:58 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fea12348-31d1-4a0d-9cb6-89bef9837083 + status: 200 OK + code: 200 + duration: 1.083256375s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:29:58 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 43716bfb-9b1e-4d2d-a29a-02c630f217dc + status: 200 OK + code: 200 + duration: 48.683459ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0f6ce523-45a1-4c1a-8fb9-851579e8c8fd + status: 200 OK + code: 200 + duration: 52.36475ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:08 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0c9fc7a1-2657-4e96-ae13-20bbac2f83e2 + status: 200 OK + code: 200 + duration: 42.270334ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:13 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 14df3602-5f22-41b3-8dcc-7f21d2316f3c + status: 200 OK + code: 200 + duration: 56.5295ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:18 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fe0e9c5b-b901-4a2a-8632-35fbd28762af + status: 200 OK + code: 200 + duration: 50.137459ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:23 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 45e28801-98c9-4bd6-b10c-c6548a736231 + status: 200 OK + code: 200 + duration: 38.293625ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b7394147-c0d6-4958-bbbe-8fe34d6313db + status: 200 OK + code: 200 + duration: 43.74275ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 768 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"provisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:29:58.114379Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "768" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:33 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 431901fd-5788-4e78-be90-6e429339871b + status: 200 OK + code: 200 + duration: 46.294208ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 762 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"active","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:38.059158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "762" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cd7be51f-af5b-4e52-bd13-10a810c2f415 + status: 200 OK + code: 200 + duration: 35.112709ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 762 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"active","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:38.059158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "762" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 98dda72f-ad3f-48c7-bf3d-529e2cbff0c7 + status: 200 OK + code: 200 + duration: 46.0635ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 762 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"active","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:38.059158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "762" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 30f8e9cc-0164-49fb-bec7-e18997fe0dab + status: 200 OK + code: 200 + duration: 37.255209ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ba3039bd-bb43-438b-a465-d14dfedb6a26 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 421 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.526830Z","custom_routes_propagation_enabled":true,"id":"ba3039bd-bb43-438b-a465-d14dfedb6a26","is_default":false,"name":"tf-test-vpc-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-12-05T09:29:56.526830Z"}' + headers: + Content-Length: + - "421" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d4288ef7-d4cc-49b2-ad15-b8b09a658e2c + status: 200 OK + code: 200 + duration: 90.931ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/7896655c-1037-43ac-8713-1096c2b6461e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1084 + uncompressed: false + body: '{"created_at":"2025-12-05T09:29:56.676437Z","default_route_propagation_enabled":false,"dhcp_enabled":true,"id":"7896655c-1037-43ac-8713-1096c2b6461e","name":"tf-pn-hungry-nash","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2025-12-05T09:29:56.676437Z","id":"06d12828-cb7e-4904-9983-3c4a80a7ea1b","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"10.0.0.0/24","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"},{"created_at":"2025-12-05T09:29:56.676437Z","id":"6ec6dc79-b7e0-4f3a-8e72-a902df3b378c","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","subnet":"fd46:78ab:30b8:efe3::/64","updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}],"tags":[],"updated_at":"2025-12-05T09:29:56.676437Z","vpc_id":"ba3039bd-bb43-438b-a465-d14dfedb6a26"}' + headers: + Content-Length: + - "1084" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 78ecda19-e03a-4401-b7cb-e2b20576c48e + status: 200 OK + code: 200 + duration: 61.483958ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 762 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"active","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:38.059158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "762" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e6548a9c-cfb8-4863-be55-a6e45e349032 + status: 200 OK + code: 200 + duration: 45.290542ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 762 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"active","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:38.059158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "762" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 66dd7ef8-a3e5-4d82-827f-359724480dcc + status: 200 OK + code: 200 + duration: 33.427542ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 770 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:39.570333Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "770" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - af9dce6e-0099-4aa1-8b85-58d58095742d + status: 200 OK + code: 200 + duration: 78.167292ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 770 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:39.570333Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "770" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 86139514-735f-42f9-9ddf-98e3ddce033f + status: 200 OK + code: 200 + duration: 38.764167ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 770 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:39.570333Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "770" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:44 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fc6b8cfd-b789-4282-a5c6-c3bdc01865d1 + status: 200 OK + code: 200 + duration: 57.721042ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 770 + uncompressed: false + body: '{"asn":12876,"created_at":"2025-12-05T09:29:58.114379Z","gateway_type":"VGW-S","id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","ipam_private_ipv4_id":"344f9fb7-84a4-41a4-b4e5-2aee2cbe3e83","ipam_private_ipv6_id":"8195b154-3576-4af1-a415-2b34e6277ff2","name":"tf-test-vpn-gateway","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_id":"7896655c-1037-43ac-8713-1096c2b6461e","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","public_config":{"ipam_ipv4_id":"5b88f3e6-7e26-4353-99b4-1ac427116e94","ipam_ipv6_id":"67549cd5-f754-4fca-9497-851d2cec08b2"},"region":"fr-par","status":"deprovisioning","tags":["public_ipv4=51.15.129.108/32","public_ipv6=2001:bc8:711:121f::/64"],"updated_at":"2025-12-05T09:30:39.570333Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "770" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e2c7c891-a144-4edc-b899-335710ba94ee + status: 200 OK + code: 200 + duration: 36.26625ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"vpn_gateway","resource_id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:54 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 68ba1f12-70b2-45bb-b29b-9a74790d205b + status: 404 Not Found + code: 404 + duration: 22.712417ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/7896655c-1037-43ac-8713-1096c2b6461e + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:56 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fd267d28-03b4-4ab8-86cd-a19f48082d32 + status: 204 No Content + code: 204 + duration: 1.288793834s + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ba3039bd-bb43-438b-a465-d14dfedb6a26 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:56 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1ac7c92e-afe6-4dad-a77f-558638b05a27 + status: 204 No Content + code: 204 + duration: 155.034417ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/s2s-vpn/v1alpha1/regions/fr-par/vpn-gateways/2723a992-24a5-4fd5-99b3-b991dcd5c74a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"vpn_gateway","resource_id":"2723a992-24a5-4fd5-99b3-b991dcd5c74a","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:30:56 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e27261b4-4e48-4178-83f8-ee7dac5b8f19 + status: 404 Not Found + code: 404 + duration: 22.5845ms diff --git a/internal/services/s2svpn/testfuncs/sweep.go b/internal/services/s2svpn/testfuncs/sweep.go new file mode 100644 index 0000000000..c080e2a82c --- /dev/null +++ b/internal/services/s2svpn/testfuncs/sweep.go @@ -0,0 +1,145 @@ +package s2svpntestfuncs + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/logging" +) + +func AddTestSweepers() { + resource.AddTestSweepers("scaleway_s2s_vpn_connection", &resource.Sweeper{ + Name: "scaleway_s2s_vpn_connection", + F: testSweepConnection, + Dependencies: []string{"scaleway_s2s_vpn_gateway", "scaleway_s2s_vpn_customer_gateway"}, + }) + + resource.AddTestSweepers("scaleway_s2s_vpn_gateway", &resource.Sweeper{ + Name: "scaleway_s2s_vpn_gateway", + F: testSweepVPNGateway, + Dependencies: []string{"scaleway_s2s_vpn_connection"}, + }) + + resource.AddTestSweepers("scaleway_s2s_vpn_customer_gateway", &resource.Sweeper{ + Name: "scaleway_s2s_vpn_customer_gateway", + F: testSweepCustomerGateway, + Dependencies: []string{"scaleway_s2s_vpn_connection"}, + }) + + resource.AddTestSweepers("scaleway_s2s_vpn_routing_policy", &resource.Sweeper{ + Name: "scaleway_s2s_vpn_routing_policy", + F: testSweepRoutingPolicy, + Dependencies: []string{"scaleway_s2s_vpn_connection"}, + }) +} + +func testSweepConnection(_ string) error { + return acctest.SweepRegions(scw.AllRegions, func(scwClient *scw.Client, region scw.Region) error { + s2svpnAPI := s2s_vpn.NewAPI(scwClient) + + logging.L.Debugf("sweeper: destroying the s2s vpn connection in (%s)", region) + + listConnections, err := s2svpnAPI.ListConnections(&s2s_vpn.ListConnectionsRequest{ + Region: region, + }, scw.WithAllPages()) + if err != nil { + return fmt.Errorf("error listing s2s vpn connections in (%s) in sweeper: %w", region, err) + } + + for _, connection := range listConnections.Connections { + err := s2svpnAPI.DeleteConnection(&s2s_vpn.DeleteConnectionRequest{ + Region: region, + ConnectionID: connection.ID, + }) + if err != nil { + return fmt.Errorf("error deleting s2s vpn connection in sweeper: %w", err) + } + } + + return nil + }) +} + +func testSweepVPNGateway(_ string) error { + return acctest.SweepRegions(scw.AllRegions, func(scwClient *scw.Client, region scw.Region) error { + s2svpnAPI := s2s_vpn.NewAPI(scwClient) + + logging.L.Debugf("sweeper: destroying the s2s vpn gateway in (%s)", region) + + listGateways, err := s2svpnAPI.ListVpnGateways(&s2s_vpn.ListVpnGatewaysRequest{ + Region: region, + }, scw.WithAllPages()) + if err != nil { + return fmt.Errorf("error listing s2s vpn gateways in (%s) in sweeper: %w", region, err) + } + + for _, gateway := range listGateways.Gateways { + _, err := s2svpnAPI.DeleteVpnGateway(&s2s_vpn.DeleteVpnGatewayRequest{ + Region: region, + GatewayID: gateway.ID, + }) + if err != nil { + return fmt.Errorf("error deleting s2s vpn gateway in sweeper: %w", err) + } + } + + return nil + }) +} + +func testSweepCustomerGateway(_ string) error { + return acctest.SweepRegions(scw.AllRegions, func(scwClient *scw.Client, region scw.Region) error { + s2svpnAPI := s2s_vpn.NewAPI(scwClient) + + logging.L.Debugf("sweeper: destroying the s2s vpn customer gateway in (%s)", region) + + listGateways, err := s2svpnAPI.ListCustomerGateways(&s2s_vpn.ListCustomerGatewaysRequest{ + Region: region, + }, scw.WithAllPages()) + if err != nil { + return fmt.Errorf("error listing s2s vpn customer gateways in (%s) in sweeper: %w", region, err) + } + + for _, gateway := range listGateways.Gateways { + err := s2svpnAPI.DeleteCustomerGateway(&s2s_vpn.DeleteCustomerGatewayRequest{ + Region: region, + GatewayID: gateway.ID, + }) + if err != nil { + return fmt.Errorf("error deleting s2s vpn customer gateway in sweeper: %w", err) + } + } + + return nil + }) +} + +func testSweepRoutingPolicy(_ string) error { + return acctest.SweepRegions(scw.AllRegions, func(scwClient *scw.Client, region scw.Region) error { + s2svpnAPI := s2s_vpn.NewAPI(scwClient) + + logging.L.Debugf("sweeper: destroying the s2s vpn routing policy in (%s)", region) + + listPolicies, err := s2svpnAPI.ListRoutingPolicies(&s2s_vpn.ListRoutingPoliciesRequest{ + Region: region, + }, scw.WithAllPages()) + if err != nil { + return fmt.Errorf("error listing s2s vpn routing policies in (%s) in sweeper: %w", region, err) + } + + for _, policy := range listPolicies.RoutingPolicies { + err := s2svpnAPI.DeleteRoutingPolicy(&s2s_vpn.DeleteRoutingPolicyRequest{ + Region: region, + RoutingPolicyID: policy.ID, + }) + if err != nil { + return fmt.Errorf("error deleting s2s vpn routing policy in sweeper: %w", err) + } + } + + return nil + }) +} diff --git a/internal/services/s2svpn/types.go b/internal/services/s2svpn/types.go new file mode 100644 index 0000000000..129be1e7e8 --- /dev/null +++ b/internal/services/s2svpn/types.go @@ -0,0 +1,177 @@ +package s2svpn + +import ( + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func expandVPNGatewayPublicConfig(raw any) *s2s_vpn.CreateVpnGatewayRequestPublicConfig { + if raw == nil || len(raw.([]any)) != 1 { + return nil + } + + rawMap := raw.([]any)[0].(map[string]any) + + return &s2s_vpn.CreateVpnGatewayRequestPublicConfig{ + IpamIPv4ID: types.ExpandStringPtr(locality.ExpandID(rawMap["ipam_ipv4_id"].(string))), + IpamIPv6ID: types.ExpandStringPtr(locality.ExpandID(rawMap["ipam_ipv6_id"].(string))), + } +} + +func expandConnectionRequestBgpConfig(raw any) (config *s2s_vpn.CreateConnectionRequestBgpConfig, err error) { + if raw == nil || len(raw.([]any)) != 1 { + return nil, nil + } + + rawMap := raw.([]any)[0].(map[string]any) + + privateIPNet, err := types.ExpandIPNet(rawMap["private_ip"].(string)) + if err != nil { + return nil, err + } + + peerPrivateIPNet, err := types.ExpandIPNet(rawMap["peer_private_ip"].(string)) + if err != nil { + return nil, err + } + + return &s2s_vpn.CreateConnectionRequestBgpConfig{ + RoutingPolicyID: locality.ExpandID(rawMap["routing_policy_id"].(string)), + PrivateIP: &privateIPNet, + PeerPrivateIP: &peerPrivateIPNet, + }, nil +} + +func expandPrefixFilters(raw any) ([]scw.IPNet, error) { + if raw == nil { + return nil, nil + } + + rawList, ok := raw.([]any) + if !ok || len(rawList) == 0 { + return nil, nil + } + + prefixes := make([]scw.IPNet, 0, len(rawList)) + for _, v := range rawList { + ipNet, err := types.ExpandIPNet(v.(string)) + if err != nil { + return nil, err + } + + prefixes = append(prefixes, ipNet) + } + + return prefixes, nil +} + +func expandConnectionCiphers(raw any) []*s2s_vpn.ConnectionCipher { + if raw == nil { + return nil + } + + rawList := raw.([]any) + + res := make([]*s2s_vpn.ConnectionCipher, 0, len(rawList)) + for _, item := range rawList { + m, ok := item.(map[string]any) + if !ok { + continue + } + + c := &s2s_vpn.ConnectionCipher{ + Encryption: s2s_vpn.ConnectionEncryption(m["encryption"].(string)), + } + + if v, ok := m["integrity"]; ok { + val := s2s_vpn.ConnectionIntegrity(v.(string)) + c.Integrity = &val + } + + if v, ok := m["dh_group"]; ok { + val := s2s_vpn.ConnectionDhGroup(v.(string)) + c.DhGroup = &val + } + + res = append(res, c) + } + + return res +} + +func flattenVPNGatewayPublicConfig(region scw.Region, config *s2s_vpn.VpnGatewayPublicConfig) any { + if config == nil { + return nil + } + + return []map[string]any{ + { + "ipam_ipv4_id": regional.NewIDString(region, types.FlattenStringPtr(config.IpamIPv4ID).(string)), + "ipam_ipv6_id": regional.NewIDString(region, types.FlattenStringPtr(config.IpamIPv6ID).(string)), + }, + } +} + +func flattenBGPSession(region scw.Region, session *s2s_vpn.BgpSession) (any, error) { + if session == nil { + return nil, nil + } + + privateIP, err := types.FlattenIPNet(session.PrivateIP) + if err != nil { + return nil, err + } + + peerPrivateIP, err := types.FlattenIPNet(session.PeerPrivateIP) + if err != nil { + return nil, err + } + return []map[string]any{ + { + "routing_policy_id": regional.NewIDString(region, session.RoutingPolicyID), + "private_ip": privateIP, + "peer_private_ip": peerPrivateIP, + }, + }, nil +} + +func FlattenPrefixFilters(prefixes []scw.IPNet) ([]string, error) { + res := make([]string, 0, len(prefixes)) + + for _, p := range prefixes { + flattened, err := types.FlattenIPNet(p) + if err != nil { + return nil, err + } + + res = append(res, flattened) + } + + return res, nil +} + +func flattenConnectionCiphers(ciphers []*s2s_vpn.ConnectionCipher) []any { + if ciphers == nil || len(ciphers) == 0 { + return nil + } + + res := make([]any, 0, len(ciphers)) + + for _, c := range ciphers { + m := map[string]any{ + "encryption": c.Encryption.String(), + } + if c.Integrity != nil { + m["integrity"] = c.Integrity.String() + } + if c.DhGroup != nil { + m["dh_group"] = c.DhGroup.String() + } + res = append(res, m) + } + + return res +} diff --git a/internal/services/s2svpn/vpn_gateway.go b/internal/services/s2svpn/vpn_gateway.go new file mode 100644 index 0000000000..01d1174c8b --- /dev/null +++ b/internal/services/s2svpn/vpn_gateway.go @@ -0,0 +1,257 @@ +package s2svpn + +import ( + "context" + + _ "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + s2svpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func ResourceVPNGateway() *schema.Resource { + return &schema.Resource{ + CreateContext: ResourceVPNGatewayCreate, + ReadContext: ResourceVPNGatewayRead, + UpdateContext: ResourceVPNGatewayUpdate, + DeleteContext: ResourceVPNGatewayDelete, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(defaulVPNGatewayTimeout), + Read: schema.DefaultTimeout(defaulVPNGatewayTimeout), + Update: schema.DefaultTimeout(defaulVPNGatewayTimeout), + Delete: schema.DefaultTimeout(defaulVPNGatewayTimeout), + Default: schema.DefaultTimeout(defaulVPNGatewayTimeout)}, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 0, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The name of the VPN gateway", + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The list of tags to apply to the VPN gateway", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "gateway_type": { + Type: schema.TypeString, + Required: true, + Description: "The VPN gateway type (commercial offer type)", + }, + "public_config": { + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "The public endpoint configuration of the VPN gateway", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ipam_ipv4_id": { + Type: schema.TypeString, + Optional: true, + }, + "ipam_ipv6_id": { + Type: schema.TypeString, + Optional: true, + }, + }, + }}, + "private_network_id": { + Type: schema.TypeString, + Required: true, + Description: "The ID of the Private Network to attach to the VPN gateway", + }, + "ipam_private_ipv4_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The ID of the IPAM private IPv4 address to attach to the VPN gateway", + }, + "ipam_private_ipv6_id": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The ID of the IPAM private IPv6 address to attach to the VPN gateway", + }, + "asn": { + Type: schema.TypeInt, + Computed: true, + Description: "The AS Number of the vpn gateway", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN gateway", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the creation of the VPN gateway", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the last update of the VPN gateway", + }, + "zone": zonal.OptionalSchema(), + "region": regional.Schema(), + "project_id": account.ProjectIDSchema(), + "organization_id": { + Type: schema.TypeString, + Computed: true, + Description: "Organization ID of the Project", + }, + }, + } +} + +func ResourceVPNGatewayCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, err := NewAPIWithRegion(d, m) + if err != nil { + return diag.FromErr(err) + } + + zone := scw.Zone(d.Get("zone").(string)) + + req := &s2svpn.CreateVpnGatewayRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + Name: types.ExpandOrGenerateString(d.Get("name").(string), "connection"), + Tags: types.ExpandStrings(d.Get("tags")), + GatewayType: d.Get("gateway_type").(string), + PrivateNetworkID: regional.ExpandID(d.Get("private_network_id").(string)).ID, + IpamPrivateIPv4ID: types.ExpandStringPtr(d.Get("ipam_private_ipv4_id").(string)), + IpamPrivateIPv6ID: types.ExpandStringPtr(d.Get("ipam_private_ipv6_id").(string)), + Zone: &zone, + PublicConfig: expandVPNGatewayPublicConfig(d.Get("public_config")), + } + + res, err := api.CreateVpnGateway(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + _, err = waitForVPNGateway(ctx, api, region, res.ID, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(regional.NewIDString(region, res.ID)) + + return ResourceVPNGatewayRead(ctx, d, m) +} + +func ResourceVPNGatewayRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + gateway, err := waitForVPNGateway(ctx, api, region, id, d.Timeout(schema.TimeoutRead)) + if err != nil { + if httperrors.Is404(err) { + d.SetId("") + + return nil + } + + return diag.FromErr(err) + } + + _ = d.Set("name", gateway.Name) + _ = d.Set("region", gateway.Region) + _ = d.Set("project_id", gateway.ProjectID) + _ = d.Set("organization_id", gateway.OrganizationID) + _ = d.Set("tags", gateway.Tags) + _ = d.Set("created_at", types.FlattenTime(gateway.CreatedAt)) + _ = d.Set("updated_at", types.FlattenTime(gateway.UpdatedAt)) + _ = d.Set("asn", int(gateway.Asn)) + _ = d.Set("status", gateway.Status.String()) + _ = d.Set("gateway_type", gateway.GatewayType) + _ = d.Set("private_network_id", regional.NewIDString(region, gateway.PrivateNetworkID)) + _ = d.Set("ipam_private_ipv4_id", regional.NewIDString(region, gateway.IpamPrivateIPv4ID)) + _ = d.Set("ipam_private_ipv6_id", regional.NewIDString(region, gateway.IpamPrivateIPv6ID)) + _ = d.Set("zone", gateway.Zone) + _ = d.Set("public_config", flattenVPNGatewayPublicConfig(region, gateway.PublicConfig)) + + return nil +} + +func ResourceVPNGatewayUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + hasChanged := false + + req := &s2svpn.UpdateVpnGatewayRequest{ + Region: region, + GatewayID: id, + } + + if d.HasChange("name") { + req.Name = types.ExpandUpdatedStringPtr(d.Get("name")) + hasChanged = true + } + + if d.HasChange("tags") { + req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) + hasChanged = true + } + + if hasChanged { + _, err = api.UpdateVpnGateway(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } + + _, err = waitForVPNGateway(ctx, api, region, id, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return diag.FromErr(err) + } + + return ResourceVPNGatewayRead(ctx, d, m) +} + +func ResourceVPNGatewayDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + _, err = waitForVPNGateway(ctx, api, region, id, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return diag.FromErr(err) + } + + _, err = api.DeleteVpnGateway(&s2svpn.DeleteVpnGatewayRequest{ + Region: region, + GatewayID: id, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + _, err = waitForVPNGateway(ctx, api, region, id, d.Timeout(schema.TimeoutDelete)) + if err != nil && !httperrors.Is404(err) { + return diag.FromErr(err) + } + + return nil +} diff --git a/internal/services/s2svpn/vpn_gateway_test.go b/internal/services/s2svpn/vpn_gateway_test.go new file mode 100644 index 0000000000..8ca9af6c04 --- /dev/null +++ b/internal/services/s2svpn/vpn_gateway_test.go @@ -0,0 +1,116 @@ +package s2svpn_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn" +) + +func TestAccVPNGateway_Basic(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + ProtoV6ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckVPNGatewayDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_vpc" "main" { + name = "tf-test-vpc-vpn-gateway" + } + + resource "scaleway_vpc_private_network" "main" { + vpc_id = scaleway_vpc.main.id + ipv4_subnet { + subnet = "10.0.0.0/24" + } + } + + resource "scaleway_s2s_vpn_gateway" "main" { + name = "tf-test-vpn-gateway" + gateway_type = "VGW-S" + private_network_id = scaleway_vpc_private_network.main.id + region = "fr-par" + zone = "fr-par-1" + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckVPNGatewayExists(tt, "scaleway_s2s_vpn_gateway.main"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_gateway.main", "name", "tf-test-vpn-gateway"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_gateway.main", "gateway_type", "VGW-S"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_gateway.main", "region", "fr-par"), + resource.TestCheckResourceAttr("scaleway_s2s_vpn_gateway.main", "zone", "fr-par-1"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "asn"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "status"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "public_config.#"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "ipam_private_ipv4_id"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "ipam_private_ipv6_id"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "created_at"), + resource.TestCheckResourceAttrSet("scaleway_s2s_vpn_gateway.main", "updated_at"), + ), + }, + }, + }) +} + +func testAccCheckVPNGatewayExists(tt *acctest.TestTools, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource not found: %s", n) + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetVpnGateway(&s2s_vpn.GetVpnGatewayRequest{ + GatewayID: id, + Region: region, + }) + + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckVPNGatewayDestroy(tt *acctest.TestTools) resource.TestCheckFunc { + return func(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "scaleway_s2s_vpn_gateway" { + continue + } + + api, region, id, err := s2svpn.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = api.GetVpnGateway(&s2s_vpn.GetVpnGatewayRequest{ + GatewayID: id, + Region: region, + }) + + if err == nil { + return fmt.Errorf("VPN gateway (%s) still exists", rs.Primary.ID) + } + + if !httperrors.Is404(err) { + return err + } + } + + return nil + } +} diff --git a/internal/services/s2svpn/waiters.go b/internal/services/s2svpn/waiters.go new file mode 100644 index 0000000000..1190445a68 --- /dev/null +++ b/internal/services/s2svpn/waiters.go @@ -0,0 +1,31 @@ +package s2svpn + +import ( + "context" + "time" + + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/transport" +) + +const ( + defaulVPNGatewayTimeout = 5 * time.Minute + defaultVPNGatewayRetryInterval = 5 * time.Second +) + +func waitForVPNGateway(ctx context.Context, api *s2s_vpn.API, region scw.Region, vpngwID string, timeout time.Duration) (*s2s_vpn.VpnGateway, error) { + retryInterval := defaultVPNGatewayRetryInterval + if transport.DefaultWaitRetryInterval != nil { + retryInterval = *transport.DefaultWaitRetryInterval + } + + server, err := api.WaitForVpnGateway(&s2s_vpn.WaitForVpnGatewayRequest{ + GatewayID: vpngwID, + Region: region, + Timeout: scw.TimeDurationPtr(timeout), + RetryInterval: &retryInterval, + }, scw.WithContext(ctx)) + + return server, err +} diff --git a/provider/sdkv2.go b/provider/sdkv2.go index 66b2cc9307..4ee2dab697 100644 --- a/provider/sdkv2.go +++ b/provider/sdkv2.go @@ -43,6 +43,7 @@ import ( "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/rdb" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/redis" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/registry" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/s2svpn" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/scwconfig" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/sdb" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/secret" @@ -238,6 +239,10 @@ func SDKProvider(config *Config) plugin.ProviderFunc { "scaleway_rdb_snapshot": rdb.ResourceSnapshot(), "scaleway_redis_cluster": redis.ResourceCluster(), "scaleway_registry_namespace": registry.ResourceNamespace(), + "scaleway_s2s_vpn_gateway": s2svpn.ResourceVPNGateway(), + "scaleway_s2s_vpn_customer_gateway": s2svpn.ResourceCustomerGateway(), + "scaleway_s2s_vpn_connection": s2svpn.ResourceConnection(), + "scaleway_s2s_vpn_routing_policy": s2svpn.ResourceRoutingPolicy(), "scaleway_sdb_sql_database": sdb.ResourceDatabase(), "scaleway_secret": secret.ResourceSecret(), "scaleway_secret_version": secret.ResourceVersion(), diff --git a/templates/resources/s2s_vpn_connection.md.tmpl b/templates/resources/s2s_vpn_connection.md.tmpl new file mode 100644 index 0000000000..eedcbda2cf --- /dev/null +++ b/templates/resources/s2s_vpn_connection.md.tmpl @@ -0,0 +1,163 @@ +{{- /*gotype: github.com/hashicorp/terraform-plugin-docs/internal/provider.ResourceTemplateType */ -}} +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_connection" +--- + +# Resource: scaleway_s2s_vpn_connection + +Creates and manages Scaleway Site-to-Site VPN Connections. +A connection links a Scaleway VPN Gateway to a Customer Gateway and establishes an IPSec tunnel with BGP routing. + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic Connection + +```terraform +resource "scaleway_vpc" "vpc" { +name = "my-vpc" +} + +resource "scaleway_vpc_private_network" "pn" { +name = "my-private-network" +vpc_id = scaleway_vpc.vpc.id +ipv4_subnet { +subnet = "10.0.1.0/24" +} +} + +resource "scaleway_s2s_vpn_gateway" "gateway" { +name = "my-vpn-gateway" +gateway_type = "VGW-S" +private_network_id = scaleway_vpc_private_network.pn.id +} + +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { +name = "my-customer-gateway" +ipv4_public = "203.0.113.1" +asn = 65000 +} + +resource "scaleway_s2s_vpn_routing_policy" "policy" { +name = "my-routing-policy" +prefix_filter_in = ["10.0.2.0/24"] +prefix_filter_out = ["10.0.1.0/24"] +} + +resource "scaleway_s2s_vpn_connection" "main" { +name = "my-vpn-connection" +vpn_gateway_id = scaleway_s2s_vpn_gateway.gateway.id +customer_gateway_id = scaleway_s2s_vpn_customer_gateway.customer_gw.id +initiation_policy = "customer_gateway" +enable_route_propagation = true + +bgp_config_ipv4 { +routing_policy_id = scaleway_s2s_vpn_routing_policy.policy.id +private_ip = "169.254.0.1/30" +peer_private_ip = "169.254.0.2/30" +} + +ikev2_ciphers { +encryption = "aes256" +integrity = "sha256" +dh_group = "modp2048" +} + +esp_ciphers { +encryption = "aes256" +integrity = "sha256" +dh_group = "modp2048" +} +} +``` + +## Argument Reference + +The following arguments are supported: + +- `vpn_gateway_id` - (Required) The ID of the VPN gateway to attach to the connection. +- `customer_gateway_id` - (Required) The ID of the customer gateway to attach to the connection. +- `initiation_policy` - (Optional) Defines who initiates the IPSec tunnel. +- `enable_route_propagation` - (Optional) Defines whether route propagation is enabled or not. +- `bgp_config_ipv4` - (Optional) BGP configuration for IPv4. See [BGP Config](#bgp-config) below. +- `bgp_config_ipv6` - (Optional) BGP configuration for IPv6. See [BGP Config](#bgp-config) below. +- `ikev2_ciphers` - (Optional) IKEv2 cipher configuration for Phase 1 (tunnel establishment). See [Cipher Config](#cipher-config) below. +- `esp_ciphers` - (Optional) ESP cipher configuration for Phase 2 (data encryption). See [Cipher Config](#cipher-config) below. +- `name` - (Optional) The name of the connection. +- `tags` - (Optional) The list of tags to apply to the connection. +- `is_ipv6` - (Optional) Defines IP version of the IPSec Tunnel. Defaults to `false` (IPv4). +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the connection should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the connection is associated with. + +### BGP Config + +The `bgp_config_ipv4` and `bgp_config_ipv6` blocks support: + +- `routing_policy_id` - (Required) The ID of the routing policy to use for BGP route filtering. +- `private_ip` - (Optional) The BGP peer IP on Scaleway side (within the IPSec tunnel), in CIDR notation (e.g., `169.254.0.1/30`). If not provided, Scaleway will assign it automatically. +- `peer_private_ip` - (Optional) The BGP peer IP on customer side (within the IPSec tunnel), in CIDR notation (e.g., `169.254.0.2/30`). If not provided, Scaleway will assign it automatically. + +### Cipher Config + +The `ikev2_ciphers` and `esp_ciphers` blocks support: + +- `encryption` - (Required) The encryption algorithm. +- `integrity` - (Optional) The integrity/hash algorithm. +- `dh_group` - (Optional) The Diffie-Hellman group. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the connection. +- `status` - The status of the connection. +- `tunnel_status` - The status of the IPSec tunnel. +- `bgp_status_ipv4` - The status of the BGP IPv4 session. +- `bgp_status_ipv6` - The status of the BGP IPv6 session. +- `bgp_session_ipv4` - The BGP IPv4 session information. See [BGP Session](#bgp-session) below. +- `bgp_session_ipv6` - The BGP IPv6 session information. See [BGP Session](#bgp-session) below. +- `secret_id` - The ID of the secret containing the pre-shared key (PSK) for the connection. +- `secret_version` - The version of the secret containing the PSK. +- `route_propagation_enabled` - Whether route propagation is enabled. +- `created_at` - The date and time of the creation of the connection (RFC 3339 format). +- `updated_at` - The date and time of the last update of the connection (RFC 3339 format). +- `organization_id` - The Organization ID the connection is associated with. + +### BGP Session + +The `bgp_session_ipv4` and `bgp_session_ipv6` blocks contain (read-only): + +- `routing_policy_id` - The routing policy ID used for this BGP session. +- `private_ip` - The BGP peer IP on Scaleway side (within the tunnel). +- `peer_private_ip` - The BGP peer IP on customer side (within the tunnel). + +~> **Important:** Connections' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +~> **Important:** The pre-shared key (PSK) is auto-generated when the connection is created and stored in Scaleway Secret Manager. You can retrieve it using the `scaleway_secret_version` datasource or via the API. + +## Retrieving the Pre-Shared Key (PSK) + +The PSK is stored in Secret Manager and can be retrieved using: + +```terraform +data "scaleway_secret_version" "s2s_psk" { +secret_id = scaleway_s2s_vpn_connection.main.secret_id +revision = tostring(scaleway_s2s_vpn_connection.main.secret_version) +} + +# The PSK is available as base64-encoded data +output "psk" { +value = data.scaleway_secret_version.s2s_psk.data +sensitive = true +} +``` + +## Import + +Connections can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_connection.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/templates/resources/s2s_vpn_customer_gateway.md.tmpl b/templates/resources/s2s_vpn_customer_gateway.md.tmpl new file mode 100644 index 0000000000..a523506ce2 --- /dev/null +++ b/templates/resources/s2s_vpn_customer_gateway.md.tmpl @@ -0,0 +1,85 @@ +{{- /*gotype: github.com/hashicorp/terraform-plugin-docs/internal/provider.ResourceTemplateType */ -}} +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_customer_gateway" +--- + +# Resource: scaleway_s2s_vpn_customer_gateway + +Creates and manages Scaleway Site-to-Site VPN Customer Gateways. +A customer gateway represents your external VPN endpoint (e.g., a firewall, router, or VPN appliance). + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { +name = "my-customer-gateway" +ipv4_public = "203.0.113.1" +asn = 65000 +} +``` + +### With IPv6 + +```terraform +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { +name = "my-customer-gateway" +ipv4_public = "203.0.113.1" +ipv6_public = "2001:db8::1" +asn = 65000 +} +``` + +### Using Instance Public IP + +```terraform +resource "scaleway_instance_ip" "vpn_endpoint_ip" {} + +resource "scaleway_instance_server" "vpn_endpoint" { +name = "vpn-endpoint" +type = "DEV1-S" +image = "ubuntu_jammy" +ip_ids = [scaleway_instance_ip.vpn_endpoint_ip.id] +} + +resource "scaleway_s2s_vpn_customer_gateway" "customer_gw" { +name = "my-customer-gateway" +ipv4_public = scaleway_instance_ip.vpn_endpoint_ip.address +asn = 65000 +} +``` + +## Argument Reference + +The following arguments are supported: + +- `asn` - (Required) The AS Number of the customer gateway. Must be different from Scaleway's ASN (12876). For testing, you can use a private ASN (64512-65535). +- `ipv4_public` - (Optional) The public IPv4 address of the customer gateway (your VPN endpoint). +- `ipv6_public` - (Optional) The public IPv6 address of the customer gateway (your VPN endpoint). +- `name` - (Optional) The name of the customer gateway. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the customer gateway. +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the customer gateway should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the customer gateway is associated with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the customer gateway. +- `created_at` - The date and time of the creation of the customer gateway (RFC 3339 format). +- `updated_at` - The date and time of the last update of the customer gateway (RFC 3339 format). +- `organization_id` - The Organization ID the customer gateway is associated with. + +~> **Important:** Customer Gateways' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +Customer Gateways can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_customer_gateway.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/templates/resources/s2s_vpn_routing_policy.md.tmpl b/templates/resources/s2s_vpn_routing_policy.md.tmpl new file mode 100644 index 0000000000..120d777882 --- /dev/null +++ b/templates/resources/s2s_vpn_routing_policy.md.tmpl @@ -0,0 +1,65 @@ +{{- /*gotype: github.com/hashicorp/terraform-plugin-docs/internal/provider.ResourceTemplateType */ -}} +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_routing_policy" +--- + +# Resource: scaleway_s2s_vpn_routing_policy + +Creates and manages Scaleway Site-to-Site VPN Routing Policies. +A routing policy defines which routes are accepted from and advertised to the peer gateway via BGP. + +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_s2s_vpn_routing_policy" "policy" { +name = "my-routing-policy" +prefix_filter_in = ["10.0.2.0/24"] +prefix_filter_out = ["10.0.1.0/24"] +} +``` + +### Multiple Prefixes + +```terraform +resource "scaleway_s2s_vpn_routing_policy" "policy" { +name = "my-routing-policy" +prefix_filter_in = ["10.0.2.0/24", "10.0.3.0/24"] +prefix_filter_out = ["10.0.1.0/24", "172.16.0.0/16"] +} +``` + +## Argument Reference + +The following arguments are supported: + +- `prefix_filter_in` - (Optional) List of IP prefixes (in CIDR notation) to accept from the peer gateway. These are the routes that the customer gateway can announce to Scaleway. +- `prefix_filter_out` - (Optional) List of IP prefixes (in CIDR notation) to advertise to the peer gateway. These are the routes that Scaleway will announce to the customer gateway. +- `name` - (Optional) The name of the routing policy. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the routing policy. +- `is_ipv6` - (Optional) Defines whether the routing policy is for IPv6 prefixes. Defaults to `false` (IPv4). +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the routing policy should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the routing policy is associated with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the routing policy. +- `created_at` - The date and time of the creation of the routing policy (RFC 3339 format). +- `updated_at` - The date and time of the last update of the routing policy (RFC 3339 format). +- `organization_id` - The Organization ID the routing policy is associated with. + +~> **Important:** Routing Policies' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +Routing Policies can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_routing_policy.main fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/templates/resources/s2s_vpn_vpn_gateway.md.tmpl b/templates/resources/s2s_vpn_vpn_gateway.md.tmpl new file mode 100644 index 0000000000..70514e15f0 --- /dev/null +++ b/templates/resources/s2s_vpn_vpn_gateway.md.tmpl @@ -0,0 +1,78 @@ +{{- /*gotype: github.com/hashicorp/terraform-plugin-docs/internal/provider.ResourceTemplateType */ -}} +--- +subcategory: "S2S VPN" +page_title: "Scaleway: scaleway_s2s_vpn_gateway" +--- + +# Resource: scaleway_s2s_vpn_gateway + +Creates and manages Scaleway Site-to-Site VPN Gateways. +For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/). + +## Example Usage + +### Basic + +```terraform +resource "scaleway_vpc" "vpc" { +name = "my-vpc" +} + +resource "scaleway_vpc_private_network" "pn" { +name = "my-private-network" +vpc_id = scaleway_vpc.vpc.id +ipv4_subnet { +subnet = "10.0.1.0/24" +} +} + +resource "scaleway_s2s_vpn_gateway" "gateway" { +name = "my-vpn-gateway" +gateway_type = "VGW-S" +private_network_id = scaleway_vpc_private_network.pn.id +} +``` + +## Argument Reference + +The following arguments are supported: + +- `gateway_type` - (Required) The VPN gateway type (commercial offer type). +- `private_network_id` - (Required) The ID of the Private Network to attach to the VPN gateway. +- `name` - (Optional) The name of the VPN gateway. If not provided, it will be randomly generated. +- `tags` - (Optional) The list of tags to apply to the VPN gateway. +- `public_config` - (Optional) The public endpoint configuration of the VPN gateway. See [Public Config](#public-config) below. +- `ipam_private_ipv4_id` - (Optional) The ID of the IPAM private IPv4 address to attach to the VPN gateway. +- `ipam_private_ipv6_id` - (Optional) The ID of the IPAM private IPv6 address to attach to the VPN gateway. +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the VPN gateway should be created. +- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the VPN gateway should be created. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the VPN gateway is associated with. + +### Public Config + +The `public_config` block supports: + +- `ipam_ipv4_id` - (Optional) The ID of the IPAM IPv4 address to use as the public IP for the VPN gateway. +- `ipam_ipv6_id` - (Optional) The ID of the IPAM IPv6 address to use as the public IP for the VPN gateway. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The ID of the VPN gateway. +- `asn` - The AS Number of the VPN gateway (typically 12876 for Scaleway). +- `status` - The status of the VPN gateway. +- `public_config` - The public endpoint configuration, including the assigned public IPs. +- `created_at` - The date and time of the creation of the VPN gateway (RFC 3339 format). +- `updated_at` - The date and time of the last update of the VPN gateway (RFC 3339 format). +- `organization_id` - The Organization ID the VPN gateway is associated with. + +~> **Important:** VPN Gateways' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` + +## Import + +VPN Gateways can be imported using `{region}/{id}`, e.g. + +```bash +terraform import scaleway_s2s_vpn_gateway.main fr-par/11111111-1111-1111-1111-111111111111 +``` From c7c73a1e1b0b87ed347282d75f7298eb69eda546 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 11:03:12 +0100 Subject: [PATCH 2/7] add s2svpn to nightly matrix --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ada2b6129d..a534599018 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -44,6 +44,7 @@ jobs: - rdb - redis - registry + - s2svpn - sdb - secret - tem From 3e770e015fefdbd6c856e0e1a1519d6271c52e32 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 11:34:33 +0100 Subject: [PATCH 3/7] fix --- docs/resources/{s2s_vpn_vpn_gateway.md => s2s_vpn_gateway.md} | 0 internal/services/s2svpn/customer_gateway.go | 2 +- .../{s2s_vpn_vpn_gateway.md.tmpl => s2s_vpn_gateway.md.tmpl} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename docs/resources/{s2s_vpn_vpn_gateway.md => s2s_vpn_gateway.md} (100%) rename templates/resources/{s2s_vpn_vpn_gateway.md.tmpl => s2s_vpn_gateway.md.tmpl} (100%) diff --git a/docs/resources/s2s_vpn_vpn_gateway.md b/docs/resources/s2s_vpn_gateway.md similarity index 100% rename from docs/resources/s2s_vpn_vpn_gateway.md rename to docs/resources/s2s_vpn_gateway.md diff --git a/internal/services/s2svpn/customer_gateway.go b/internal/services/s2svpn/customer_gateway.go index fc12da9f0a..3ecbac954b 100644 --- a/internal/services/s2svpn/customer_gateway.go +++ b/internal/services/s2svpn/customer_gateway.go @@ -137,7 +137,7 @@ func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m _ = d.Set("updated_at", types.FlattenTime(gateway.UpdatedAt)) _ = d.Set("ipv4_public", types.FlattenIPPtr(gateway.PublicIPv4)) _ = d.Set("ipv6_public", types.FlattenIPPtr(gateway.PublicIPv6)) - _ = d.Set("asn", gateway.Asn) + _ = d.Set("asn", int(gateway.Asn)) return nil } diff --git a/templates/resources/s2s_vpn_vpn_gateway.md.tmpl b/templates/resources/s2s_vpn_gateway.md.tmpl similarity index 100% rename from templates/resources/s2s_vpn_vpn_gateway.md.tmpl rename to templates/resources/s2s_vpn_gateway.md.tmpl From 5bf8d3834d34fbe189822a8755330507f569bd13 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 11:52:34 +0100 Subject: [PATCH 4/7] lint --- internal/services/s2svpn/connection.go | 12 ++++++++---- internal/services/s2svpn/connection_test.go | 5 ++--- internal/services/s2svpn/customer_gateway.go | 13 +++++++------ internal/services/s2svpn/customer_gateway_test.go | 2 -- internal/services/s2svpn/helpers_s2svpn.go | 4 ++-- internal/services/s2svpn/routing_policy.go | 13 +++++++------ internal/services/s2svpn/routing_policy_test.go | 2 -- internal/services/s2svpn/types.go | 5 ++++- internal/services/s2svpn/vpn_gateway.go | 15 ++++++++------- internal/services/s2svpn/vpn_gateway_test.go | 2 -- 10 files changed, 38 insertions(+), 35 deletions(-) diff --git a/internal/services/s2svpn/connection.go b/internal/services/s2svpn/connection.go index e98c68c695..a9a1f69577 100644 --- a/internal/services/s2svpn/connection.go +++ b/internal/services/s2svpn/connection.go @@ -225,7 +225,7 @@ func ResourceConnectionBgpSession() *schema.Resource { } } -func ResourceConnectionCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceConnectionCreate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, err := NewAPIWithRegion(d, m) if err != nil { return diag.FromErr(err) @@ -273,7 +273,7 @@ func ResourceConnectionCreate(ctx context.Context, d *schema.ResourceData, m int return ResourceConnectionRead(ctx, d, m) } -func ResourceConnectionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceConnectionRead(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -286,8 +286,10 @@ func ResourceConnectionRead(ctx context.Context, d *schema.ResourceData, m inter if err != nil { if httperrors.Is404(err) { d.SetId("") + return nil } + return diag.FromErr(err) } @@ -316,18 +318,20 @@ func ResourceConnectionRead(ctx context.Context, d *schema.ResourceData, m inter if err != nil { return diag.FromErr(err) } + _ = d.Set("bgp_session_ipv4", bgpSessionIPv4) bgpSessionIPv6, err := flattenBGPSession(region, connection.BgpSessionIPv6) if err != nil { return diag.FromErr(err) } + _ = d.Set("bgp_session_ipv6", bgpSessionIPv6) return nil } -func ResourceConnectionUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceConnectionUpdate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -375,7 +379,7 @@ func ResourceConnectionUpdate(ctx context.Context, d *schema.ResourceData, m int return ResourceConnectionRead(ctx, d, m) } -func ResourceConnectionDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceConnectionDelete(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) diff --git a/internal/services/s2svpn/connection_test.go b/internal/services/s2svpn/connection_test.go index 751f016bd9..e2773e7db7 100644 --- a/internal/services/s2svpn/connection_test.go +++ b/internal/services/s2svpn/connection_test.go @@ -1,6 +1,7 @@ package s2svpn_test import ( + "errors" "fmt" "testing" @@ -128,13 +129,12 @@ func testAccCheckConnectionExists(tt *acctest.TestTools, n string) resource.Test ConnectionID: id, Region: region, }) - if err != nil { return err } if connection.Status.String() == "error" { - return fmt.Errorf("connection is in error state") + return errors.New("connection is in error state") } return nil @@ -157,7 +157,6 @@ func testAccCheckConnectionDestroy(tt *acctest.TestTools) resource.TestCheckFunc ConnectionID: id, Region: region, }) - if err == nil { return fmt.Errorf("s2svpn connection (%s) still exists", rs.Primary.ID) } diff --git a/internal/services/s2svpn/customer_gateway.go b/internal/services/s2svpn/customer_gateway.go index 3ecbac954b..8652b73392 100644 --- a/internal/services/s2svpn/customer_gateway.go +++ b/internal/services/s2svpn/customer_gateway.go @@ -3,12 +3,11 @@ package s2svpn import ( "context" "net" - _ "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" "github.com/scaleway/scaleway-sdk-go/scw" "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" @@ -79,7 +78,7 @@ func ResourceCustomerGateway() *schema.Resource { } } -func ResourceCustomerGatewayCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceCustomerGatewayCreate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, err := NewAPIWithRegion(d, m) if err != nil { return diag.FromErr(err) @@ -111,7 +110,7 @@ func ResourceCustomerGatewayCreate(ctx context.Context, d *schema.ResourceData, return ResourceCustomerGatewayRead(ctx, d, m) } -func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -124,8 +123,10 @@ func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m if err != nil { if httperrors.Is404(err) { d.SetId("") + return nil } + return diag.FromErr(err) } @@ -142,7 +143,7 @@ func ResourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, m return nil } -func ResourceCustomerGatewayUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceCustomerGatewayUpdate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -190,7 +191,7 @@ func ResourceCustomerGatewayUpdate(ctx context.Context, d *schema.ResourceData, return ResourceCustomerGatewayRead(ctx, d, m) } -func ResourceCustomerGatewayDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceCustomerGatewayDelete(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) diff --git a/internal/services/s2svpn/customer_gateway_test.go b/internal/services/s2svpn/customer_gateway_test.go index 80f55948ae..d0967ecf62 100644 --- a/internal/services/s2svpn/customer_gateway_test.go +++ b/internal/services/s2svpn/customer_gateway_test.go @@ -60,7 +60,6 @@ func testAccCheckCustomerGatewayExists(tt *acctest.TestTools, n string) resource GatewayID: id, Region: region, }) - if err != nil { return err } @@ -85,7 +84,6 @@ func testAccCheckCustomerGatewayDestroy(tt *acctest.TestTools) resource.TestChec GatewayID: id, Region: region, }) - if err == nil { return fmt.Errorf("customer gateway (%s) still exists", rs.Primary.ID) } diff --git a/internal/services/s2svpn/helpers_s2svpn.go b/internal/services/s2svpn/helpers_s2svpn.go index d2d487d3db..889a9ff517 100644 --- a/internal/services/s2svpn/helpers_s2svpn.go +++ b/internal/services/s2svpn/helpers_s2svpn.go @@ -9,7 +9,7 @@ import ( ) // NewAPIWithRegion returns a new s2svpn API and the region for a Create request -func NewAPIWithRegion(d *schema.ResourceData, m interface{}) (*s2svpn.API, scw.Region, error) { +func NewAPIWithRegion(d *schema.ResourceData, m any) (*s2svpn.API, scw.Region, error) { s2svpnAPI := s2svpn.NewAPI(meta.ExtractScwClient(m)) region, err := meta.ExtractRegion(d, m) @@ -21,7 +21,7 @@ func NewAPIWithRegion(d *schema.ResourceData, m interface{}) (*s2svpn.API, scw.R } // NewAPIWithRegionAndID returns a new s2svpn API with region and ID extracted from the state -func NewAPIWithRegionAndID(m interface{}, regionalID string) (*s2svpn.API, scw.Region, string, error) { +func NewAPIWithRegionAndID(m any, regionalID string) (*s2svpn.API, scw.Region, string, error) { s2svpnAPI := s2svpn.NewAPI(meta.ExtractScwClient(m)) region, ID, err := regional.ParseID(regionalID) diff --git a/internal/services/s2svpn/routing_policy.go b/internal/services/s2svpn/routing_policy.go index 19e5cf785e..12ec833d3b 100644 --- a/internal/services/s2svpn/routing_policy.go +++ b/internal/services/s2svpn/routing_policy.go @@ -2,13 +2,12 @@ package s2svpn import ( "context" - _ "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" + s2s_vpn "github.com/scaleway/scaleway-sdk-go/api/s2s_vpn/v1alpha1" "github.com/scaleway/scaleway-sdk-go/scw" "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" @@ -86,7 +85,7 @@ func ResourceRoutingPolicy() *schema.Resource { } } -func ResourceRoutingPolicyCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceRoutingPolicyCreate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, err := NewAPIWithRegion(d, m) if err != nil { return diag.FromErr(err) @@ -122,7 +121,7 @@ func ResourceRoutingPolicyCreate(ctx context.Context, d *schema.ResourceData, m return ResourceRoutingPolicyRead(ctx, d, m) } -func ResourceRoutingPolicyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceRoutingPolicyRead(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -135,8 +134,10 @@ func ResourceRoutingPolicyRead(ctx context.Context, d *schema.ResourceData, m in if err != nil { if httperrors.Is404(err) { d.SetId("") + return nil } + return diag.FromErr(err) } @@ -164,7 +165,7 @@ func ResourceRoutingPolicyRead(ctx context.Context, d *schema.ResourceData, m in return nil } -func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -199,7 +200,7 @@ func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m return ResourceRoutingPolicyRead(ctx, d, m) } -func ResourceRoutingPolicyDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceRoutingPolicyDelete(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) diff --git a/internal/services/s2svpn/routing_policy_test.go b/internal/services/s2svpn/routing_policy_test.go index 564dc9b0a5..351813ed61 100644 --- a/internal/services/s2svpn/routing_policy_test.go +++ b/internal/services/s2svpn/routing_policy_test.go @@ -60,7 +60,6 @@ func testAccCheckRoutingPolicyExists(tt *acctest.TestTools, n string) resource.T RoutingPolicyID: id, Region: region, }) - if err != nil { return err } @@ -85,7 +84,6 @@ func testAccCheckRoutingPolicyDestroy(tt *acctest.TestTools) resource.TestCheckF RoutingPolicyID: id, Region: region, }) - if err == nil { return fmt.Errorf("routing policy (%s) still exists", rs.Primary.ID) } diff --git a/internal/services/s2svpn/types.go b/internal/services/s2svpn/types.go index 129be1e7e8..8ac1a7ff1c 100644 --- a/internal/services/s2svpn/types.go +++ b/internal/services/s2svpn/types.go @@ -129,6 +129,7 @@ func flattenBGPSession(region scw.Region, session *s2s_vpn.BgpSession) (any, err if err != nil { return nil, err } + return []map[string]any{ { "routing_policy_id": regional.NewIDString(region, session.RoutingPolicyID), @@ -154,7 +155,7 @@ func FlattenPrefixFilters(prefixes []scw.IPNet) ([]string, error) { } func flattenConnectionCiphers(ciphers []*s2s_vpn.ConnectionCipher) []any { - if ciphers == nil || len(ciphers) == 0 { + if len(ciphers) == 0 { return nil } @@ -167,9 +168,11 @@ func flattenConnectionCiphers(ciphers []*s2s_vpn.ConnectionCipher) []any { if c.Integrity != nil { m["integrity"] = c.Integrity.String() } + if c.DhGroup != nil { m["dh_group"] = c.DhGroup.String() } + res = append(res, m) } diff --git a/internal/services/s2svpn/vpn_gateway.go b/internal/services/s2svpn/vpn_gateway.go index 01d1174c8b..4aae610768 100644 --- a/internal/services/s2svpn/vpn_gateway.go +++ b/internal/services/s2svpn/vpn_gateway.go @@ -2,7 +2,6 @@ package s2svpn import ( "context" - _ "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -27,7 +26,8 @@ func ResourceVPNGateway() *schema.Resource { Read: schema.DefaultTimeout(defaulVPNGatewayTimeout), Update: schema.DefaultTimeout(defaulVPNGatewayTimeout), Delete: schema.DefaultTimeout(defaulVPNGatewayTimeout), - Default: schema.DefaultTimeout(defaulVPNGatewayTimeout)}, + Default: schema.DefaultTimeout(defaulVPNGatewayTimeout), + }, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -69,7 +69,8 @@ func ResourceVPNGateway() *schema.Resource { Optional: true, }, }, - }}, + }, + }, "private_network_id": { Type: schema.TypeString, Required: true, @@ -119,7 +120,7 @@ func ResourceVPNGateway() *schema.Resource { } } -func ResourceVPNGatewayCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceVPNGatewayCreate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, err := NewAPIWithRegion(d, m) if err != nil { return diag.FromErr(err) @@ -155,7 +156,7 @@ func ResourceVPNGatewayCreate(ctx context.Context, d *schema.ResourceData, m int return ResourceVPNGatewayRead(ctx, d, m) } -func ResourceVPNGatewayRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceVPNGatewayRead(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -191,7 +192,7 @@ func ResourceVPNGatewayRead(ctx context.Context, d *schema.ResourceData, m inter return nil } -func ResourceVPNGatewayUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceVPNGatewayUpdate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) @@ -229,7 +230,7 @@ func ResourceVPNGatewayUpdate(ctx context.Context, d *schema.ResourceData, m int return ResourceVPNGatewayRead(ctx, d, m) } -func ResourceVPNGatewayDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { +func ResourceVPNGatewayDelete(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { api, region, id, err := NewAPIWithRegionAndID(m, d.Id()) if err != nil { return diag.FromErr(err) diff --git a/internal/services/s2svpn/vpn_gateway_test.go b/internal/services/s2svpn/vpn_gateway_test.go index 8ca9af6c04..f1934b6d1d 100644 --- a/internal/services/s2svpn/vpn_gateway_test.go +++ b/internal/services/s2svpn/vpn_gateway_test.go @@ -76,7 +76,6 @@ func testAccCheckVPNGatewayExists(tt *acctest.TestTools, n string) resource.Test GatewayID: id, Region: region, }) - if err != nil { return err } @@ -101,7 +100,6 @@ func testAccCheckVPNGatewayDestroy(tt *acctest.TestTools) resource.TestCheckFunc GatewayID: id, Region: region, }) - if err == nil { return fmt.Errorf("VPN gateway (%s) still exists", rs.Primary.ID) } From c8cad03a337c8ca583a2343fbca2295bc498c577 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 13:51:41 +0100 Subject: [PATCH 5/7] fix --- internal/services/container/token.go | 2 +- internal/services/function/token.go | 2 +- internal/services/s2svpn/connection.go | 35 +++++++++++++++---------- internal/services/s2svpn/vpn_gateway.go | 10 ++++--- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/internal/services/container/token.go b/internal/services/container/token.go index f21bf84668..b861cd7312 100644 --- a/internal/services/container/token.go +++ b/internal/services/container/token.go @@ -75,7 +75,7 @@ func ResourceContainerTokenCreate(ctx context.Context, d *schema.ResourceData, m return diag.FromErr(err) } - token, err := api.CreateToken(&container.CreateTokenRequest{ + token, err := api.CreateToken(&container.CreateTokenRequest{ //nolint:staticcheck Region: region, ContainerID: types.ExpandStringPtr(locality.ExpandID(d.Get("container_id"))), NamespaceID: types.ExpandStringPtr(locality.ExpandID(d.Get("namespace_id"))), diff --git a/internal/services/function/token.go b/internal/services/function/token.go index 6613f5cb65..ea7ab05414 100644 --- a/internal/services/function/token.go +++ b/internal/services/function/token.go @@ -77,7 +77,7 @@ func ResourceFunctionTokenCreate(ctx context.Context, d *schema.ResourceData, m return diag.FromErr(err) } - token, err := api.CreateToken(&function.CreateTokenRequest{ + token, err := api.CreateToken(&function.CreateTokenRequest{ //nolint:staticcheck Region: region, FunctionID: types.ExpandStringPtr(locality.ExpandID(d.Get("function_id"))), NamespaceID: types.ExpandStringPtr(locality.ExpandID(d.Get("namespace_id"))), diff --git a/internal/services/s2svpn/connection.go b/internal/services/s2svpn/connection.go index a9a1f69577..fbe6cff9ed 100644 --- a/internal/services/s2svpn/connection.go +++ b/internal/services/s2svpn/connection.go @@ -121,8 +121,9 @@ func ResourceConnection() *schema.Resource { Elem: ResourceConnectionBgpSession(), }, "route_propagation_enabled": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Description: "Defines whether route propagation is enabled or not", + Computed: true, }, "created_at": { Type: schema.TypeString, @@ -169,16 +170,19 @@ func ResourceConnectionCipher() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ "encryption": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Description: "The encryption algorithm", + Required: true, }, "integrity": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "The integrity/hash algorithm", + Optional: true, }, "dh_group": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "The Diffie-Hellman group", + Optional: true, }, }, } @@ -188,16 +192,19 @@ func ResourceConnectionRequestBgpConfig() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ "routing_policy_id": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Description: "The ID of the routing policy to use for BGP route filtering", + Required: true, }, "private_ip": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "The BGP peer IP on Scaleway side", + Optional: true, }, "peer_private_ip": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "The BGP peer IP on customer side", + Optional: true, }, }, } diff --git a/internal/services/s2svpn/vpn_gateway.go b/internal/services/s2svpn/vpn_gateway.go index 4aae610768..483313dd49 100644 --- a/internal/services/s2svpn/vpn_gateway.go +++ b/internal/services/s2svpn/vpn_gateway.go @@ -61,12 +61,14 @@ func ResourceVPNGateway() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ipam_ipv4_id": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: " The ID of the IPAM IPv4 address to use as the public IP for the VPN gateway", + Optional: true, }, "ipam_ipv6_id": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: " The ID of the IPAM IPv6 address to use as the public IP for the VPN gateway", + Optional: true, }, }, }, From e25ad88a036f20291f51fc3e5eecbe7bfd9ce1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 5 Dec 2025 15:08:21 +0100 Subject: [PATCH 6/7] Apply suggestion from @remyleone --- internal/locality/zonal/schemas.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/locality/zonal/schemas.go b/internal/locality/zonal/schemas.go index d7cf541b4d..863c4d9294 100644 --- a/internal/locality/zonal/schemas.go +++ b/internal/locality/zonal/schemas.go @@ -42,7 +42,7 @@ func OptionalSchema() *schema.Schema { Type: schema.TypeString, Optional: true, Computed: true, - Description: "IThe zone you want to attach the resource to", + Description: "The zone you want to attach the resource to", ValidateDiagFunc: verify.ValidateStringInSliceWithWarning(AllZones(), "zone"), DiffSuppressFunc: locality.SuppressSDKNullAssignment, } From 6ddf5d07c7a3bc0ad1513680122058d5493b3172 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Fri, 5 Dec 2025 15:43:21 +0100 Subject: [PATCH 7/7] remove comment --- internal/services/s2svpn/routing_policy.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/services/s2svpn/routing_policy.go b/internal/services/s2svpn/routing_policy.go index 12ec833d3b..536fd3a8d0 100644 --- a/internal/services/s2svpn/routing_policy.go +++ b/internal/services/s2svpn/routing_policy.go @@ -188,8 +188,6 @@ func ResourceRoutingPolicyUpdate(ctx context.Context, d *schema.ResourceData, m hasChanged = true } - // ask why *[]string for prefix filters - if hasChanged { _, err = api.UpdateRoutingPolicy(req, scw.WithContext(ctx)) if err != nil {