Skip to content

Commit 8844ea6

Browse files
TPT-4275: Reserved IPv4 Addresses (#2405)
* TPT-4292: terraform: Implement linode_reserved_ip resource (#2309) * TPT-4294: terraform: Update linode_instance resource to support reserved IP assignment at creation (#2323) * TPT-4293: terraform: Implement linode_reserved_ip_types data source (#2322) * TPT-4296: terraform: Update linode_nodebalancer resource to support reserved IP assignment (#2329) * TPT-4297: terraform: Implement linode_tag Data Source with Reserved IPv4 Support (#2330) * TPT-4295: terraform: Update linode_networking_ip resource — reserved conversion & IP representation (#2327) * Update unit tests for linodego v2 * Make format --------- Co-authored-by: Michal Wojcik <32574975+mgwoj@users.noreply.github.com>
1 parent b80d98e commit 8844ea6

77 files changed

Lines changed: 3103 additions & 197 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/data-sources/instance_networking.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |-
77
# Data Source: linode\_instance\_networking
88

99
Provides details about the networking configuration of an Instance.
10-
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-linode-config-interfaces).
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-linode-ips).
1111

1212
## Example Usage
1313

@@ -63,8 +63,16 @@ A list of private IP Address objects belonging to this Linode.
6363

6464
* `address` - The private IPv4 address.
6565

66+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
67+
* `id` - The ID of the entity.
68+
* `label` - The label of the entity.
69+
* `type` - The type of the entity.
70+
* `url` - The URL of the entity.
71+
6672
* `gateway` - The default gateway for this address.
6773

74+
* `interface_id` - The Linode interface ID that this IP address is assigned to.
75+
6876
* `linode_id` - The ID of the Linode this address currently belongs to.
6977

7078
* `prefix` - The number of bits set in the subnet mask.
@@ -75,10 +83,19 @@ A list of private IP Address objects belonging to this Linode.
7583

7684
* `region` - (Filterable) The Region this address resides in.
7785

86+
* `reserved` - Whether this IP address is a reserved IP.
87+
7888
* `subnet_mask` - The mask that separates host bits from network bits for this address.
7989

90+
* `tags` - A set of tags associated with this IP address.
91+
8092
* `type` - The type of address this is.
8193

94+
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
95+
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.
96+
* `subnet_id` - The `id` of the VPC Subnet for this Interface.
97+
* `vpc_id` - The `id` of the VPC configured for this Interface.
98+
8299
### Public
83100

84101
A list of public IP Address objects belonging to this Linode.
@@ -99,10 +116,20 @@ A list of public IP Address objects belonging to this Linode.
99116

100117
* `region` - (Filterable) The Region this IP address resides in.
101118

119+
* `reserved` - Whether this IP address is a reserved IP.
120+
102121
* `subnet_mask` - The mask that separates host bits from network bits for this address.
103122

123+
* `tags` - A set of tags associated with this IP address.
124+
104125
* `type` - The type of address this is.
105126

127+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
128+
* `id` - The ID of the entity.
129+
* `label` - The label of the entity.
130+
* `type` - The type of the entity.
131+
* `url` - The URL of the entity.
132+
106133
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
107134
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.
108135
* `subnet_id` - The `id` of the VPC Subnet for this Interface.
@@ -114,6 +141,12 @@ A list of reserved IP Address objects belonging to this Linode.
114141

115142
* `address` - The IP address.
116143

144+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
145+
* `id` - The ID of the entity.
146+
* `label` - The label of the entity.
147+
* `type` - The type of the entity.
148+
* `url` - The URL of the entity.
149+
117150
* `gateway` - (Nullable) The default gateway for this address.
118151

119152
* `interface_id` - The Linode interface ID that this IP address is assigned to.
@@ -128,8 +161,12 @@ A list of reserved IP Address objects belonging to this Linode.
128161

129162
* `region` - (Filterable) The Region this IP address resides in.
130163

164+
* `reserved` - Whether this IP address is a reserved IP.
165+
131166
* `subnet_mask` - The mask that separates host bits from network bits for this address.
132167

168+
* `tags` - A set of tags associated with this IP address.
169+
133170
* `type` - The type of address this is.
134171

135172
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
@@ -143,6 +180,12 @@ A list of shared IP Address objects assigned to this Linode.
143180

144181
* `address` - The IP address.
145182

183+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
184+
* `id` - The ID of the entity.
185+
* `label` - The label of the entity.
186+
* `type` - The type of the entity.
187+
* `url` - The URL of the entity.
188+
146189
* `gateway` - (Nullable) The default gateway for this address.
147190

148191
* `interface_id` - The Linode interface ID that this IP address is assigned to.
@@ -157,8 +200,12 @@ A list of shared IP Address objects assigned to this Linode.
157200

158201
* `region` - (Filterable) The Region this IP address resides in.
159202

203+
* `reserved` - Whether this IP address is a reserved IP.
204+
160205
* `subnet_mask` - The mask that separates host bits from network bits for this address.
161206

