1. Packages
  2. Scaleway
  3. API Docs
  4. instance
  5. getPrivateNic
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.instance.getPrivateNic

Explore with Pulumi AI

Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

Gets information about an instance private NIC.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";

const byNicId = scaleway.instance.getPrivateNic({
    serverId: "11111111-1111-1111-1111-111111111111",
    privateNicId: "11111111-1111-1111-1111-111111111111",
});
const byPnId = scaleway.instance.getPrivateNic({
    serverId: "11111111-1111-1111-1111-111111111111",
    privateNetworkId: "11111111-1111-1111-1111-111111111111",
});
const byTags = scaleway.instance.getPrivateNic({
    serverId: "11111111-1111-1111-1111-111111111111",
    tags: ["mytag"],
});
Copy
import pulumi
import pulumi_scaleway as scaleway

by_nic_id = scaleway.instance.get_private_nic(server_id="11111111-1111-1111-1111-111111111111",
    private_nic_id="11111111-1111-1111-1111-111111111111")
by_pn_id = scaleway.instance.get_private_nic(server_id="11111111-1111-1111-1111-111111111111",
    private_network_id="11111111-1111-1111-1111-111111111111")
by_tags = scaleway.instance.get_private_nic(server_id="11111111-1111-1111-1111-111111111111",
    tags=["mytag"])
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := instance.LookupPrivateNic(ctx, &instance.LookupPrivateNicArgs{
			ServerId:     "11111111-1111-1111-1111-111111111111",
			PrivateNicId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = instance.LookupPrivateNic(ctx, &instance.LookupPrivateNicArgs{
			ServerId:         "11111111-1111-1111-1111-111111111111",
			PrivateNetworkId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = instance.LookupPrivateNic(ctx, &instance.LookupPrivateNicArgs{
			ServerId: "11111111-1111-1111-1111-111111111111",
			Tags: []string{
				"mytag",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    var byNicId = Scaleway.Instance.GetPrivateNic.Invoke(new()
    {
        ServerId = "11111111-1111-1111-1111-111111111111",
        PrivateNicId = "11111111-1111-1111-1111-111111111111",
    });

    var byPnId = Scaleway.Instance.GetPrivateNic.Invoke(new()
    {
        ServerId = "11111111-1111-1111-1111-111111111111",
        PrivateNetworkId = "11111111-1111-1111-1111-111111111111",
    });

    var byTags = Scaleway.Instance.GetPrivateNic.Invoke(new()
    {
        ServerId = "11111111-1111-1111-1111-111111111111",
        Tags = new[]
        {
            "mytag",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.instance.InstanceFunctions;
import com.pulumi.scaleway.instance.inputs.GetPrivateNicArgs;
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 byNicId = InstanceFunctions.getPrivateNic(GetPrivateNicArgs.builder()
            .serverId("11111111-1111-1111-1111-111111111111")
            .privateNicId("11111111-1111-1111-1111-111111111111")
            .build());

        final var byPnId = InstanceFunctions.getPrivateNic(GetPrivateNicArgs.builder()
            .serverId("11111111-1111-1111-1111-111111111111")
            .privateNetworkId("11111111-1111-1111-1111-111111111111")
            .build());

        final var byTags = InstanceFunctions.getPrivateNic(GetPrivateNicArgs.builder()
            .serverId("11111111-1111-1111-1111-111111111111")
            .tags("mytag")
            .build());

    }
}
Copy
variables:
  byNicId:
    fn::invoke:
      function: scaleway:instance:getPrivateNic
      arguments:
        serverId: 11111111-1111-1111-1111-111111111111
        privateNicId: 11111111-1111-1111-1111-111111111111
  byPnId:
    fn::invoke:
      function: scaleway:instance:getPrivateNic
      arguments:
        serverId: 11111111-1111-1111-1111-111111111111
        privateNetworkId: 11111111-1111-1111-1111-111111111111
  byTags:
    fn::invoke:
      function: scaleway:instance:getPrivateNic
      arguments:
        serverId: 11111111-1111-1111-1111-111111111111
        tags:
          - mytag
Copy

Using getPrivateNic

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 getPrivateNic(args: GetPrivateNicArgs, opts?: InvokeOptions): Promise<GetPrivateNicResult>
function getPrivateNicOutput(args: GetPrivateNicOutputArgs, opts?: InvokeOptions): Output<GetPrivateNicResult>
Copy
def get_private_nic(private_network_id: Optional[str] = None,
                    private_nic_id: Optional[str] = None,
                    server_id: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None,
                    zone: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetPrivateNicResult
def get_private_nic_output(private_network_id: Optional[pulumi.Input[str]] = None,
                    private_nic_id: Optional[pulumi.Input[str]] = None,
                    server_id: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    zone: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetPrivateNicResult]
Copy
func LookupPrivateNic(ctx *Context, args *LookupPrivateNicArgs, opts ...InvokeOption) (*LookupPrivateNicResult, error)
func LookupPrivateNicOutput(ctx *Context, args *LookupPrivateNicOutputArgs, opts ...InvokeOption) LookupPrivateNicResultOutput
Copy

> Note: This function is named LookupPrivateNic in the Go SDK.

public static class GetPrivateNic 
{
    public static Task<GetPrivateNicResult> InvokeAsync(GetPrivateNicArgs args, InvokeOptions? opts = null)
    public static Output<GetPrivateNicResult> Invoke(GetPrivateNicInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPrivateNicResult> getPrivateNic(GetPrivateNicArgs args, InvokeOptions options)
public static Output<GetPrivateNicResult> getPrivateNic(GetPrivateNicArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: scaleway:instance/getPrivateNic:getPrivateNic
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ServerId This property is required. string
The server's id
PrivateNetworkId string
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
PrivateNicId string
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
Tags List<string>
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
Zone string
zone) The zone in which the private nic exists.
ServerId This property is required. string
The server's id
PrivateNetworkId string
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
PrivateNicId string
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
Tags []string
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
Zone string
zone) The zone in which the private nic exists.
serverId This property is required. String
The server's id
privateNetworkId String
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
privateNicId String
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
tags List<String>
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
zone String
zone) The zone in which the private nic exists.
serverId This property is required. string
The server's id
privateNetworkId string
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
privateNicId string
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
tags string[]
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
zone string
zone) The zone in which the private nic exists.
server_id This property is required. str
The server's id
private_network_id str
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
private_nic_id str
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
tags Sequence[str]
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
zone str
zone) The zone in which the private nic exists.
serverId This property is required. String
The server's id
privateNetworkId String
The ID of the private network Only one of private_nic_id and private_network_id should be specified.
privateNicId String
The ID of the instance server private nic Only one of private_nic_id and private_network_id should be specified.
tags List<String>
The tags associated with the private NIC. As datasource only returns one private NIC, the search with given tags must return only one result
zone String
zone) The zone in which the private nic exists.

getPrivateNic Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
IpIds List<string>
IpamIpIds List<string>
MacAddress string
ServerId string
PrivateNetworkId string
PrivateNicId string
Tags List<string>
Zone string
Id string
The provider-assigned unique ID for this managed resource.
IpIds []string
IpamIpIds []string
MacAddress string
ServerId string
PrivateNetworkId string
PrivateNicId string
Tags []string
Zone string
id String
The provider-assigned unique ID for this managed resource.
ipIds List<String>
ipamIpIds List<String>
macAddress String
serverId String
privateNetworkId String
privateNicId String
tags List<String>
zone String
id string
The provider-assigned unique ID for this managed resource.
ipIds string[]
ipamIpIds string[]
macAddress string
serverId string
privateNetworkId string
privateNicId string
tags string[]
zone string
id str
The provider-assigned unique ID for this managed resource.
ip_ids Sequence[str]
ipam_ip_ids Sequence[str]
mac_address str
server_id str
private_network_id str
private_nic_id str
tags Sequence[str]
zone str
id String
The provider-assigned unique ID for this managed resource.
ipIds List<String>
ipamIpIds List<String>
macAddress String
serverId String
privateNetworkId String
privateNicId String
tags List<String>
zone String

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse