Skip to content

Commit 8f32a0d

Browse files
committed
fix(pgw): add tf refs to guide
1 parent 873a07a commit 8f32a0d

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

pages/public-gateways/reference-content/understanding-v2.mdx

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ categories:
1515

1616
TODO CHECK CONSOLE MENTIONS
1717
TODO CHECK DATES
18-
TODO ADD TERRAFORM SNIPPETS
1918

2019
Scaleway's VPC offering is evolving, and with this comes changes for the Public Gateway product.
2120

@@ -42,10 +41,17 @@ After a deprecation period ending on 1 Oct 2025, the Public Gateways API v1 and
4241

4342
- Ensure that your Public Gateway is in [IPAM mode](#ipam-mode-becomes-default). Only IPAM-mode gateways are compatible with v2.
4443

45-
- Put any non-IPAM mode ([legacy](/network/public-gateways/concepts/#ipam)) Public Gateways in IPAM mode, by using the **Move to IPAM mode** button in the console, or the [dedicated API call](TODO).
44+
- Put any non-IPAM mode ([legacy](/network/public-gateways/concepts/#ipam)) Public Gateways in IPAM mode. You can do this in several ways:
45+
- Use the **Move to IPAM mode** button in the console
46+
- Use the [dedicated API call](https://www.scaleway.com/en/developers/api/public-gateway/#path-gateways-put-a-public-gateway-in-ipam-mode).
47+
- Use the `move_to_ipam` flag in [Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md)
4648

4749
- Update any code or scripts you have that call version 1 of the Public Gateways API, so that they call version 2 instead, and do not refer to [removed functionalities](#introducing-public-gateways-api-v2).
4850

51+
<Message type="tip">
52+
If you manage your Public Gateway via Terraform, see our [dedicated guide](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md)
53+
</Message>
54+
4955
If your Public Gateway is already in IPAM mode, and you only manage it via the console, you will not be affected by these changes and you do not need to take any action.
5056

5157
## Background: DHCP and IPAM
@@ -54,7 +60,7 @@ When Scaleway originally introduced Public Gateways, they provided DHCP function
5460

5561
Scaleway also introduced [IPAM](/network/ipam/concepts/#ipam) to act as a single source of truth for the IP addressing of all Scaleway resources. DHCP uses IPAM to ensure consistent and reliable addressing across all Private Networks.
5662

57-
When you [create a Private Network](/network/vpc/how-to/create-private-network/), you can either automatically generate a default IPv4 CIDR block, or define a custom block. A default IPv6 block is automatically created. When you attach resources to the Private Network, they automatically receive an IPv4 address (and, if compatible, an IPv6 address) from this block. Alternatively, you can [reserve a specific IP address](/network/ipam/how-to/reserve-ip/) from the block, and [specify this address](/network/ipam/how-to/reserve-ip/#how-to-attach-a-resource-to-a-private-network-using-a-reserved-ip-address) when attaching the resource. When you reserve a private IP with IPAM, you have the option to attach a MAC address to it. This allows you to use the IP with a custom resource e.g. virtual machines hosted on a Proxmox cluster on an Elastic Metal server.
63+
When you [create a Private Network](/network/vpc/how-to/create-private-network/), you can either automatically generate a default IPv4 CIDR block, or define a custom block. A default IPv6 block is automatically created. When you attach resources to the Private Network, they automatically receive an IPv4 address (and, if compatible, an IPv6 address) from this block. Alternatively, you can [reserve a specific IP address](/network/ipam/how-to/reserve-ip/) from the block, and [specify this address](/network/ipam/how-to/reserve-ip/#how-to-attach-a-resource-to-a-private-network-using-a-reserved-ip-address) when attaching the resource.
5864

5965
Whether you choose a custom or default CIDR block, automatic address assignment or use a reserved address, **the resource's private IP address does not risk changing** unless you detach the resource from the Private Network. To ensure that you can keep the same address for a resource even after detaching it, use the [reserve IP](/network/ipam/how-to/reserve-ip/) functionality.
6066

@@ -87,7 +93,7 @@ Legacy Public Gateways use a [workaround](/network/vpc/reference-content/vpc-mig
8793

8894
Legacy mode will be deprecated going forward, and will not be compatible with v2 of the Public Gateway API. It will no longer be possible to create legacy-mode Public Gateways, all gateways will necessarily be in IPAM mode.
8995

90-
If you still have a legacy gateway, you must transition it to IPAM mode so that it is compatible with v2 of the API. Do this by using the **Move to IPAM mode** button in the console, or the [dedicated API call](TODO). This will update the auto-calculated `is_legacy` field and put your gateway in IPAM mode.
96+
If you still have a legacy gateway, you must [transition it to IPAM mode](#how-do-i-move-my-legacy-public-gateway-to-ipam-mode) so that it is compatible with v2 of the API. This will update the auto-calculated `is_legacy` field and put your gateway in IPAM mode.
9197

9298
### Removal of the DHCP object
9399

@@ -105,7 +111,7 @@ When attaching a Public Gateway to a Private Network (creating a [Gateway Networ
105111

106112
**The `address` field does not exist in v2 of the API**. Instead, you can pass an `ipam_ip_id` to specify a reserved IP address to use for a Public Gateway on a Private Network, if you wish. On the Scaleway console, you can select a [reserved IP](/ipam/how-to/reserve-ip/) to use when attaching a Public Gateway to a Private Network. Otherwise, use the default behaviour where IPAM auto-assigns an IP address from the Private Network's CIDR block to the Public Gateway at the moment of attachment.
107113

108-
When you use the **Move to IPAM mode** button in the console, or the [dedicated API call](TODO) to move a legacy Public Gateway to IPAM mode, it will keep its current IP address on all attached Private Networks.
114+
When you [use a dedicated method](#how-do-i-move-my-legacy-public-gateway-to-ipam-mode) to move a legacy Public Gateway to IPAM mode, it will keep its current IP address on all attached Private Networks.
109115

110116
### Removal of DHCP entries
111117

@@ -115,7 +121,7 @@ For some time now, this functionality has been available via the API and develop
115121

116122
**DHCP entries do not exist in v2 of the API**. Instead, you can rely on the default IPAM/DHCP functionality as described [above](#background-dhcp-and-ipam). The default behavior will auto-assign IP addresses to resources on the Private Network from the network's CIDR block, or you can use the IP reservation functionality to specify the IP address(es) to assign to each resource.
117123

118-
For custom resources, such as VMs hosted on Elastic Metal servers, you can use the IPAM API's [Attach IP to custom resource](https://www.scaleway.com/en/developers/api/ipam/#path-ips-attach-ip-to-custom-resource) method to assign IP addresses on Private Networks. This lets you associate a [reserved IP](https://www.scaleway.com/en/developers/api/ipam/#path-ips-reserve-a-new-ip) address with a resource name and MAC address.
124+
For custom resources, such as VMs hosted on Elastic Metal servers, we now provide [dedicated functionality](https://www.scaleway.com/en/docs/vpc/how-to/attach-resources-to-pn/) for attaching these to Private Networks. When choosing the **Custom Resource** type, you can specify a MAC address and hostname at the moment of attachment.
119125

120126
We will automatically migrate any existing DHCP entries to IPAM for you, at the moment you put a legacy Public Gateway into IPAM mode. TODO STUFF ABOUT LATER ON DETACH/REATTACH
121127

@@ -137,11 +143,11 @@ TODO CHECK DATES
137143
- **7 March 2025 2025 - 1 Oct 2025: Migration period**: You have a six month migration period to complete the following actions
138144

139145
- Ensure that your Public Gateway is in [IPAM mode](/network/public-gateways/concepts/#ipam). Only IPAM mode gateways are compatible with v2.
140-
- Put any non-IPAM mode ([legacy](/network/public-gateways/concepts/#ipam)) Public Gateways in IPAM-mode, by using the **Move to IPAM mode** button in the console, or the [dedicated API call](TODO).
141-
- Ensure that [DHCP is activated](TODO) on all Private Networks attached to your IPAM-mode Public Gateways.
142-
- Update any code or scripts you have that call version 1 of the Public Gateways API, so that they call version 2 instead. This includes removing any use of the DHCP entries, DHCP objects or address fields as mentioned [above](link).
146+
- Put any non-IPAM mode ([legacy](/network/public-gateways/concepts/#ipam)) Public Gateways in IPAM-mode, by using the **Move to IPAM mode** button in the console, the [dedicated API call](https://www.scaleway.com/en/developers/api/public-gateway/#path-gateways-put-a-public-gateway-in-ipam-mode), or the `move_to_ipam` flag in [Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md).
147+
- Ensure that [DHCP is activated](/vpc/how-to/activate-dhcp/) on all Private Networks attached to your IPAM-mode Public Gateways.
148+
- Update any code or scripts you have that call version 1 of the Public Gateways API, so that they call version 2 instead. This includes removing any use of the DHCP entries, DHCP objects or address fields as mentioned above.
143149

144-
If your Public Gateway is already in IPAM-mode, and you only manage it via the console, you will not be affected by these changes and you do not need to take any action.
150+
If your Public Gateway is already in IPAM mode, and you only manage it via the console, you will not be affected by these changes and you do not need to take any action.
145151

146152
- **1 Oct 2025 - V1 removal**: The Public Gateway v1 API will be removed. Any code or scripts still pointing to v1 will cease to function. We will automatically put any existing legacy Public Gateways into IPAM mode.
147153

@@ -151,31 +157,33 @@ TODO CHECK DATES
151157

152158
- Consider whether you mange your Public Gateway uniquely via the Scaleway console, or via calls to the API/devtools in code and scripts:
153159

154-
- **Code and scripts**: If you have any code or scripts that call v1 of the API, or use devtool functionality that is removed from v2 such as DHCP object or entries, **you must take action before 1 Oct 2025**. Update your code and scripts so they point to v2 of the API. [Follow the examples provided for tools such as Terraform](TODO) to rewrite your devtool templates so they do not refer to removed functionalities. Do this in synchronization with moving your gateway to IPAM mode (if necessary).
160+
- **Code and scripts**: If you have any code or scripts that call v1 of the API, or use devtool functionality that is removed from v2 such as DHCP object or entries, **you must take action before 1 Oct 2025**. Update your code and scripts so they point to v2 of the API. [Follow the examples provided for tools such as Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md) to rewrite your devtool templates so they do not refer to removed functionalities. Do this in synchronization with moving your gateway to IPAM mode (if necessary).
155161

156162
- **Console-only**: You do not need to take any action, except ensuring that your gateway is in IPAM mode.
157163

158164
- Check in the [Scaleway console](https://console.scaleway.com/public-gateway/public-gateways) whether your Public Gateway is in IPAM mode or legacy mode:
159165

160-
- **Legacy mode**: you must move the gateway to IPAM mode. Only IPAM mode gateways are compatible with v2. Use the **Move to IPAM mode** button in the console, or the [dedicated API call](TODO).
166+
- **Legacy mode**: you must move the gateway to IPAM mode. Only IPAM mode gateways are compatible with v2. Use the **Move to IPAM mode** button in the console, the [dedicated API call](https://www.scaleway.com/en/developers/api/public-gateway/#path-gateways-put-a-public-gateway-in-ipam-mode), or the `move_to_ipam` flag in [Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md).
161167

162168
- **IPAM mode**: you do not have any action to take, except updating any code and scripts that you have (see above).
163169

164170
### How do I move my legacy Public Gateway to IPAM mode?
165171

166-
Use the **Move to IPAM mode** button next to your gateway in the [Scaleway console](https://console.scaleway.com/public-gateway/public-gateways), or the [dedicated API call](TODO).
172+
You can do this in several ways:
167173

168-
If you use Terraform to manage your infrastructure as code, modify your templates to reattach your Public Gateways in IPAM mode, and use IPAM functionality to replace any DHCP configurations. Refer to our [Terraform snippets](TODO) for help with this.
174+
- Use the **Move to IPAM mode** button in the console
175+
- Use the [dedicated API call](https://www.scaleway.com/en/developers/api/public-gateway/#path-gateways-put-a-public-gateway-in-ipam-mode).
176+
- Use the `move_to_ipam` flag in [Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md)
169177

170178
### What happens when I move my legacy Public Gateway to IPAM mode?
171179

172-
We will detach your Public Gateway from all attached Private Networks, and reattach it in IPAM mode. You can expect downtime of about 10-20 seconds. We will ensure that the IP used for the new attachment is the same as the old one.
180+
We will detach your Public Gateway from all attached Private Networks, and reattach it in IPAM mode. You can expect downtime of about 10-20 seconds. We will ensure that the IP address used for the new attachment is the same as the old one.
173181

174182
### My Public Gateway is already in IPAM mode, do I need to take any action?
175183

176184
If you only manage your gateway via the Scaleway console, you do not need to take any action once your gateway is in IPAM mode.
177185

178-
If you have any code or scripts that call v1 of the Scaleway Public Gateways API, you must update these to point towards [v2](TODO) before 1 Oct 2025.
186+
If you have any code or scripts that call v1 of the Scaleway Public Gateways API, you must update these to point towards [v2](https://www.scaleway.com/en/developers/api/public-gateway/) before 1 Oct 2025.
179187

180188
### What if I want to keep using my custom gateway DHCP configuration from v1 of the API?
181189

@@ -185,11 +193,22 @@ Going forward, we expect users who were previously using custom DHCP with a Publ
185193

186194
### I use Terraform to manage my Public Gateway, what should I do?
187195

188-
If you use Terraform to manage your infrastructure as code, ensure that you are not using any functionality associated with v1 of the API (DHCP objects, DHCP entries or the `address` field). If necessary, modify your templates to reattach your Public Gateways in IPAM mode, and use IPAM functionality to replace any DHCP configurations. Refer to our [Terraform snippets](TODO) for help with this.
196+
If you use Terraform to manage your infrastructure as code, ensure that you are not using any functionality associated with v1 of the API (DHCP objects, DHCP entries or the `address` field). If necessary, modify your templates to reattach your Public Gateways in IPAM mode with the `move_to_ipam` flag, and use IPAM functionality to replace any DHCP configurations.
197+
198+
```
199+
resource "scaleway_vpc_public_gateway" "main" {
200+
name = "foobar"
201+
type = "VPC-GW-S"
202+
ip_id = scaleway_vpc_public_gateway_ip.main.id
203+
move_to_ipam = true
204+
}
205+
```
206+
207+
Refer to our [Terraform migration guide](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md) for full details and help moving legacy gateways to IPAM mode.
189208

190209
### Can't I just wait for Scaleway to force the move to IPAM mode?
191210

192-
After the 1 Oct 2025 we will carry out a forced action which will move all existing legacy Public Gateways to IPAM mode, and we will remove v1 of the Public Gateways API.
211+
After 1 Oct 2025 we will carry out a forced action which will move all existing legacy Public Gateways to IPAM mode, and we will remove v1 of the Public Gateways API.
193212

194213
We highly recommend that you move to IPAM mode **before** this date, so that you can plan a smooth and synchronized transition at a time that suits you.
195214

@@ -205,3 +224,4 @@ The following documentation resources may be useful to you:
205224
- [Public Gateway Main Documentation](https://www.scaleway.com/en/docs/network/public-gateways/)
206225
- [IPAM API Documentation](https://www.scaleway.com/en/developers/api/ipam/)
207226
- [IPAM Main Documentation](https://www.scaleway.com/en/docs/network/ipam/)
227+
- [Moving a Public Gateway from Legacy mode to IPAM mode with Terraform](https://github.com/scaleway/terraform-provider-scaleway/blob/master/docs/guides/migration_guide_vpcgw_v2.md)

0 commit comments

Comments
 (0)