getEcsNetworkInterfaces

This data source provides the Ecs Network Interfaces of the current Alibaba Cloud user.

NOTE: Available since v1.123.1.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.ecs.getEcsNetworkInterfaces({
nameRegex: "eni-ipv6",
});
export const firstEcsNetworkInterfaceId = example.then(example => example.interfaces?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.get_ecs_network_interfaces(name_regex="eni-ipv6")
pulumi.export("firstEcsNetworkInterfaceId", example.interfaces[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Ecs.GetEcsNetworkInterfaces.Invoke(new()
{
NameRegex = "eni-ipv6",
});
return new Dictionary<string, object?>
{
["firstEcsNetworkInterfaceId"] = example&#46;Apply(getEcsNetworkInterfacesResult => getEcsNetworkInterfacesResult&#46;Interfaces[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ecs.GetEcsNetworkInterfaces(ctx, &ecs.GetEcsNetworkInterfacesArgs{
NameRegex: pulumi.StringRef("eni-ipv6"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstEcsNetworkInterfaceId", example.Interfaces[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetEcsNetworkInterfacesArgs;
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 = EcsFunctions.getEcsNetworkInterfaces(GetEcsNetworkInterfacesArgs.builder()
.nameRegex("eni-ipv6")
.build());
ctx.export("firstEcsNetworkInterfaceId", example.interfaces()[0].id());
}
}
variables:
example:
fn::invoke:
function: alicloud:ecs:getEcsNetworkInterfaces
arguments:
nameRegex: eni-ipv6
outputs:
firstEcsNetworkInterfaceId: ${example.interfaces[0].id}

Return

A collection of values returned by getEcsNetworkInterfaces.

Parameters

argument

A collection of arguments for invoking getEcsNetworkInterfaces.


suspend fun getEcsNetworkInterfaces(ids: List<String>? = null, instanceId: String? = null, name: String? = null, nameRegex: String? = null, networkInterfaceName: String? = null, outputFile: String? = null, primaryIpAddress: String? = null, privateIp: String? = null, resourceGroupId: String? = null, securityGroupId: String? = null, serviceManaged: Boolean? = null, status: String? = null, tags: Map<String, String>? = null, type: String? = null, vpcId: String? = null, vswitchId: String? = null): GetEcsNetworkInterfacesResult

Return

A collection of values returned by getEcsNetworkInterfaces.

Parameters

ids

A list of Network Interface IDs.

instanceId

The instance id.

name

Field name has been deprecated from provider version 1.123.1. New field network_interface_name instead

nameRegex

A regex string to filter results by Network Interface name.

networkInterfaceName

The network interface name.

outputFile

File name where to save data source results (after running pulumi preview).

primaryIpAddress

The primary private IP address of the ENI.

privateIp

Field private_ip has been deprecated from provider version 1.123.1. New field primary_ip_address instead

resourceGroupId

The resource group id.

securityGroupId

The security group id.

serviceManaged

Whether the user of the elastic network card is a cloud product or a virtual vendor.

status

The status of ENI. Valid Values: Attaching, Available, CreateFailed, Creating, Deleting, Detaching, InUse, Linked, Linking, Unlinking.

tags

A map of tags assigned to ENIs.

type

The type of ENI. Valid Values: Primary, Secondary.

vpcId

The vpc id.

vswitchId

The vswitch id.

See also


Return

A collection of values returned by getEcsNetworkInterfaces.

Parameters

argument

Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsNetworkInterfacesPlainArgs.

See also