Skip to content

Commit f9ec5cb

Browse files
authored
feat(interlink): add link resources (#3943)
* feat(interlink): add link resources * fmt * update cassettes * fix vpc route test
1 parent 3a5bdae commit f9ec5cb

19 files changed

Lines changed: 4190 additions & 2 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
subcategory: "Interlink"
3+
page_title: "Scaleway: scaleway_interlink_link"
4+
---
5+
6+
# scaleway_interlink_link
7+
8+
Gets information about an Interlink Link.
9+
10+
A link is a logical Interlink session created within a PoP, representing the connection between your infrastructure and Scaleway.
11+
12+
13+
For more information, see [the Interlink documentation](https://www.scaleway.com/en/docs/network/interlink/) and [API documentation](https://www.scaleway.com/en/developers/api/interlink/).
14+
15+
16+
## Example Usage
17+
18+
```terraform
19+
# Get link info by ID
20+
data "scaleway_interlink_link" "my_link" {
21+
link_id = "11111111-1111-1111-1111-111111111111"
22+
}
23+
```
24+
25+
```terraform
26+
# Get link info by name
27+
data "scaleway_interlink_link" "my_link" {
28+
name = "my-link"
29+
}
30+
```
31+
32+
33+
34+
35+
## Argument Reference
36+
37+
- `name` - (Optional) Name of the link. Conflicts with `link_id`.
38+
39+
- `link_id` - (Optional) Unique identifier of the link. Conflicts with `name`.
40+
41+
-> **Note** You must specify at least one: `name` and/or `link_id`.
42+
43+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the link exists.
44+
45+
- `project_id` - (Optional) Project ID.
46+
47+
## Attributes Reference
48+
49+
In addition to all above arguments, the following attributes are exported:
50+
51+
- `id` - Unique identifier of the link.
52+
- `pop_id` - ID of the PoP where the link's corresponding connection is located.
53+
- `bandwidth_mbps` - Rate limited bandwidth of the link.
54+
- `status` - Status of the link.
55+
- `bgp_v4_status` - Status of the link's BGP IPv4 session.
56+
- `bgp_v6_status` - Status of the link's BGP IPv6 session.
57+
- `vpc_id` - ID of the Scaleway VPC attached to the link.
58+
- `enable_route_propagation` - Defines whether route propagation is enabled or not.
59+
- `partner_id` - ID of the partner facilitating the link.
60+
- `connection_id` - Dedicated physical connection supporting the link.
61+
- `pairing_key` - Used to identify a link from a user or partner's point of view.
62+
- `vlan` - VLAN of the link.
63+
- `peer_asn` - For self-hosted links, the peer AS Number to establish BGP session.
64+
- `routing_policy_v4_id` - ID of the routing policy IPv4 attached to the link.
65+
- `routing_policy_v6_id` - ID of the routing policy IPv6 attached to the link.
66+
- `scw_bgp_config` - BGP configuration on Scaleway's side.
67+
- `peer_bgp_config` - BGP configuration on peer's side (on-premises or other hosting provider).
68+
- `tags` - List of tags associated with the link.
69+
- `created_at` - Creation date of the link.
70+
- `updated_at` - Last modification date of the link.
71+
- `organization_id` - Organization ID.
72+
73+
~> **Important:** Interlink Links 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`

docs/resources/interlink_link.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
subcategory: "Interlink"
3+
page_title: "Scaleway: scaleway_interlink_link"
4+
---
5+
6+
# Resource: scaleway_interlink_link
7+
8+
Creates and manages Scaleway Interlink Links.
9+
10+
A link is a logical Interlink session created within a PoP, representing the connection between your infrastructure and Scaleway. Links can be hosted (facilitated by a partner's shared connection) or self-hosted (using your own dedicated physical connection).
11+
12+
13+
For more information, see [the Interlink documentation](https://www.scaleway.com/en/docs/network/interlink/) and [API documentation](https://www.scaleway.com/en/developers/api/interlink/).
14+
15+
16+
## Example Usage
17+
18+
```terraform
19+
data "scaleway_interlink_pop" "pop" {
20+
name = "Telehouse TH2"
21+
}
22+
23+
data "scaleway_interlink_partner" "partner" {
24+
name = "FranceIX"
25+
}
26+
27+
resource "scaleway_interlink_link" "main" {
28+
name = "my-hosted-link"
29+
pop_id = data.scaleway_interlink_pop.pop.id
30+
partner_id = data.scaleway_interlink_partner.partner.id
31+
bandwidth_mbps = 50
32+
}
33+
```
34+
35+
36+
37+
38+
## Argument Reference
39+
40+
The following arguments are supported:
41+
42+
- `pop_id` - (Required) PoP (location) where the link will be created.
43+
- `bandwidth_mbps` - (Required) Desired bandwidth for the link. Must be compatible with available link bandwidths and remaining bandwidth capacity of the connection.
44+
- `name` - (Optional) Name of the link. If not provided, a name will be randomly generated.
45+
- `tags` - (Optional) List of tags to apply to the link.
46+
- `partner_id` - (Optional) If set, creates a hosted link on a partner's connection. Specify the ID of the chosen partner, who already has a shared connection with available bandwidth. Conflicts with `connection_id`.
47+
- `connection_id` - (Optional) If set, creates a self-hosted link using this dedicated physical connection. Conflicts with `partner_id`.
48+
- `peer_asn` - (Optional) For self-hosted links, the peer AS Number to establish BGP session. If not given, a default one will be assigned.
49+
- `vlan` - (Optional) For self-hosted links only, the VLAN ID. If the VLAN is not available (already taken or out of range), an error is returned.
50+
- `routing_policy_v4_id` - (Optional) If set, attaches this routing policy containing IPv4 prefixes to the link. A BGP IPv4 session will be created.
51+
- `routing_policy_v6_id` - (Optional) If set, attaches this routing policy containing IPv6 prefixes to the link. A BGP IPv6 session will be created.
52+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the link should be created.
53+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the link is associated with.
54+
55+
## Attributes Reference
56+
57+
In addition to all arguments above, the following attributes are exported:
58+
59+
- `id` - Unique identifier of the link.
60+
- `status` - Status of the link.
61+
- `bgp_v4_status` - Status of the link's BGP IPv4 session.
62+
- `bgp_v6_status` - Status of the link's BGP IPv6 session.
63+
- `vpc_id` - ID of the Scaleway VPC attached to the link.
64+
- `enable_route_propagation` - Defines whether route propagation is enabled or not.
65+
- `pairing_key` - Used to identify a link from a user or partner's point of view.
66+
- `scw_bgp_config` - BGP configuration on Scaleway's side. Contains `asn`, `ipv4`, `ipv6`.
67+
- `peer_bgp_config` - BGP configuration on peer's side (on-premises or other hosting provider). Contains `asn`, `ipv4`, `ipv6`.
68+
- `created_at` - Creation date of the link (RFC 3339 format).
69+
- `updated_at` - Last modification date of the link (RFC 3339 format).
70+
- `organization_id` - Organization ID.
71+
72+
~> **Important:** Interlink Links' 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`
73+
74+
## Import
75+
76+
Interlink Links can be imported using `{region}/{id}`, e.g.
77+
78+
```bash
79+
terraform import scaleway_interlink_link.main fr-par/11111111-1111-1111-1111-111111111111
80+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Get link info by ID
2+
data "scaleway_interlink_link" "my_link" {
3+
link_id = "11111111-1111-1111-1111-111111111111"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Get link info by name
2+
data "scaleway_interlink_link" "my_link" {
3+
name = "my-link"
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
data "scaleway_interlink_pop" "pop" {
2+
name = "Telehouse TH2"
3+
}
4+
5+
data "scaleway_interlink_partner" "partner" {
6+
name = "FranceIX"
7+
}
8+
9+
resource "scaleway_interlink_link" "main" {
10+
name = "my-hosted-link"
11+
pop_id = data.scaleway_interlink_pop.pop.id
12+
partner_id = data.scaleway_interlink_partner.partner.id
13+
bandwidth_mbps = 50
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Creates and manages Scaleway Interlink Links.
2+
3+
A link is a logical Interlink session created within a PoP, representing the connection between your infrastructure and Scaleway. Links can be hosted (facilitated by a partner's shared connection) or self-hosted (using your own dedicated physical connection).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Gets information about an Interlink Link.
2+
3+
A link is a logical Interlink session created within a PoP, representing the connection between your infrastructure and Scaleway.

0 commit comments

Comments
 (0)