Scaleway v1.27.0 published on Monday, Apr 21, 2025 by pulumiverse
scaleway.instance.getPrivateNic
Explore with Pulumi AI
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"],
});
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"])
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
	})
}
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",
        },
    });
});
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());
    }
}
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
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>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]func LookupPrivateNic(ctx *Context, args *LookupPrivateNicArgs, opts ...InvokeOption) (*LookupPrivateNicResult, error)
func LookupPrivateNicOutput(ctx *Context, args *LookupPrivateNicOutputArgs, opts ...InvokeOption) LookupPrivateNicResultOutput> 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)
}public static CompletableFuture<GetPrivateNicResult> getPrivateNic(GetPrivateNicArgs args, InvokeOptions options)
public static Output<GetPrivateNicResult> getPrivateNic(GetPrivateNicArgs args, InvokeOptions options)
fn::invoke:
  function: scaleway:instance/getPrivateNic:getPrivateNic
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Server
Id string - The server's id
 - Private
Network stringId  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - Private
Nic stringId  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - 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.
- Server
Id string - The server's id
 - Private
Network stringId  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - Private
Nic stringId  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - []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 String - The server's id
 - private
Network StringId  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - private
Nic StringId  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - 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.
- server
Id string - The server's id
 - private
Network stringId  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - private
Nic stringId  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - 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 str - The server's id
 - private_
network_ strid  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - private_
nic_ strid  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - 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.
- server
Id String - The server's id
 - private
Network StringId  - The ID of the private network
Only one of 
private_nic_idandprivate_network_idshould be specified. - private
Nic StringId  - The ID of the instance server private nic
Only one of 
private_nic_idandprivate_network_idshould be specified. - 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.
 - Ip
Ids List<string> - Ipam
Ip List<string>Ids  - Mac
Address string - Server
Id string - Private
Network stringId  - Private
Nic stringId  - List<string>
 - Zone string
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Ip
Ids []string - Ipam
Ip []stringIds  - Mac
Address string - Server
Id string - Private
Network stringId  - Private
Nic stringId  - []string
 - Zone string
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ip
Ids List<String> - ipam
Ip List<String>Ids  - mac
Address String - server
Id String - private
Network StringId  - private
Nic StringId  - List<String>
 - zone String
 
- id string
 - The provider-assigned unique ID for this managed resource.
 - ip
Ids string[] - ipam
Ip string[]Ids  - mac
Address string - server
Id string - private
Network stringId  - private
Nic stringId  - string[]
 - zone string
 
- id str
 - The provider-assigned unique ID for this managed resource.
 - ip_
ids Sequence[str] - ipam_
ip_ Sequence[str]ids  - mac_
address str - server_
id str - private_
network_ strid  - private_
nic_ strid  - Sequence[str]
 - zone str
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ip
Ids List<String> - ipam
Ip List<String>Ids  - mac
Address String - server
Id String - private
Network StringId  - private
Nic StringId  - List<String>
 - zone String
 
Package Details
- Repository
 - scaleway pulumiverse/pulumi-scaleway
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
scalewayTerraform Provider.