ionoscloud.getNic
Explore with Pulumi AI
The Nic data source can be used to search for and return existing nics. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getNic({
datacenterId: "datancenter_id",
id: "nic_id",
serverId: "server_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_nic(datacenter_id="datancenter_id",
id="nic_id",
server_id="server_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupNic(ctx, &ionoscloud.LookupNicArgs{
DatacenterId: "datancenter_id",
Id: pulumi.StringRef("nic_id"),
ServerId: "server_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetNic.Invoke(new()
{
DatacenterId = "datancenter_id",
Id = "nic_id",
ServerId = "server_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetNicArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = IonoscloudFunctions.getNic(GetNicArgs.builder()
.datacenterId("datancenter_id")
.id("nic_id")
.serverId("server_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNic
arguments:
datacenterId: datancenter_id
id: nic_id
serverId: server_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getNic({
datacenterId: "datancenter_id",
name: "Nic Example",
serverId: "server_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_nic(datacenter_id="datancenter_id",
name="Nic Example",
server_id="server_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupNic(ctx, &ionoscloud.LookupNicArgs{
DatacenterId: "datancenter_id",
Name: pulumi.StringRef("Nic Example"),
ServerId: "server_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetNic.Invoke(new()
{
DatacenterId = "datancenter_id",
Name = "Nic Example",
ServerId = "server_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetNicArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = IonoscloudFunctions.getNic(GetNicArgs.builder()
.datacenterId("datancenter_id")
.name("Nic Example")
.serverId("server_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNic
arguments:
datacenterId: datancenter_id
name: Nic Example
serverId: server_id
Using getNic
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNic(args: GetNicArgs, opts?: InvokeOptions): Promise<GetNicResult>
function getNicOutput(args: GetNicOutputArgs, opts?: InvokeOptions): Output<GetNicResult>
def get_nic(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
server_id: Optional[str] = None,
timeouts: Optional[GetNicTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetNicResult
def get_nic_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
server_id: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetNicTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNicResult]
func LookupNic(ctx *Context, args *LookupNicArgs, opts ...InvokeOption) (*LookupNicResult, error)
func LookupNicOutput(ctx *Context, args *LookupNicOutputArgs, opts ...InvokeOption) LookupNicResultOutput
> Note: This function is named LookupNic
in the Go SDK.
public static class GetNic
{
public static Task<GetNicResult> InvokeAsync(GetNicArgs args, InvokeOptions? opts = null)
public static Output<GetNicResult> Invoke(GetNicInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNicResult> getNic(GetNicArgs args, InvokeOptions options)
public static Output<GetNicResult> getNic(GetNicArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getNic:getNic
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Server
Id string - [string] The ID of a server.
- Id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- Name string
- [string] The name of the LAN.
- Timeouts
Get
Nic Timeouts
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Server
Id string - [string] The ID of a server.
- Id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- Name string
- [string] The name of the LAN.
- Timeouts
Get
Nic Timeouts
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- server
Id String - [string] The ID of a server.
- id String
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name String
- [string] The name of the LAN.
- timeouts
Get
Nic Timeouts
- datacenter
Id string - [string] The ID of a Virtual Data Center.
- server
Id string - [string] The ID of a server.
- id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name string
- [string] The name of the LAN.
- timeouts
Get
Nic Timeouts
- datacenter_
id str - [string] The ID of a Virtual Data Center.
- server_
id str - [string] The ID of a server.
- id str
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name str
- [string] The name of the LAN.
- timeouts
Get
Nic Timeouts
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- server
Id String - [string] The ID of a server.
- id String
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name String
- [string] The name of the LAN.
- timeouts Property Map
getNic Result
The following output properties are available:
- Datacenter
Id string - The ID of a Virtual Data Center.
- Device
Number double - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- Dhcp bool
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- Dhcpv6 bool
- Firewall
Active bool - 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.
- Firewall
Type string - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- Flowlogs
List<Get
Nic Flowlog> - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- Id string
- The id of the NIC.
- Ips List<string>
- 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.
- Ipv6Cidr
Block string - Ipv6Ips List<string>
- Lan double
- The LAN ID the NIC will sit on.
- Mac string
- The MAC address of the NIC.
- Name string
- Specifies the name of the flow log.
- Pci
Slot double - The PCI slot number of the Nic.
- Security
Groups List<string>Ids - The list of Security Group IDs for the resource.
- Server
Id string - The ID of a server.
- Timeouts
Get
Nic Timeouts
- Datacenter
Id string - The ID of a Virtual Data Center.
- Device
Number float64 - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- Dhcp bool
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- Dhcpv6 bool
- Firewall
Active bool - 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.
- Firewall
Type string - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- Flowlogs
[]Get
Nic Flowlog - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- Id string
- The id of the NIC.
- Ips []string
- 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.
- Ipv6Cidr
Block string - Ipv6Ips []string
- Lan float64
- The LAN ID the NIC will sit on.
- Mac string
- The MAC address of the NIC.
- Name string
- Specifies the name of the flow log.
- Pci
Slot float64 - The PCI slot number of the Nic.
- Security
Groups []stringIds - The list of Security Group IDs for the resource.
- Server
Id string - The ID of a server.
- Timeouts
Get
Nic Timeouts
- datacenter
Id String - The ID of a Virtual Data Center.
- device
Number Double - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- dhcp Boolean
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- dhcpv6 Boolean
- firewall
Active 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.
- firewall
Type String - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- flowlogs
List<Get
Nic Flowlog> - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id String
- The id of the NIC.
- ips List<String>
- 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.
- ipv6Cidr
Block String - ipv6Ips List<String>
- lan Double
- The LAN ID the NIC will sit on.
- mac String
- The MAC address of the NIC.
- name String
- Specifies the name of the flow log.
- pci
Slot Double - The PCI slot number of the Nic.
- security
Groups List<String>Ids - The list of Security Group IDs for the resource.
- server
Id String - The ID of a server.
- timeouts
Get
Nic Timeouts
- datacenter
Id string - The ID of a Virtual Data Center.
- device
Number number - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- dhcp boolean
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- dhcpv6 boolean
- firewall
Active 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.
- firewall
Type string - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- flowlogs
Get
Nic Flowlog[] - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id string
- The id of the NIC.
- ips string[]
- 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.
- ipv6Cidr
Block string - ipv6Ips string[]
- lan number
- The LAN ID the NIC will sit on.
- mac string
- The MAC address of the NIC.
- name string
- Specifies the name of the flow log.
- pci
Slot number - The PCI slot number of the Nic.
- security
Groups string[]Ids - The list of Security Group IDs for the resource.
- server
Id string - The ID of a server.
- timeouts
Get
Nic Timeouts
- datacenter_
id str - The ID of a Virtual Data Center.
- device_
number float - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- dhcp bool
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- dhcpv6 bool
- firewall_
active bool - 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.
- firewall_
type str - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- flowlogs
Sequence[Get
Nic Flowlog] - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id str
- The id of the NIC.
- ips Sequence[str]
- 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.
- ipv6_
cidr_ strblock - ipv6_
ips Sequence[str] - lan float
- The LAN ID the NIC will sit on.
- mac str
- The MAC address of the NIC.
- name str
- Specifies the name of the flow log.
- pci_
slot float - The PCI slot number of the Nic.
- security_
groups_ Sequence[str]ids - The list of Security Group IDs for the resource.
- server_
id str - The ID of a server.
- timeouts
Get
Nic Timeouts
- datacenter
Id String - The ID of a Virtual Data Center.
- device
Number Number - The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created from CloudAPI and no DCD changes were done on the Datacenter.
- dhcp Boolean
- Indicates if the NIC should get an IP address using DHCP (true) or not (false).
- dhcpv6 Boolean
- firewall
Active 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.
- firewall
Type String - The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the default value INGRESS
- flowlogs List<Property Map>
- Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id String
- The id of the NIC.
- ips List<String>
- 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.
- ipv6Cidr
Block String - ipv6Ips List<String>
- lan Number
- The LAN ID the NIC will sit on.
- mac String
- The MAC address of the NIC.
- name String
- Specifies the name of the flow log.
- pci
Slot Number - The PCI slot number of the Nic.
- security
Groups List<String>Ids - The list of Security Group IDs for the resource.
- server
Id String - The ID of a server.
- timeouts Property Map
Supporting Types
GetNicFlowlog
- Action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- Bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- Direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- Id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- Name string
- [string] The name of the LAN.
- Action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- Bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- Direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- Id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- Name string
- [string] The name of the LAN.
- action String
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- bucket String
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- direction String
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- id String
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name String
- [string] The name of the LAN.
- action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- id string
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name string
- [string] The name of the LAN.
- action str
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- bucket str
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- direction str
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- id str
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name str
- [string] The name of the LAN.
- action String
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL.
- bucket String
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist.
- direction String
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL.
- id String
ID of the nic you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, are provided, the datasource will return an error.- name String
- [string] The name of the LAN.
GetNicTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.