Skip to content

Commit 5456ab4

Browse files
committed
fix(doc): add example in vpc_route and add information about mapping_id in baremetal
1 parent 8e60c5e commit 5456ab4

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

docs/resources/baremetal_server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ In addition to all arguments above, the following attributes are exported:
316316
- `os_name` - The name of the os.
317317
- `private_network` - The private networks attached to the server.
318318
- `id` - The ID of the private network.
319+
- `mapping_id` - The ID of the Server-to-Private Network mapping.
319320
- `vlan` - The VLAN ID associated to the private network.
320321
- `status` - The private network status.
321322
- `created_at` - The date and time of the creation of the private network.

docs/resources/vpc_route.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For more information, see [the main documentation](https://www.scaleway.com/en/d
1010

1111
## Example Usage
1212

13-
### Basic
13+
### With Instance
1414

1515
```terraform
1616
resource "scaleway_vpc" "vpc01" {
@@ -45,6 +45,64 @@ resource "scaleway_vpc_route" "rt01" {
4545
}
4646
```
4747

48+
### With Baremetal
49+
50+
```terraform
51+
resource "scaleway_vpc" "vpc01" {
52+
name = "tf-vpc-vpn"
53+
}
54+
55+
resource "scaleway_vpc_private_network" "pn01" {
56+
name = "tf-pn-vpn"
57+
ipv4_subnet {
58+
subnet = "172.16.64.0/22"
59+
}
60+
vpc_id = scaleway_vpc.vpc01.id
61+
}
62+
63+
data "scaleway_baremetal_os" "my_os" {
64+
zone = "fr-par-2"
65+
name = "Ubuntu"
66+
version = "22.04 LTS (Jammy Jellyfish)"
67+
}
68+
69+
data "scaleway_baremetal_offer" "my_offer" {
70+
zone = "fr-par-2"
71+
name = "EM-B112X-SSD"
72+
}
73+
74+
data "scaleway_baremetal_option" "private_network" {
75+
zone = "fr-par-2"
76+
name = "Private Network"
77+
}
78+
79+
data "scaleway_iam_ssh_key" "my_key" {
80+
name = "main"
81+
}
82+
83+
resource "scaleway_baremetal_server" "my_server" {
84+
zone = "fr-par-2"
85+
offer = data.scaleway_baremetal_offer.my_offer.offer_id
86+
os = data.scaleway_baremetal_os.my_os.os_id
87+
ssh_key_ids = [data.scaleway_iam_ssh_key.my_key.id]
88+
89+
options {
90+
id = data.scaleway_baremetal_option.private_network.option_id
91+
}
92+
private_network {
93+
id = scaleway_vpc_private_network.pn01.id
94+
}
95+
}
96+
97+
resource "scaleway_vpc_route" "rt01" {
98+
vpc_id = scaleway_vpc.vpc01.id
99+
description = "tf-route-vpn"
100+
tags = ["tf", "route"]
101+
destination = "10.0.0.0/24"
102+
nexthop_resource_id = scaleway_baremetal_server.my_server.private_network.0.mapping_id
103+
}
104+
```
105+
48106
## Argument Reference
49107

50108
The following arguments are supported:

0 commit comments

Comments
 (0)