1. Packages
  2. Scaleway
  3. API Docs
  4. getInstancePrivateNic
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

scaleway.getInstancePrivateNic

Explore with Pulumi AI

scaleway logo
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 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.getInstancePrivateNic({
        privateNicId: "11111111-1111-1111-1111-111111111111",
        serverId: "11111111-1111-1111-1111-111111111111",
    });
    const byPnId = scaleway.getInstancePrivateNic({
        privateNetworkId: "11111111-1111-1111-1111-111111111111",
        serverId: "11111111-1111-1111-1111-111111111111",
    });
    const byTags = scaleway.getInstancePrivateNic({
        serverId: "11111111-1111-1111-1111-111111111111",
        tags: ["mytag"],
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    by_nic_id = scaleway.get_instance_private_nic(private_nic_id="11111111-1111-1111-1111-111111111111",
        server_id="11111111-1111-1111-1111-111111111111")
    by_pn_id = scaleway.get_instance_private_nic(private_network_id="11111111-1111-1111-1111-111111111111",
        server_id="11111111-1111-1111-1111-111111111111")
    by_tags = scaleway.get_instance_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"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.LookupInstancePrivateNic(ctx, &scaleway.LookupInstancePrivateNicArgs{
    			PrivateNicId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    			ServerId:     "11111111-1111-1111-1111-111111111111",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupInstancePrivateNic(ctx, &scaleway.LookupInstancePrivateNicArgs{
    			PrivateNetworkId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    			ServerId:         "11111111-1111-1111-1111-111111111111",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupInstancePrivateNic(ctx, &scaleway.LookupInstancePrivateNicArgs{
    			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.GetInstancePrivateNic.Invoke(new()
        {
            PrivateNicId = "11111111-1111-1111-1111-111111111111",
            ServerId = "11111111-1111-1111-1111-111111111111",
        });
    
        var byPnId = Scaleway.GetInstancePrivateNic.Invoke(new()
        {
            PrivateNetworkId = "11111111-1111-1111-1111-111111111111",
            ServerId = "11111111-1111-1111-1111-111111111111",
        });
    
        var byTags = Scaleway.GetInstancePrivateNic.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.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetInstancePrivateNicArgs;
    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 = ScalewayFunctions.getInstancePrivateNic(GetInstancePrivateNicArgs.builder()
                .privateNicId("11111111-1111-1111-1111-111111111111")
                .serverId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var byPnId = ScalewayFunctions.getInstancePrivateNic(GetInstancePrivateNicArgs.builder()
                .privateNetworkId("11111111-1111-1111-1111-111111111111")
                .serverId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var byTags = ScalewayFunctions.getInstancePrivateNic(GetInstancePrivateNicArgs.builder()
                .serverId("11111111-1111-1111-1111-111111111111")
                .tags("mytag")
                .build());
    
        }
    }
    
    variables:
      byNicId:
        fn::invoke:
          Function: scaleway:getInstancePrivateNic
          Arguments:
            privateNicId: 11111111-1111-1111-1111-111111111111
            serverId: 11111111-1111-1111-1111-111111111111
      byPnId:
        fn::invoke:
          Function: scaleway:getInstancePrivateNic
          Arguments:
            privateNetworkId: 11111111-1111-1111-1111-111111111111
            serverId: 11111111-1111-1111-1111-111111111111
      byTags:
        fn::invoke:
          Function: scaleway:getInstancePrivateNic
          Arguments:
            serverId: 11111111-1111-1111-1111-111111111111
            tags:
              - mytag
    

    Using getInstancePrivateNic

    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 getInstancePrivateNic(args: GetInstancePrivateNicArgs, opts?: InvokeOptions): Promise<GetInstancePrivateNicResult>
    function getInstancePrivateNicOutput(args: GetInstancePrivateNicOutputArgs, opts?: InvokeOptions): Output<GetInstancePrivateNicResult>
    def get_instance_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) -> GetInstancePrivateNicResult
    def get_instance_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[GetInstancePrivateNicResult]
    func LookupInstancePrivateNic(ctx *Context, args *LookupInstancePrivateNicArgs, opts ...InvokeOption) (*LookupInstancePrivateNicResult, error)
    func LookupInstancePrivateNicOutput(ctx *Context, args *LookupInstancePrivateNicOutputArgs, opts ...InvokeOption) LookupInstancePrivateNicResultOutput

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

    public static class GetInstancePrivateNic 
    {
        public static Task<GetInstancePrivateNicResult> InvokeAsync(GetInstancePrivateNicArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancePrivateNicResult> Invoke(GetInstancePrivateNicInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancePrivateNicResult> getInstancePrivateNic(GetInstancePrivateNicArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getInstancePrivateNic:getInstancePrivateNic
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ServerId 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 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 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 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 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 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.

    getInstancePrivateNic Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    IpIds 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
    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>
    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[]
    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]
    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>
    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 logo
    Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse