EcsNetworkInterfaceArgs

data class EcsNetworkInterfaceArgs(val description: Output<String>? = null, val ipv6AddressCount: Output<Int>? = null, val ipv6Addresses: Output<List<String>>? = null, val name: Output<String>? = null, val networkInterfaceName: Output<String>? = null, val primaryIpAddress: Output<String>? = null, val privateIp: Output<String>? = null, val privateIpAddresses: Output<List<String>>? = null, val privateIps: Output<List<String>>? = null, val privateIpsCount: Output<Int>? = null, val queueNumber: Output<Int>? = null, val resourceGroupId: Output<String>? = null, val secondaryPrivateIpAddressCount: Output<Int>? = null, val securityGroupIds: Output<List<String>>? = null, val securityGroups: Output<List<String>>? = null, val tags: Output<Map<String, Any>>? = null, val vswitchId: Output<String>? = null) : ConvertibleToJava<EcsNetworkInterfaceArgs>

Provides a ECS Network Interface resource. For information about ECS Network Interface and how to use it, see What is Network Interface.

NOTE: Available in v1.123.1+. NOTE Only one of private_ip_addresses or secondary_private_ip_address_count can be specified when assign private IPs.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.ecs.EcsNetworkInterface;
import com.pulumi.alicloud.ecs.EcsNetworkInterfaceArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-testAcc");
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("192.168.0.0/24")
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("192.168.0.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vpcId(defaultNetwork.id())
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
final var defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.status("OK")
.build());
var defaultEcsNetworkInterface = new EcsNetworkInterface("defaultEcsNetworkInterface", EcsNetworkInterfaceArgs.builder()
.networkInterfaceName(name)
.vswitchId(defaultSwitch.id())
.securityGroupIds(defaultSecurityGroup.id())
.description("Basic test")
.primaryIpAddress("192.168.0.2")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "Test")
))
.resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.ids()[0]))
.build());
}
}

Import

ECS Network Interface can be imported using the id, e.g.

$ pulumi import alicloud:ecs/ecsNetworkInterface:EcsNetworkInterface example eni-abcd12345

Constructors

Link copied to clipboard
fun EcsNetworkInterfaceArgs(description: Output<String>? = null, ipv6AddressCount: Output<Int>? = null, ipv6Addresses: Output<List<String>>? = null, name: Output<String>? = null, networkInterfaceName: Output<String>? = null, primaryIpAddress: Output<String>? = null, privateIp: Output<String>? = null, privateIpAddresses: Output<List<String>>? = null, privateIps: Output<List<String>>? = null, privateIpsCount: Output<Int>? = null, queueNumber: Output<Int>? = null, resourceGroupId: Output<String>? = null, secondaryPrivateIpAddressCount: Output<Int>? = null, securityGroupIds: Output<List<String>>? = null, securityGroups: Output<List<String>>? = null, tags: Output<Map<String, Any>>? = null, vswitchId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): EcsNetworkInterfaceArgs

Properties

Link copied to clipboard
val description: Output<String>? = null

The description of the ENI. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Link copied to clipboard
val ipv6AddressCount: Output<Int>? = null

The number of IPv6 addresses to randomly generate for the primary ENI. Valid values: 1 to 10. NOTE: You cannot specify both the ipv6_addresses and ipv6_address_count parameters.

Link copied to clipboard
val ipv6Addresses: Output<List<String>>? = null

A list of IPv6 address to be assigned to the primary ENI. Support up to 10.

Link copied to clipboard
val name: Output<String>? = null

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

Link copied to clipboard
val networkInterfaceName: Output<String>? = null

The name of the ENI. The name must be 2 to 128 characters in length, and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.

Link copied to clipboard
val primaryIpAddress: Output<String>? = null

The primary private IP address of the ENI. The specified IP address must be available within the CIDR block of the VSwitch. If this parameter is not specified, an available IP address is assigned from the VSwitch CIDR block at random.

Link copied to clipboard
val privateIp: Output<String>? = null

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

Link copied to clipboard
val privateIpAddresses: Output<List<String>>? = null

Specifies secondary private IP address N of the ENI. This IP address must be an available IP address within the CIDR block of the VSwitch to which the ENI belongs.

Link copied to clipboard
val privateIps: Output<List<String>>? = null

Field private_ips has been deprecated from provider version 1.123.1. New field private_ip_addresses instead

Link copied to clipboard
val privateIpsCount: Output<Int>? = null

Field private_ips_count has been deprecated from provider version 1.123.1. New field secondary_private_ip_address_count instead

Link copied to clipboard
val queueNumber: Output<Int>? = null

The queue number of the ENI.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The resource group id.

Link copied to clipboard
val secondaryPrivateIpAddressCount: Output<Int>? = null

The number of private IP addresses that can be automatically created by ECS.

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

The ID of security group N. The security groups and the ENI must belong to the same VPC. The valid values of N are based on the maximum number of security groups to which an ENI can be added.

Link copied to clipboard
val securityGroups: Output<List<String>>? = null

Field security_groups has been deprecated from provider version 1.123.1. New field security_group_ids instead

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val vswitchId: Output<String>? = null

The ID of the VSwitch in the specified VPC. The private IP addresses assigned to the ENI must be available IP addresses within the CIDR block of the VSwitch.