@@ -14,13 +14,13 @@ For more information, see [the documentation](https://developers.scaleway.com/en
1414### Basic
1515
1616``` hcl
17- resource "scaleway_lb_ip" "ip " {
17+ resource "scaleway_lb_ip" "main " {
1818 zone = "fr-par-1"
1919}
2020
2121resource "scaleway_lb" "base" {
22- ip_id = scaleway_lb_ip.ip .id
23- zone = scaleway_lb_ip.ip .zone
22+ ip_id = scaleway_lb_ip.main .id
23+ zone = scaleway_lb_ip.main .zone
2424 type = "LB-S"
2525}
2626```
@@ -70,22 +70,22 @@ resource "scaleway_instance_server" "main" {
7070}
7171
7272### IP for LB IP
73- resource scaleway_lb_ip ip01 {
73+ resource scaleway_lb_ip main {
7474}
7575
7676### Scaleway Private Network
77- resource scaleway_vpc_private_network "static " {
77+ resource scaleway_vpc_private_network "main " {
7878 name = "private network with static config"
7979}
8080
8181### Scaleway Load Balancer
82- resource scaleway_lb lb01 {
83- ip_id = scaleway_lb_ip.ip01 .id
84- name = "test-lb-with-private-network-configs "
82+ resource scaleway_lb main {
83+ ip_id = scaleway_lb_ip.main .id
84+ name = "MyTest "
8585 type = "LB-S"
8686
8787 private_network {
88- private_network_id = scaleway_vpc_private_network.static .id
88+ private_network_id = scaleway_vpc_private_network.main .id
8989 static_config = ["172.16.0.100", "172.16.0.101"]
9090 }
9191
@@ -102,13 +102,11 @@ resource scaleway_lb lb01 {
102102
103103The following arguments are supported:
104104
105- - ` ip_id ` - (Required) The ID of the associated IP. See below.
106-
107- ~ > ** Important:** Updates to ` ip_id ` will recreate the load-balancer.
105+ - ` ip_id ` - (Required) The ID of the associated LB IP. See below.
108106
109- - ` type ` - (Required) The type of the load-balancer.
107+ ~ > ** Important: ** Updates to ` ip_id ` will not recreate the load-balancer.
110108
111- ~ > ** Important: ** Updates to ` type ` will recreate the load-balancer.
109+ - ` type ` - (Required) The type of the load-balancer. Please check the [ migration section ] ( #migration ) to upgrade the type
112110
113111- ` name ` - (Optional) The name of the load-balancer.
114112
@@ -130,6 +128,14 @@ In addition to all arguments above, the following attributes are exported:
130128
131129~ > ** Important:** ` release_ip ` will not be supported. This prevents the destruction of the IP from releasing a LBs.
132130The ` resource_lb_ip ` will be the only resource that handles those IPs.
131+
132+ ## Migration
133+
134+ In order to migrate to other types you can check the migration up or down via our CLI ` scw lb lb-types list ` .
135+ this change will not recreate your Load Balancer.
136+
137+ Please check our [ documentation] ( https://developers.scaleway.com/en/products/lb/zoned_api/#post-355592 ) for further details
138+
133139## IP ID
134140
135141Since v1.15.0, ` ip_id ` is a required field. This means that now a separate ` scaleway_lb_ip ` is required.
@@ -139,7 +145,7 @@ When upgrading to v1.15.0, you will need to create a new `scaleway_lb_ip` resour
139145For instance, if you had the following:
140146
141147``` hcl
142- resource "scaleway_lb" "base " {
148+ resource "scaleway_lb" "main " {
143149 zone = "fr-par-1"
144150 type = "LB-S"
145151}
@@ -148,11 +154,11 @@ resource "scaleway_lb" "base" {
148154You will need to update it to:
149155
150156``` hcl
151- resource "scaleway_lb_ip" "ip " {
157+ resource "scaleway_lb_ip" "main " {
152158}
153159
154- resource "scaleway_lb" "base " {
155- ip_id = scaleway_lb_ip.ip .id
160+ resource "scaleway_lb" "main " {
161+ ip_id = scaleway_lb_ip.main .id
156162 zone = "fr-par-1"
157163 type = "LB-S"
158164 release_ip = false
@@ -162,29 +168,31 @@ resource "scaleway_lb" "base" {
162168## Private Network with static config
163169
164170``` hcl
165- resource scaleway_lb_ip ip01 {
171+ resource scaleway_lb_ip main {
166172}
167173
168- resource scaleway_vpc_private_network pnLB01 {
169- name = "pn-with-lb-static "
174+ resource scaleway_vpc_private_network main {
175+ name = "MyTest "
170176}
171177
172- resource scaleway_lb lb01 {
173- ip_id = scaleway_lb_ip.ip01 .id
174- name = "test-lb-with-pn-static-2 "
178+ resource scaleway_lb main {
179+ ip_id = scaleway_lb_ip.main .id
180+ name = "MyTest "
175181 type = "LB-S"
176182 release_ip = false
177183 private_network {
178- private_network_id = scaleway_vpc_private_network.pnLB01 .id
184+ private_network_id = scaleway_vpc_private_network.main .id
179185 static_config = ["172.16.0.100", "172.16.0.101"]
180186 }
181187}
182188```
183189
184- ~ > ** Important: ** Updates to ` private_network ` will recreate the attachment.
190+ ## Attributes Reference
185191
186192- ` private_network_id ` - (Required) The ID of the Private Network to associate.
187193
194+ - ~ > ** Important:** Updates to ` private_network ` will recreate the attachment.
195+
188196- ` static_config ` - (Optional) Define two local ip address of your choice for each load balancer instance. See below.
189197
190198- ` dhcp_config ` - (Optional) Set to true if you want to let DHCP assign IP addresses. See below.
@@ -193,32 +201,13 @@ resource scaleway_lb lb01 {
193201
194202- ` zone ` - (Defaults to [ provider] ( ../index.md#zone ) ` zone ` ) The [ zone] ( ../guides/regions_and_zones.md#zones ) in which the private network was created.
195203
196- ## Attributes Reference
197-
198- In addition to all arguments above, the following attributes are exported:
199-
200- - ` status ` - The Private Network attachment status
201-
202- And before running ` terraform apply ` you will need to import the IP with:
203-
204- ``` bash
205- $ terraform import scaleway_lb_ip.ip fr-par/11111111-1111-1111-1111-111111111111
206- ```
207-
208- The IP ID can either be found in the console, or you can run:
209-
210- ``` bash
211- $ terraform state show scaleway_lb.base
212- ```
213-
214- and look for ` ip_id ` .
215204
216205## Import
217206
218207Load-Balancer can be imported using the ` {zone}/{id} ` , e.g.
219208
220209``` bash
221- $ terraform import scaleway_lb.lb01 fr-par-1/11111111-1111-1111-1111-111111111111
210+ $ terraform import scaleway_lb.main fr-par-1/11111111-1111-1111-1111-111111111111
222211```
223212
224213Be aware that you will also need to import the ` scaleway_lb_ip ` resource.
0 commit comments