|
| 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 | +``` |
0 commit comments