Nic
Creates and manages Network Interface objects.
Manages a NIC on IonosCloud.
Example Usage
Argument reference
datacenter_id
- (Required)[string] The ID of a Virtual Data Center.server_id
- (Required)[string] The ID of a server.lan
- (Required)[integer] The LAN ID the NIC will sit on.name
- (Optional)[string] The name of the LAN.dhcp
- (Optional)[Boolean] Indicates if the NIC should get an IP address using DHCP (true) or not (false).ips
- (Optional)[list] Collection of IP addresses assigned to a nic. Explicitly assigned public IPs need to come from reserved IP blocks, Passing value null or empty array will assign an IP address automatically.firewall_active
- (Optional)[Boolean] If this resource is set to true and is nested under a server resource firewall, with open SSH port, resource must be nested under the NIC.nat
- (Optional)[Boolean] Boolean value indicating if the private IP address has outbound access to the public internet.mac
- (Computed) The MAC address of the NIC.
Import
Resource Nic can be imported using the resource id
, e.g.
Working with load balancers
Please be aware that when using a nic in a load balancer, the load balancer will change the nic's ID behind the scenes, therefore the plan will always report this change trying to revert the state to the one specified by your terraform file. In order to prevent this, use the "lifecycle meta-argument" when declaring your nic, in order to ignore changes to the lan
attribute:
Here's an example:
Last updated