207+
* `tags` - A set of tags associated with this IP address.
208+
162209
* `type` - The type of address this is.
163210

164211
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
@@ -221,8 +268,16 @@ A link-local IPv6 address that exists in Linode’s system.
221268

222269
* `address` - The IPv6 link-local address.
223270

271+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
272+
* `id` - The ID of the entity.
273+
* `label` - The label of the entity.
274+
* `type` - The type of the entity.
275+
* `url` - The URL of the entity.
276+
224277
* `gateway` - The default gateway for this address.
225278

279+
* `interface_id` - The Linode interface ID that this IP address is assigned to.
280+
226281
* `linode_id` - The ID of the Linode this address currently belongs to.
227282

228283
* `prefix` - The network prefix.
@@ -233,18 +288,35 @@ A link-local IPv6 address that exists in Linode’s system.
233288

234289
* `region` - (Filterable) The Region this address resides in.
235290

291+
* `reserved` - Whether this IP address is a reserved IP.
292+
236293
* `subnet_mask` - The subnet mask.
237294

295+
* `tags` - A set of tags associated with this IP address.
296+
238297
* `type` - The type of address this is.
239298

299+
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
300+
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.
301+
* `subnet_id` - The `id` of the VPC Subnet for this Interface.
302+
* `vpc_id` - The `id` of the VPC configured for this Interface.
303+
240304
### SLAAC
241305

242306
A SLAAC IPv6 address object that exists in Linode’s system.
243307

244308
* `address` - The address.
245309

310+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
311+
* `id` - The ID of the entity.
312+
* `label` - The label of the entity.
313+
* `type` - The type of the entity.
314+
* `url` - The URL of the entity.
315+
246316
* `gateway` - The default gateway for this address.
247317

318+
* `interface_id` - The Linode interface ID that this IP address is assigned to.
319+
248320
* `linode_id` - The ID of the Linode this address currently belongs to.
249321

250322
* `prefix` - The network prefix.
@@ -255,6 +327,15 @@ A SLAAC IPv6 address object that exists in Linode’s system.
255327

256328
* `region` - (Filterable) The Region this address resides in.
257329

330+
* `reserved` - Whether this IP address is a reserved IP.
331+
258332
* `subnet_mask` - The subnet mask.
259333

334+
* `tags` - A set of tags associated with this IP address.
335+
260336
* `type` - The type of address this is.
337+
338+
* `vpc_nat_1_1` - IPv4 address configured as a 1:1 NAT for this Interface.
339+
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.
340+
* `subnet_id` - The `id` of the VPC Subnet for this Interface.
341+
* `vpc_id` - The `id` of the VPC configured for this Interface.

docs/data-sources/networking_ip.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ The Linode Network IP Address resource exports the following attributes:
5151

5252
* `reserved` - Whether this IP address is a reserved IP.
5353

54+
* `tags` - A set of tags associated with this IP address.
55+
56+
* `assigned_entity` - The entity this IP address has been assigned to. This is `null` if the address is not assigned to an entity.
57+
* `id` - The ID of the entity.
58+
* `label` - The label of the entity.
59+
* `type` - The type of the entity.
60+
* `url` - The URL of the entity.
61+
5462
* `vpc_nat_1_1` - Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
5563

5664
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.

docs/data-sources/networking_ips.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ Each IP address will be stored in the `ip_addresses` attribute and will export t
7171

7272
* `reserved` - Whether this IP address is a reserved IP.
7373

74+
* `tags` - A set of tags associated with this IP address.
75+
76+
* `assigned_entity` - The entity this IP address has been assigned to. This is null if the address is not assigned to an entity.
77+
78+
* `id` - The ID of the entity.
79+
80+
* `label` - The label of the entity.
81+
82+
* `type` - The type of the entity.
83+
84+
* `url` - The URL of the entity.
85+
7486
* `vpc_nat_1_1` - Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
7587

7688
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
page_title: "Linode: linode_reserved_ip_types"
3+
description: |-
4+
Provides information about Linode Reserved IP types that match a set of filters.
5+
---
6+
7+
# Data Source: linode\_reserved\_ip\_types
8+
9+
Provides information about Linode Reserved IP types that match a set of filters.
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-reserved-ip-types).
11+
12+
## Example Usage
13+
14+
Get information about all Reserved IP types:
15+
16+
```hcl
17+
data "linode_reserved_ip_types" "all" {}
18+
19+
output "type_ids" {
20+
value = data.linode_reserved_ip_types.all.types.*.id
21+
}
22+
```
23+
24+
Get information about a specific Reserved IP type by ID:
25+
26+
```hcl
27+
data "linode_reserved_ip_types" "specific" {
28+
filter {
29+
name = "id"
30+
values = ["reserved-ip"]
31+
}
32+
}
33+
34+
output "label" {
35+
value = data.linode_reserved_ip_types.specific.types[0].label
36+
}
37+
```
38+
39+
## Argument Reference
40+
41+
The following arguments are supported:
42+
43+
* [`filter`](#filter) - (Optional) A set of filters used to select Reserved IP types that meet certain requirements.
44+
45+
* `order_by` - (Optional) The attribute to order the results by. See the [Filterable Fields section](#filterable-fields) for a list of valid fields.
46+
47+
* `order` - (Optional) The order in which results should be returned. (`asc`, `desc`; default `asc`)
48+
49+
### Filter
50+
51+
* `name` - (Required) The name of the field to filter by. See the [Filterable Fields section](#filterable-fields) for a complete list of filterable fields.
52+
53+
* `values` - (Required) A list of values for the filter to allow. These values should all be in string form.
54+
55+
* `match_by` - (Optional) The method to match the field by. (`exact`, `regex`, `substring`; default `exact`)
56+
57+
## Attributes Reference
58+
59+
Each Reserved IP type will be stored in the `types` attribute and will export the following attributes:
60+
61+
* `id` - The unique ID of this Reserved IP type (e.g. `reserved-ip`).
62+
63+
* `label` - The human-readable label for this Reserved IP type.
64+
65+
* `price.0.hourly` - Cost (in US dollars) per hour.
66+
67+
* `price.0.monthly` - Cost (in US dollars) per month.
68+
69+
* `region_prices.*.id` - The ID of the region this price entry applies to.
70+
71+
* `region_prices.*.hourly` - The hourly price for this Reserved IP type in the given region.
72+
73+
* `region_prices.*.monthly` - The monthly price for this Reserved IP type in the given region.
74+
75+
## Filterable Fields
76+
77+
* `label`

docs/data-sources/tag.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
page_title: "Linode: linode_tag"
3+
description: |-
4+
Provides details about a Linode Tag.
5+
---
6+
7+
# Data Source: linode\_tag
8+
9+
Provides information about a Linode Tag, including the objects associated with it.
10+
11+
For more information, see the [Linode APIv4 documentation](https://techdocs.akamai.com/linode-api/reference/get-tagged-objects).
12+
13+
## Example Usage
14+
15+
```hcl
16+
data "linode_tag" "example" {
17+
label = "my-tag"
18+
}
19+
```
20+
21+
## Argument Reference
22+
23+
* `label` - (Required) The label of the tag to look up.
24+
25+
## Attributes Reference
26+
27+
* `id` - The label of the tag.
28+
29+
* `objects` - A list of objects associated with this tag. Each object has the following attributes:
30+
31+
* `type` - The type of the tagged object (e.g. `linode`, `domain`, `volume`, `nodebalancer`, `reserved_ipv4_address`).
32+
33+
* `id` - The ID of the tagged object. For `reserved_ipv4_address` objects, this is the IP address string.

docs/resources/networking_ip.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The following arguments are supported:
3636

3737
The following arguments are only available when reserving an IP address:
3838

39-
* `reserved` - (Optional) Whether this IP address should be a reserved IP.
39+
* `reserved` - (Optional) Whether this IP address should be a reserved IP. Changing this value on an assigned IP triggers an in-place update (not replacement). Setting `reserved = true` converts an ephemeral IP to reserved. Setting `reserved = false` converts a reserved IP to ephemeral when the address is assigned. If the reserved IP is unassigned, the API deletes the IP as a side effect of setting `reserved = false`, and the provider returns an `IP Address Deleted During Update` error; after this occurs, remove the resource from your Terraform configuration so future applies succeed.
4040

4141
* `region` - (Optional) The region where the reserved IP should be allocated.
4242

@@ -56,6 +56,18 @@ In addition to all arguments above, the following attributes are exported:
5656

5757
* `subnet_mask` - The mask that separates host bits from network bits for this address.
5858

59+
* `tags` - A set of tags associated with this IP address.
60+
61+
* `assigned_entity` - The entity this IP address has been assigned to. This is null if the address is not assigned to an entity.
62+
63+
* `id` - The ID of the entity.
64+
65+
* `label` - The label of the entity.
66+
67+
* `type` - The type of the entity.
68+
69+
* `url` - The URL of the entity.
70+
5971
* `vpc_nat_1_1` - Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
6072

6173
* `address` - The IPv4 address that is configured as a 1:1 NAT for this VPC interface.

docs/resources/networking_ip_assignment.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ The following attributes can be defined under each entry in the `assignments` fi
4747

4848
* `id` - The unique ID of this resource.
4949

50+
* `assignments` - The list of IP/Linode assignments. In addition to the configurable arguments above, each entry exposes the following computed attributes after assignment:
51+
52+
* `reserved` - Whether this IP address is a reserved IP.
53+
54+
* `tags` - A set of tags associated with this IP address.
55+
56+
* `assigned_entity` - The entity this IP address has been assigned to.
57+
58+
* `id` - The ID of the entity.
59+
60+
* `label` - The label of the entity.
61+
62+
* `type` - The type of the entity.
63+
64+
* `url` - The URL of the entity.
65+
5066
## Import
5167

5268
Network IP assignments cannot be imported.

0 commit comments

Comments
 (0)