Terraform provider reference / resources / network_interface

fiberax_network_interface (Resource)

A network card of a server.

The card's network is a field of the card, not a separate resource: network_id for a private network of the project, or public = true to face the internet. One of the two is required, and together they are incompatible.

Cards the server is CREATED with are set by the networks field of the server itself; this resource describes cards added afterwards. The two cannot be mixed on one card: the server's field is not checked against reality and knows nothing about the cards of this resource.

Changes go through a restart of the server - the platform applies them to a stopped server.

Public addresses cost money, and after the card is removed they keep being billed. The details are in the description of the ips field.

Example Usage

# A private card: the server is attached to a network of the project.
resource "fiberax_network_interface" "internal" {
  server_id  = fiberax_server.app.id
  network_id = fiberax_network.backend.id
}

# A public card with an address you already hold.
#
# Keep the address as a SEPARATE resource instead of asking the card for a new one:
# then its release is part of the configuration and visible in the plan. Removing the card does NOT
# release the address - it returns to the project's pool and you keep paying for it.
resource "fiberax_ip" "web" {
  server_type_id = data.fiberax_server_type.cluster.id
}

resource "fiberax_network_interface" "external" {
  server_id = fiberax_server.app.id
  public    = true
  ips       = [fiberax_ip.web.id]
}

# A card disconnected without being removed: the settings are kept, no traffic flows.
resource "fiberax_network_interface" "spare" {
  server_id  = fiberax_server.app.id
  network_id = fiberax_network.backend.id
  link_down  = true
}

Schema

Required

Optional

The flag and the rules themselves live apart: the rules are in the fiberax_server_firewall resource, and this flag decides whether they apply to this card. Only a public card is filtered, so on a private one the flag means nothing.

If the server's firewall is described by the fiberax_server_firewall resource, that resource sets the flag - when it turns the firewall on, the platform marks the public cards that exist at that moment. Setting the same thing in two places means a tug of war: the two will keep overwriting each other on every run.

The other side of it: a card added AFTER the policy was applied does not get the mark and stays unfiltered. That is where this flag comes in handy - or apply the firewall policy again.

TAKING AN ADDRESS OFF THE CARD DOES NOT RELEASE IT. It returns to the project's pool and keeps being billed until it is released explicitly - removing the card and deleting the server behave the same way. Hold addresses with the fiberax_ip resource: then releasing them is in the configuration and visible in the plan.

A set, not a list: the order of addresses on a card means nothing.

The platform always brings a fresh card up, so when a disconnected card is created the provider applies this field with a second request - the same one that puts the addresses on.

Incompatible with public = true.

Turning a card public WITHOUT listing ips takes a new, billed address. To put an address you already pay for on the card, list it in ips.

Read-Only

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The import ID for a card is the server ID and the slot name, separated by a comma.
terraform import fiberax_network_interface.internal 10867,net1

Generated from the provider schema for version 0.3.0. How to install the provider: Terraform provider.