get Ecs Network Interfaces
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.Apply(getEcsNetworkInterfacesResult => getEcsNetworkInterfacesResult.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
A collection of arguments for invoking getEcsNetworkInterfaces.
Return
A collection of values returned by getEcsNetworkInterfaces.
Parameters
A list of Network Interface IDs.
The instance id.
Field name
has been deprecated from provider version 1.123.1. New field network_interface_name
instead
A regex string to filter results by Network Interface name.
The network interface name.
File name where to save data source results (after running pulumi preview
).
The primary private IP address of the ENI.
Field private_ip
has been deprecated from provider version 1.123.1. New field primary_ip_address
instead
The resource group id.
The security group id.
Whether the user of the elastic network card is a cloud product or a virtual vendor.
The status of ENI. Valid Values: Attaching
, Available
, CreateFailed
, Creating
, Deleting
, Detaching
, InUse
, Linked
, Linking
, Unlinking
.
A map of tags assigned to ENIs.
The type of ENI. Valid Values: Primary
, Secondary
.
The vpc id.
The vswitch id.
See also
Return
A collection of values returned by getEcsNetworkInterfaces.
Parameters
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsNetworkInterfacesPlainArgs.