Skip to content

Commit 892def6

Browse files
WIP conflict resolution
1 parent 2e58072 commit 892def6

20 files changed

+807
-12
lines changed

docs/data-sources/vpc_subnet.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ In addition to all arguments above, the following attributes are exported:
4040

4141
* `ipv4` - The IPv4 range of this subnet in CIDR format.
4242

43+
* [`ipv6`](#ipv6) - A list of IPv6 ranges under this subnet.
44+
4345
* `linodes` - A list of Linode that added to this subnet.
46+
4447
* `id` - ID of the Linode
48+
4549
* `interfaces` - A list of networking interfaces objects.
50+
4651
* `id` - ID of the interface.
52+
4753
* `config_id` - ID of Linode Config that the interface is associated with. `null` for a Linode Interface.
48-
* `active` - Whether the Interface is actively in use.
4954

50-
* [`ipv6`](#ipv6) - A list of IPv6 ranges under this subnet.
55+
* `active` - Whether the Interface is actively in use.
5156

5257
* `created` - The date and time when the VPC Subnet was created.
5358

docs/data-sources/vpc_subnets.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,19 @@ Each Linode VPC subnet will be stored in the `vpc_subnets` attribute and will ex
5353

5454
* `ipv4` - The IPv4 range of this subnet in CIDR format.
5555

56+
* [`ipv6`](#ipv6) - A list of IPv6 ranges under this subnet.
57+
5658
* `linodes` - A list of Linode that added to this subnet.
59+
5760
* `id` - ID of the Linode
61+
5862
* `interfaces` - A list of networking interfaces objects.
63+
5964
* `id` - ID of the interface.
65+
6066
* `config_id` - ID of Linode Config that the interface is associated with. `null` for a Linode Interface.
61-
* `active` - Whether the Interface is actively in use.
6267

63-
* [`ipv6`](#ipv6) - A list of IPv6 ranges under this subnet.
68+
* `active` - Whether the Interface is actively in use.
6469

6570
* `created` - The date and time when the VPC Subnet was created.
6671

docs/resources/interface.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,38 @@ resource "linode_interface" "vpc" {
9393
}
9494
```
9595

96+
<<<<<<< Updated upstream
97+
=======
98+
### VPC (IPv6) Interface Example
99+
100+
The following example shows how to create a public VPC interface with a custom IPv6 configuration.
101+
102+
```hcl
103+
resource "linode_interface" "vpc" {
104+
linode_id = linode_instance.my-instance.id
105+
106+
vpc = {
107+
subnet_id = 12345
108+
is_public = true
109+
110+
ipv6 = {
111+
slaac = [
112+
{
113+
range = "auto"
114+
}
115+
]
116+
117+
ranges = [
118+
{
119+
range = "auto"
120+
}
121+
]
122+
}
123+
}
124+
}
125+
```
126+
127+
>>>>>>> Stashed changes
96128
### VLAN Interface Example
97129

98130
The following example shows how to create a VLAN interface.
@@ -108,6 +140,7 @@ resource "linode_interface" "vlan" {
108140
}
109141
```
110142

143+
<<<<<<< Updated upstream
111144
### Complete Example with Linode
112145

113146
```hcl
@@ -166,12 +199,15 @@ resource "linode_interface" "public" {
166199
}
167200
```
168201

202+
=======
203+
>>>>>>> Stashed changes
169204
## Argument Reference
170205

171206
The following arguments are supported:
172207

173208
* `linode_id` - (Required) The ID of the Linode to assign this interface to.
174209

210+
<<<<<<< Updated upstream
175211
* `firewall_id` - (Optional) The ID of an enabled firewall to secure a VPC or public interface. Not allowed for VLAN interfaces.
176212

177213
* `default_route` - (Optional) Indicates whether the interface serves as the default route when multiple interfaces are eligible for this role.
@@ -183,24 +219,47 @@ The following arguments are supported:
183219
* `public` - (Optional) Configuration for a Linode public interface. Exactly one of `public`, `vlan`, or `vpc` must be specified.
184220

185221
* `ipv4` - (Optional) IPv4 configuration for this interface.
222+
=======
223+
* `firewall_id` - (Optional) ID of an enabled firewall to secure a VPC or public interface. Not allowed for VLAN interfaces.
224+
225+
* `default_route` - (Optional) Indicates if the interface serves as the default route when multiple interfaces are eligible for this role.
226+
227+
* `ipv4` - (Optional) If set to true, the interface is used for the IPv4 default route.
228+
229+
* `ipv6` - (Optional) If set to true, the interface is used for the IPv6 default route.
230+
231+
* `public` - (Optional) Nested attributes object for a Linode public interface. Exactly one of `public`, `vlan`, or `vpc` must be specified.
232+
233+
* `ipv4` - (Optional) IPv4 addresses for this interface.
234+
>>>>>>> Stashed changes
186235
187236
* `addresses` - (Optional) IPv4 addresses configured for this Linode interface. Each object in this list supports:
188237

189238
* `address` - (Optional) The IPv4 address. Defaults to "auto" for automatic assignment.
190239

191240
* `primary` - (Optional) Whether this address is the primary address for the interface.
192241

242+
<<<<<<< Updated upstream
193243
* `ipv6` - (Optional) IPv6 configuration for this interface.
194244

195245
* `ranges` - (Optional) IPv6 ranges in CIDR notation (2600:0db8::1/64) or prefix-only (/64). Each object in this list supports:
246+
=======
247+
* `ipv6` - (Optional) IPv6 addresses for this interface.
248+
249+
* `ranges` - (Optional) Configured IPv6 range in CIDR notation (2600:0db8::1/64) or prefix-only (/64). Each object in this list supports:
250+
>>>>>>> Stashed changes
196251
197252
* `range` - (Required) The IPv6 range.
198253

199254
* `route_target` - (Optional) The public IPv6 address that the range is routed to.
200255

201256
* `vlan` - (Optional) Nested attributes object for a Linode VLAN interface. Exactly one of `public`, `vlan`, or `vpc` must be specified.
202257

258+
<<<<<<< Updated upstream
203259
* `ipam_address` - (Optional) The VLAN interface's private IPv4 address in CIDR notation.
260+
=======
261+
* `ipam_address` - (Optional) This VLAN interface's private IPv4 address in classless inter-domain routing (CIDR) notation.
262+
>>>>>>> Stashed changes
204263
205264
* `vlan_label` - (Required) The VLAN's unique label. Must be between 1 and 64 characters.
206265

@@ -218,10 +277,29 @@ The following arguments are supported:
218277

219278
* `nat_1_1_address` - (Optional) The 1:1 NAT IPv4 address used to associate a public IPv4 address with the interface's VPC subnet IPv4 address.
220279

280+
<<<<<<< Updated upstream
221281
* `ranges` - (Optional) IPv4 ranges in CIDR notation (1.2.3.4/24) or prefix-only format (/24). Each object in this list supports:
222282

223283
* `range` - (Required) The IPv4 range.
224284

285+
=======
286+
* `ranges` - (Optional) CIDR notation of a range (1.2.3.4/24) or prefix only (/24). Each object in this list supports:
287+
288+
* `range` - (Required) The IPv4 range.
289+
290+
* `ipv6` - (Optional) IPv6 assigned through `slaac` and `ranges`. If you create a VPC interface in a subnet with IPv6 and don’t specify `slaac` or `ranges`, a SLAAC range is added automatically. **NOTE: IPv6 VPCs may not currently be available to all users.**
291+
292+
* `is_public` - (Optional) Indicates whether the IPv6 configuration profile interface is public. (Default `false`)
293+
294+
* `slaac` - (Optional) Defines IPv6 SLAAC address ranges. An address is automatically generated from the assigned /64 prefix using the Linode’s MAC address, just like on public IPv6 interfaces. Router advertisements (RA) are sent to the Linode, so standard SLAAC configuration works without any changes.
295+
296+
* `range` - (Optional) The IPv6 network range in CIDR notation.
297+
298+
* `ranges` - (Optional) Defines additional IPv6 network ranges.
299+
300+
* `range` - (Optional) The IPv6 network range in CIDR notation.
301+
302+
>>>>>>> Stashed changes
225303
## Attributes Reference
226304

227305
In addition to all arguments above, the following attributes are exported:
@@ -232,13 +310,21 @@ In addition to all arguments above, the following attributes are exported:
232310

233311
* `ipv4` - IPv4 configuration for the public interface:
234312

313+
<<<<<<< Updated upstream
235314
* `assigned_addresses` - (Computed) The IPv4 addresses exclusively assigned to this Linode interface. Each object in this set supports:
315+
=======
316+
* `assigned_addresses` - (Computed) The IPv4 address exclusively assigned to this Linode interface. Each object in this set supports:
317+
>>>>>>> Stashed changes
236318
237319
* `address` - The assigned IPv4 address.
238320

239321
* `primary` - Whether this address is the primary address for the interface.
240322

323+
<<<<<<< Updated upstream
241324
* `shared` - (Computed) The IPv4 addresses assigned to this Linode interface that are also shared with another Linode. Each object in this set supports:
325+
=======
326+
* `shared` - (Computed) The IPv4 address assigned to this Linode interface, which is also shared with another Linode. Each object in this set supports:
327+
>>>>>>> Stashed changes
242328
243329
* `address` - The shared IPv4 address.
244330

@@ -252,7 +338,11 @@ In addition to all arguments above, the following attributes are exported:
252338

253339
* `route_target` - The public IPv6 address that the range is routed to.
254340

341+
<<<<<<< Updated upstream
255342
* `shared` - (Computed) The IPv6 ranges assigned to this Linode interface that are also shared with another Linode. Each object in this set supports:
343+
=======
344+
* `shared` - (Computed) The IPv6 address assigned to this Linode interface, which is also shared with another Linode. Each object in this set supports:
345+
>>>>>>> Stashed changes
256346
257347
* `range` - The shared IPv6 range.
258348

@@ -268,14 +358,19 @@ In addition to all arguments above, the following attributes are exported:
268358

269359
* `ipv4` - IPv4 configuration for the VPC interface:
270360

361+
<<<<<<< Updated upstream
271362
* `assigned_addresses` - (Computed) The IPv4 addresses assigned for use in the VPC subnet, calculated from the `addresses` input. Each object in this set supports:
363+
=======
364+
* `assigned_addresses` - (Computed) Assigned IPv4 addresses to use in the VPC subnet, calculated from `addresses` input. Each object in this set supports:
365+
>>>>>>> Stashed changes
272366
273367
* `address` - The assigned IPv4 address.
274368

275369
* `primary` - Whether this address is the primary address for the interface.
276370

277371
* `nat_1_1_address` - The assigned 1:1 NAT IPv4 address used to associate a public IPv4 address with the interface's VPC subnet IPv4 address.
278372

373+
<<<<<<< Updated upstream
279374
* `assigned_ranges` - (Computed) The IPv4 ranges assigned for use in the VPC subnet, calculated from the `ranges` input. Each object in this set supports:
280375

281376
* `range` - The assigned IPv4 range.
@@ -286,12 +381,39 @@ Interfaces can be imported using a Linode ID followed by an Interface ID, separa
286381

287382
```sh
288383
terraform import linode_interface.example 67890,12345
384+
=======
385+
* `assigned_ranges` - (Computed) Assigned IPv4 ranges to use in the VPC subnet, calculated from `ranges` input. Each object in this set supports:
386+
387+
* `range` - The assigned IPv4 range.
388+
389+
* `ipv6` - IPv6 assigned through `slaac` and `ranges`. **NOTE: IPv6 VPCs may not currently be available to all users.**
390+
391+
* `assigned_slaac` - Assigned IPv6 SLAAC address ranges to use in the VPC subnet, calculated from `slaac` input.
392+
393+
* `range` - The IPv6 network range in CIDR notation.
394+
395+
* `assigned_ranges` - Assigned additional IPv6 ranges to use in the VPC subnet, calculated from `ranges` input.
396+
397+
* `range` - The IPv6 network range in CIDR notation.
398+
399+
## Import
400+
401+
Interfaces can be imported using an Interface ID followed by a Linode ID, separated by a comma, e.g.
402+
403+
```sh
404+
terraform import linode_interface.example 12345,67890
405+
>>>>>>> Stashed changes
289406
```
290407

291408
## Notes
292409

293410
* Each Linode instance can have up to 3 network interfaces.
294411
* VLAN interfaces cannot be updated after creation and require recreation.
295412
* VPC subnet IDs cannot be changed after interface creation.
413+
<<<<<<< Updated upstream
296414
* Firewall IDs are only supported for public and VPC interfaces, not for VLAN interfaces.
297415
* When configuring multiple interfaces, use the `default_route` setting to specify which interface should handle default routing.
416+
=======
417+
* Firewall IDs are only supported for public and VPC interfaces, not VLAN interfaces.
418+
* When configuring multiple interfaces, use `default_route` to specify which interface should handle default routing.
419+
>>>>>>> Stashed changes

linode/helper/framework_schema.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ func EmptySetDefault(elemType attr.Type) defaults.Set {
2727
)
2828
}
2929

30+
func EmptyListDefault(elemType attr.Type) defaults.List {
31+
return listdefault.StaticValue(
32+
types.ListValueMust(
33+
elemType,
34+
[]attr.Value{},
35+
),
36+
)
37+
}
38+
3039
func EmptyMapDefault(elemType attr.Type) defaults.Map {
3140
return mapdefault.StaticValue(
3241
types.MapValueMust(

linode/linodeinterface/framework_models.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ func (data *LinodeInterfaceModel) FlattenInterface(
205205
vpc.IPv4 = helper.KeepOrUpdateValue(
206206
vpc.IPv4, types.ObjectNull(vpcIPv4Attribute.GetType().(types.ObjectType).AttrTypes), pk,
207207
)
208+
vpc.IPv6 = helper.KeepOrUpdateValue(
209+
vpc.IPv6, types.ObjectNull(vpcIPv6Attribute.GetType().(types.ObjectType).AttrTypes), pk,
210+
)
208211
vpc.SubnetID = helper.KeepOrUpdateValue(vpc.SubnetID, types.Int64Null(), pk)
209212
return
210213
}

linode/linodeinterface/framework_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (r *Resource) ImportState(
242242

243243
func populateLogAttributes(ctx context.Context, model LinodeInterfaceModel) context.Context {
244244
return helper.SetLogFieldBulk(ctx, map[string]any{
245-
"linode_id": model.LinodeID.ValueInt64(),
246245
"id": model.ID.ValueString(),
246+
"linode_id": model.LinodeID.ValueInt64(),
247247
})
248248
}

0 commit comments

Comments
 (0)