@@ -4,13 +4,13 @@ page_title: "Migrating from Legacy VPC Gateway to v2"
44
55# Migrating from Legacy VPC Gateway to v2
66
7- This guide explains how to migrate from the legacy VPC gateway configuration (v1) to the new v2 API.
8- In the legacy setup, DHCP and DHCP reservations are managed with dedicated resources and referenced in the gateway network.
7+ This guide explains how to migrate from the legacy VPC gateway configuration (v1) to the new v2 API.
8+ In the legacy setup, DHCP and DHCP reservations are managed with dedicated resources and referenced in the gateway network.
99In v2, the public gateway is migrated to use IPAM (IP Address Management) mode.
1010In 2023, DHCP functionality was moved from Public Gateways to Private Networks, DHCP resources are now no longer needed.
1111
1212Note:
13- During migration, you need to trigger the migration call by setting the ` migrate_to_v2 ` flag on your public gateway resource.
13+ During migration, you need to trigger the migration call by setting the ` migrate_to_v2 ` flag on your public gateway resource.
1414You can do this via the Terraform configuration or by using the Scaleway CLI/Console.
1515
1616## Prerequisites
@@ -111,7 +111,7 @@ After triggering the migration, update your Terraform configuration as follows:
1111112 . ** Update the Gateway Network**
112112
113113 Replace the DHCP related attributes with an ` ipam_config ` block. For example
114-
114+
115115 ``` hcl
116116 resource "scaleway_vpc_gateway_network" "main" {
117117 gateway_id = scaleway_vpc_public_gateway.main.id
@@ -125,7 +125,7 @@ After triggering the migration, update your Terraform configuration as follows:
125125
126126### Using the IPAM Datasource and Resource for Reservations
127127
128- After migrating your public gateway to v2, you no longer manage DHCP reservations with dedicated resources.
128+ After migrating your public gateway to v2, you no longer manage DHCP reservations with dedicated resources.
129129Instead, you remove the legacy DHCP reservation resource and switch to using IPAM to manage your IPs.
130130
1311311. **Retrieve an Existing IP with the IPAM Datasource**
@@ -137,6 +137,7 @@ Instead, you remove the legacy DHCP reservation resource and switch to using IPA
137137 type = "ipv4"
138138 }
139139 ```
140+
140141 You can now use data.scaleway_ipam_ip.existing.id in your configuration to reference the reserved IP.
141142
1421432 . ** Book New IPs Using the IPAM IP Resource**
@@ -153,8 +154,9 @@ Instead, you remove the legacy DHCP reservation resource and switch to using IPA
153154
1541553 . ** Attach the Reserved IP to Your Resources**
155156
156- Once you have your IP—whether retrieved via the datasource or booked as a new resource—you can attach it to your server’s private NIC:
157- ``` hcl
157+ Once you have your IP—whether retrieved via the datasource or booked as a new resource—you can attach it to your server’s private NIC:
158+
159+ ``` hcl
158160 resource "scaleway_instance_private_nic" "pnic01" {
159161 private_network_id = scaleway_vpc_private_network.main.id
160162 server_id = scaleway_instance_server.main.id
0 commit comments