Skip to content

Commit e2007b1

Browse files
Add documentation for new networking-related resources & data sources (#1729)
* Add networking-related docs * fix lint * Remove residual image references
1 parent 5369643 commit e2007b1

File tree

5 files changed

+206
-0
lines changed

5 files changed

+206
-0
lines changed

docs/data-sources/networking_ip.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ The Linode Network IP Address resource exports the following attributes:
4646
* `linode_id` - The ID of the Linode this address currently belongs to.
4747

4848
* `region` - The Region this IP address resides in. See all regions [here](https://api.linode.com/v4/regions).
49+
50+
* `reserved` - Whether this IP address is a reserved IP.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
page_title: "Linode: linode_networking_ips"
3+
description: |-
4+
Retrieves a list of IP addresses on your account, including unassigned reserved IP addresses.
5+
---
6+
7+
# linode\_networking\_ips
8+
9+
Provides information about all IP addresses associated with the current Linode account, including both assigned and unassigned reserved IP addresses.
10+
11+
## Example Usage
12+
13+
Retrieve all IPs under the current account:
14+
15+
```hcl
16+
data "linode_networking_ips" "all" {}
17+
```
18+
19+
Retrieve all IPs under the current account in a specific region:
20+
21+
```hcl
22+
data "linode_networking_ips" "filtered" {
23+
filter {
24+
name = "region"
25+
values = ["us-mia"]
26+
}
27+
}
28+
```
29+
30+
## Argument Reference
31+
32+
The following arguments are supported:
33+
34+
* [`filter`](#filter) - (Optional) A set of filters used to select IP addresses that meet certain requirements.
35+
36+
* `order_by` - (Optional) The attribute to order the results by. See the [Filterable Fields section](#filterable-fields) for a list of valid fields.
37+
38+
* `order` - (Optional) The order in which results should be returned. (`asc`, `desc`; default `asc`)
39+
40+
### Filter
41+
42+
* `name` - (Required) The name of the field to filter by. See the [Filterable Fields section](#filterable-fields) for a complete list of filterable fields.
43+
44+
* `values` - (Required) A list of values for the filter to allow. These values should all be in string form.
45+
46+
* `match_by` - (Optional) The method to match the field by. (`exact`, `regex`, `substring`; default `exact`)
47+
48+
## Attributes Reference
49+
50+
Each IP address will be stored in the `ip_addresses` attribute and will export the following attributes:
51+
52+
* `address` - The IP address.
53+
54+
* `gateway` - The default gateway for this address.
55+
56+
* `subnet_mask` - The mask that separates host bits from network bits for this address.
57+
58+
* `prefix` - The number of bits set in the subnet mask.
59+
60+
* `type` - The type of address this is (ipv4, ipv6, ipv6/pool, ipv6/range).
61+
62+
* `public` - Whether this is a public or private IP address.
63+
64+
* `rdns` - The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set.
65+
66+
* `linode_id` - The ID of the Linode this address currently belongs to.
67+
68+
* `region` - The Region this IP address resides in. See all regions [here](https://api.linode.com/v4/regions).
69+
70+
* `reserved` - Whether this IP address is a reserved IP.
71+
72+
## Filterable Fields
73+
74+
* `address`
75+
76+
* `gateway`
77+
78+
* `subnet_mask`
79+
80+
* `prefix`
81+
82+
* `type`
83+
84+
* `public`
85+
86+
* `rdns`
87+
88+
* `linode_id`
89+
90+
* `region`
91+
92+
* `reserved`

docs/resources/instance.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ The following arguments are supported:
192192

193193
* **NOTE: Disk encryption may not currently be available to all users.**
194194

195+
* `ipv4` - (Optional) A set of reserved IPv4 addresses to assign to this Linode on creation.
196+
197+
* **NOTE: IP reservation is not currently available to all users.**
198+
195199
* `group` - (Optional, Deprecated) A deprecated property denoting a group label for this Linode. We recommend using the `tags` attribute instead.
196200

197201
### Simplified Resource Arguments

docs/resources/networking_ip.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
page_title: "Linode: linode_networking_ip"
3+
description: |-
4+
Manages the allocation and assignment of an IP addresses.
5+
---
6+
7+
# linode\_networking\_ip
8+
9+
Manages allocation of reserved IPv4 address in a region and optionally assigning the reserved address to a Linode instance.
10+
11+
For more information, see the corresponding [API documentation](https://techdocs.akamai.com/linode-api/reference/post-allocate-ip).
12+
13+
## Example Usage
14+
15+
```hcl
16+
resource "linode_networking_ip" "test_ip" {
17+
type = "ipv4"
18+
linode_id = 12345
19+
public = true
20+
}
21+
```
22+
23+
## Argument Reference
24+
25+
The following arguments are supported:
26+
27+
* `type` - (Required) The type of IP address. (ipv4, ipv6, etc.)
28+
29+
* `public` - (Optional) Whether the IP address is public. Defaults to true.
30+
31+
* `linode_id` - (Optional) The ID of the Linode to which the IP address will be assigned. Conflicts with `region`.
32+
33+
### Reserved-Specific Argument Reference
34+
35+
-> **Note:** IP reservation is not currently accessible to all users.
36+
37+
The following arguments are only available when reserving an IP address:
38+
39+
* `reserved` - (Optional) Whether this IP address should be a reserved IP.
40+
41+
* `region` - (Optional) The region where the reserved IP should be allocated.
42+
43+
## Attributes Reference
44+
45+
In addition to all arguments above, the following attributes are exported:
46+
47+
* `address` - The IP address.
48+
49+
* `id` - The IP address.
50+
51+
## Import
52+
53+
IP addresses can be imported using the IP address ID, e.g.
54+
55+
```sh
56+
terraform import linode_networking_ip.example_ip 172.104.30.209
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
page_title: "Linode: linode_networking_ip_assignment"
3+
description: |-
4+
Managed the assignment multiple IPv4 addresses and/or IPv6 ranges to multiple Linodes in a Region.
5+
---
6+
7+
# linode_networking_ip_assignment
8+
9+
Manages the assignment of multiple IPv4 addresses and/or IPv6 ranges to multiple Linodes in a specified region.
10+
11+
For more information, see the corresponding [API documentation](https://techdocs.akamai.com/linode-api/reference/post-assign-ips).
12+
13+
## Example Usage
14+
15+
```hcl
16+
resource "linode_networking_ip_assignment" "foobar" {
17+
region = "us-mia"
18+
19+
assignments = [
20+
{
21+
address = linode_networking_ip.reserved_ip1.address
22+
linode_id = linode_instance.terraform-web1.id
23+
},
24+
{
25+
address = linode_networking_ip.reserved_ip2.address
26+
linode_id = linode_instance.terraform-web2.id
27+
},
28+
]
29+
}
30+
```
31+
32+
## Argument Reference
33+
34+
* `region` - (Required) The region where the IP addresses will be assigned.
35+
36+
* `assignments` - (Required) A list of IP/Linode assignments to apply.
37+
38+
## assignments
39+
40+
The following attributes can be defined under each entry in the `assignments` field:
41+
42+
* `address` - (Required) The IPv4 address or IPv6 range to assign.
43+
44+
* `linode_id` - (Required) The ID of the Linode to which the IP address will be assigned.
45+
46+
## Attribute Reference
47+
48+
* `id` - The unique ID of this resource.
49+
50+
## Import
51+
52+
Network IP assignments cannot be imported.

0 commit comments

Comments
 (0)