Ecs Network Interface Args
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
orsecondary_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());
}
}
Content copied to clipboard
Import
ECS Network Interface can be imported using the id, e.g.
$ pulumi import alicloud:ecs/ecsNetworkInterface:EcsNetworkInterface example eni-abcd12345
Content copied to clipboard
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
Properties
Link copied to clipboard
Link copied to clipboard