From 6dd7988cf2928f3dcdcabce6d9690741a43137ee Mon Sep 17 00:00:00 2001 From: Ionut Balutoiu Date: Tue, 4 May 2021 14:19:23 +0300 Subject: [PATCH] Document maas_network_interface_link resource --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 57a12a02..d725d81f 100644 --- a/README.md +++ b/README.md @@ -263,3 +263,31 @@ Parameters: | ---- | ---- | -------- | ----------- | `name` | `string` | `true` | The new tag name. Because the name will be used in urls, it should be short. | `machine_ids` | `[]string` | `false` | List of MAAS machines' ids that will be tagged. + +### `maas_network_interface_link` + +Configures a machine network interface with an IP address from a given subnet. + +Example: + +```hcl +resource "maas_network_interface_link" "virsh_vm1_nic1" { + machine_id = maas_machine.virsh_vm1.id + network_interface_id = maas_network_interface_physical.virsh_vm1_nic1.id + subnet_id = data.maas_subnet.pxe.id + mode = "STATIC" + ip_address = "10.121.10.29" + default_gateway = true +} +``` + +Parameters: + +| Name | Type | Required | Description +| ---- | ---- | -------- | ----------- +| `machine_id` | `string` | `true` | Machine system id. +| `network_interface_id` | `int` | `true` | Network interface id. +| `subnet_id` | `int` | `true` | Subnet id. +| `mode` | `string` | `false` | Connection mode to subnet. It defaults to `AUTO`. Valid options are: `AUTO` (random static IP address from the subnet), `DHCP` (DHCP on the given subnet), `STATIC` (use `ip_address` as static IP address). +| `ip_address` | `string` | `false` | IP address for the interface in the given subnet. Only used when `mode` is `STATIC`. +| `default_gateway` | `bool` | `false` | When enabled, it sets the subnet gateway IP address as the default gateway for the machine this interface belongs to. This option can only be used with the `AUTO` and `STATIC` modes.