|
5 | 5 | "testing" |
6 | 6 |
|
7 | 7 | "github.com/equinix/terraform-provider-equinix/internal/config" |
| 8 | + "github.com/equinix/terraform-provider-equinix/internal/nprintf" |
8 | 9 |
|
9 | 10 | "github.com/equinix/ne-go" |
10 | 11 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" |
@@ -104,29 +105,29 @@ func (t *testAccConfig) withBGP() *testAccConfig { |
104 | 105 |
|
105 | 106 | func testAccNetworkBGP(ctx map[string]interface{}) string { |
106 | 107 | var config string |
107 | | - config += nprintf(` |
| 108 | + config += nprintf.Nprintf(` |
108 | 109 | resource "equinix_network_bgp" "%{bgp-resourceName}" { |
109 | 110 | connection_id = equinix_fabric_connection.%{connection-resourceName}.id |
110 | 111 | local_ip_address = "%{bgp-local_ip_address}" |
111 | 112 | local_asn = %{bgp-local_asn} |
112 | 113 | remote_ip_address = "%{bgp-remote_ip_address}" |
113 | 114 | remote_asn = %{bgp-remote_asn}`, ctx) |
114 | 115 | if _, ok := ctx["bgp-authentication_key"]; ok { |
115 | | - config += nprintf(` |
| 116 | + config += nprintf.Nprintf(` |
116 | 117 | authentication_key = "%{bgp-authentication_key}"`, ctx) |
117 | 118 | } |
118 | 119 | config += ` |
119 | 120 | }` |
120 | 121 | if _, ok := ctx["connection-secondary_name"]; ok { |
121 | | - config += nprintf(` |
| 122 | + config += nprintf.Nprintf(` |
122 | 123 | resource "equinix_network_bgp" "%{bgp-secondary_resourceName}" { |
123 | 124 | connection_id = equinix_fabric_connection.%{connection-resourceName}.id |
124 | 125 | local_ip_address = "%{bgp-secondary_local_ip_address}" |
125 | 126 | local_asn = %{bgp-secondary_local_asn} |
126 | 127 | remote_ip_address = "%{bgp-secondary_remote_ip_address}" |
127 | 128 | remote_asn = %{bgp-secondary_remote_asn}`, ctx) |
128 | 129 | if _, ok := ctx["bgp-secondary_authentication_key"]; ok { |
129 | | - config += nprintf(` |
| 130 | + config += nprintf.Nprintf(` |
130 | 131 | authentication_key = "%{bgp-secondary_authentication_key}"`, ctx) |
131 | 132 | } |
132 | 133 | config += ` |
@@ -199,20 +200,20 @@ func testAccVDFabricL2Connection(ctx map[string]interface{}) string { |
199 | 200 | var config string |
200 | 201 | if _, ok := ctx["zside-service_token"]; !ok { |
201 | 202 | if _, ok := ctx["connection-profile_uuid"]; !ok { |
202 | | - config += nprintf(` |
| 203 | + config += nprintf.Nprintf(` |
203 | 204 | data "equinix_fabric_service_profile" "pri" { |
204 | 205 | uuid = "%{fabric-service-profile-uuid}" |
205 | 206 | }`, ctx) |
206 | 207 | } |
207 | 208 | } |
208 | 209 | if _, ok := ctx["connection-secondary_profile_name"]; ok { |
209 | | - config += nprintf(` |
| 210 | + config += nprintf.Nprintf(` |
210 | 211 | data "equinix_fabric_service_profile" "sec" { |
211 | 212 | uuid = "%{fabric-service-profile-uuid}" |
212 | 213 | }`, ctx) |
213 | 214 | } |
214 | 215 |
|
215 | | - config += nprintf(` |
| 216 | + config += nprintf.Nprintf(` |
216 | 217 | resource "equinix_fabric_connection" "%{connection-resourceName}" { |
217 | 218 | name = "%{connection-name}" |
218 | 219 | type = "EVPL_VC" |
@@ -250,98 +251,98 @@ a_side { |
250 | 251 | }`, ctx) |
251 | 252 |
|
252 | 253 | if _, ok := ctx["service_token"]; ok { |
253 | | - config += nprintf(` |
| 254 | + config += nprintf.Nprintf(` |
254 | 255 | service_token = "%{service_token}"`, ctx) |
255 | 256 | } |
256 | 257 | if _, ok := ctx["zside-service_token"]; ok { |
257 | | - config += nprintf(` |
| 258 | + config += nprintf.Nprintf(` |
258 | 259 | zside_service_token = "%{zside-service_token}"`, ctx) |
259 | 260 | } |
260 | 261 | if _, ok := ctx["zside-port_uuid"]; ok { |
261 | | - config += nprintf(` |
| 262 | + config += nprintf.Nprintf(` |
262 | 263 | zside_port_uuid = "%{zside-port_uuid}"`, ctx) |
263 | 264 | } |
264 | 265 | if _, ok := ctx["connection-purchase_order_number"]; ok { |
265 | | - config += nprintf(` |
| 266 | + config += nprintf.Nprintf(` |
266 | 267 | purchase_order_number = "%{connection-purchase_order_number}"`, ctx) |
267 | 268 | } |
268 | 269 |
|
269 | 270 | if _, ok := ctx["port-uuid"]; ok { |
270 | | - config += nprintf(` |
| 271 | + config += nprintf.Nprintf(` |
271 | 272 | port_uuid = "%{port-uuid}"`, ctx) |
272 | 273 | } else if _, ok := ctx["port-resourceName"]; ok { |
273 | | - config += nprintf(` |
| 274 | + config += nprintf.Nprintf(` |
274 | 275 | port_uuid = data.equinix_ecx_port.%{port-resourceName}.id`, ctx) |
275 | 276 | } |
276 | 277 | if _, ok := ctx["connection-vlan_stag"]; ok { |
277 | | - config += nprintf(` |
| 278 | + config += nprintf.Nprintf(` |
278 | 279 | vlan_stag = %{connection-vlan_stag}`, ctx) |
279 | 280 | } |
280 | 281 | if _, ok := ctx["connection-vlan_ctag"]; ok { |
281 | | - config += nprintf(` |
| 282 | + config += nprintf.Nprintf(` |
282 | 283 | vlan_ctag = %{connection-vlan_ctag}`, ctx) |
283 | 284 | } |
284 | 285 | if _, ok := ctx["connection-named_tag"]; ok { |
285 | | - config += nprintf(` |
| 286 | + config += nprintf.Nprintf(` |
286 | 287 | named_tag = "%{connection-named_tag}"`, ctx) |
287 | 288 | } |
288 | 289 | if _, ok := ctx["connection-device_interface_id"]; ok { |
289 | | - config += nprintf(` |
| 290 | + config += nprintf.Nprintf(` |
290 | 291 | device_interface_id = %{connection-device_interface_id}`, ctx) |
291 | 292 | } |
292 | 293 | if _, ok := ctx["connection-secondary_name"]; ok { |
293 | | - config += nprintf(` |
| 294 | + config += nprintf.Nprintf(` |
294 | 295 | secondary_connection { |
295 | 296 | name = "%{connection-secondary_name}"`, ctx) |
296 | 297 | if _, ok := ctx["connection-secondary_profile_name"]; ok { |
297 | | - config += nprintf(` |
| 298 | + config += nprintf.Nprintf(` |
298 | 299 | profile_uuid = data.equinix_fabric_sellerprofile.sec.id`, ctx) |
299 | 300 | } |
300 | 301 | if _, ok := ctx["secondary-port_uuid"]; ok { |
301 | | - config += nprintf(` |
| 302 | + config += nprintf.Nprintf(` |
302 | 303 | port_uuid = "%{secondary-port_uuid}"`, ctx) |
303 | 304 | } else if _, ok := ctx["port-secondary_resourceName"]; ok { |
304 | | - config += nprintf(` |
| 305 | + config += nprintf.Nprintf(` |
305 | 306 | port_uuid = data.equinix_ecx_port.%{port-secondary_resourceName}.id`, ctx) |
306 | 307 | } |
307 | 308 | if _, ok := ctx["device-secondary_name"]; ok { |
308 | | - config += nprintf(` |
| 309 | + config += nprintf.Nprintf(` |
309 | 310 | device_uuid = equinix_network_device.%{device-resourceName}.redundant_id`, ctx) |
310 | 311 | } |
311 | 312 | if _, ok := ctx["connection-secondary_vlan_stag"]; ok { |
312 | | - config += nprintf(` |
| 313 | + config += nprintf.Nprintf(` |
313 | 314 | vlan_stag = %{connection-secondary_vlan_stag}`, ctx) |
314 | 315 | } |
315 | 316 | if _, ok := ctx["connection-secondary_vlan_ctag"]; ok { |
316 | | - config += nprintf(` |
| 317 | + config += nprintf.Nprintf(` |
317 | 318 | vlan_ctag = %{connection-secondary_vlan_ctag}`, ctx) |
318 | 319 | } |
319 | 320 | if _, ok := ctx["connection-secondary_device_interface_id"]; ok { |
320 | | - config += nprintf(` |
| 321 | + config += nprintf.Nprintf(` |
321 | 322 | device_interface_id = %{connection-secondary_device_interface_id}`, ctx) |
322 | 323 | } |
323 | 324 | if _, ok := ctx["connection-secondary_speed"]; ok { |
324 | | - config += nprintf(` |
| 325 | + config += nprintf.Nprintf(` |
325 | 326 | speed = %{connection-secondary_speed}`, ctx) |
326 | 327 | } |
327 | 328 | if _, ok := ctx["connection-secondary_speed_unit"]; ok { |
328 | | - config += nprintf(` |
| 329 | + config += nprintf.Nprintf(` |
329 | 330 | speed_unit = "%{connection-secondary_speed_unit}"`, ctx) |
330 | 331 | } |
331 | 332 | if _, ok := ctx["connection-secondary_seller_metro_code"]; ok { |
332 | | - config += nprintf(` |
| 333 | + config += nprintf.Nprintf(` |
333 | 334 | seller_metro_code = "%{connection-secondary_seller_metro_code}"`, ctx) |
334 | 335 | } |
335 | 336 | if _, ok := ctx["connection-secondary_seller_region"]; ok { |
336 | | - config += nprintf(` |
| 337 | + config += nprintf.Nprintf(` |
337 | 338 | seller_region = "%{connection-secondary_seller_region}"`, ctx) |
338 | 339 | } |
339 | 340 | if _, ok := ctx["connection-secondary_authorization_key"]; ok { |
340 | | - config += nprintf(` |
| 341 | + config += nprintf.Nprintf(` |
341 | 342 | authorization_key = "%{connection-secondary_authorization_key}"`, ctx) |
342 | 343 | } |
343 | 344 | if _, ok := ctx["secondary-service_token"]; ok { |
344 | | - config += nprintf(` |
| 345 | + config += nprintf.Nprintf(` |
345 | 346 | service_token = "%{secondary-service_token}"`, ctx) |
346 | 347 | } |
347 | 348 | config += ` |
|
0 commit comments