NetworkInterfaceArgs

data class NetworkInterfaceArgs(val auxiliaryMode: Output<Either<String, NetworkInterfaceAuxiliaryMode>>? = null, val auxiliarySku: Output<Either<String, NetworkInterfaceAuxiliarySku>>? = null, val disableTcpStateTracking: Output<Boolean>? = null, val dnsSettings: Output<NetworkInterfaceDnsSettingsArgs>? = null, val enableAcceleratedNetworking: Output<Boolean>? = null, val enableIPForwarding: Output<Boolean>? = null, val extendedLocation: Output<ExtendedLocationArgs>? = null, val id: Output<String>? = null, val ipConfigurations: Output<List<NetworkInterfaceIPConfigurationArgs>>? = null, val location: Output<String>? = null, val migrationPhase: Output<Either<String, NetworkInterfaceMigrationPhase>>? = null, val networkInterfaceName: Output<String>? = null, val networkSecurityGroup: Output<NetworkSecurityGroupArgs>? = null, val nicType: Output<Either<String, NetworkInterfaceNicType>>? = null, val privateLinkService: Output<PrivateLinkServiceArgs>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val workloadType: Output<String>? = null) : ConvertibleToJava<NetworkInterfaceArgs>

A network interface in a resource group. Uses Azure REST API version 2024-05-01. In version 2.x of the Azure Native provider, it used API version 2023-02-01. Other available API versions: 2018-06-01, 2018-07-01, 2018-08-01, 2018-10-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2021-03-01, 2021-05-01, 2021-08-01, 2022-01-01, 2022-05-01, 2022-07-01, 2022-09-01, 2022-11-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native network [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create network interface

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var networkInterface = new AzureNative.Network.NetworkInterface("networkInterface", new()
{
DisableTcpStateTracking = true,
EnableAcceleratedNetworking = true,
IpConfigurations = new[]
{
new AzureNative.Network.Inputs.NetworkInterfaceIPConfigurationArgs
{
Name = "ipconfig1",
PublicIPAddress = new AzureNative.Network.Inputs.PublicIPAddressArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip",
},
Subnet = new AzureNative.Network.Inputs.SubnetArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default",
},
},
new AzureNative.Network.Inputs.NetworkInterfaceIPConfigurationArgs
{
Name = "ipconfig2",
PrivateIPAddressPrefixLength = 28,
},
},
Location = "eastus",
NetworkInterfaceName = "test-nic",
ResourceGroupName = "rg1",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewNetworkInterface(ctx, "networkInterface", &network.NetworkInterfaceArgs{
DisableTcpStateTracking: pulumi.Bool(true),
EnableAcceleratedNetworking: pulumi.Bool(true),
IpConfigurations: network.NetworkInterfaceIPConfigurationArray{
&network.NetworkInterfaceIPConfigurationArgs{
Name: pulumi.String("ipconfig1"),
PublicIPAddress: &network.PublicIPAddressTypeArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"),
},
Subnet: &network.SubnetTypeArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"),
},
},
&network.NetworkInterfaceIPConfigurationArgs{
Name: pulumi.String("ipconfig2"),
PrivateIPAddressPrefixLength: pulumi.Int(28),
},
},
Location: pulumi.String("eastus"),
NetworkInterfaceName: pulumi.String("test-nic"),
ResourceGroupName: pulumi.String("rg1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.NetworkInterface;
import com.pulumi.azurenative.network.NetworkInterfaceArgs;
import com.pulumi.azurenative.network.inputs.NetworkInterfaceIPConfigurationArgs;
import com.pulumi.azurenative.network.inputs.PublicIPAddressArgs;
import com.pulumi.azurenative.network.inputs.SubnetArgs;
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) {
var networkInterface = new NetworkInterface("networkInterface", NetworkInterfaceArgs.builder()
.disableTcpStateTracking(true)
.enableAcceleratedNetworking(true)
.ipConfigurations(
NetworkInterfaceIPConfigurationArgs.builder()
.name("ipconfig1")
.publicIPAddress(PublicIPAddressArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")
.build())
.subnet(SubnetArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")
.build())
.build(),
NetworkInterfaceIPConfigurationArgs.builder()
.name("ipconfig2")
.privateIPAddressPrefixLength(28)
.build())
.location("eastus")
.networkInterfaceName("test-nic")
.resourceGroupName("rg1")
.build());
}
}

Create network interface with Gateway Load Balancer Consumer configured

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var networkInterface = new AzureNative.Network.NetworkInterface("networkInterface", new()
{
EnableAcceleratedNetworking = true,
IpConfigurations = new[]
{
new AzureNative.Network.Inputs.NetworkInterfaceIPConfigurationArgs
{
GatewayLoadBalancer = new AzureNative.Network.Inputs.SubResourceArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider",
},
Name = "ipconfig1",
PublicIPAddress = new AzureNative.Network.Inputs.PublicIPAddressArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip",
},
Subnet = new AzureNative.Network.Inputs.SubnetArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default",
},
},
},
Location = "eastus",
NetworkInterfaceName = "test-nic",
ResourceGroupName = "rg1",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewNetworkInterface(ctx, "networkInterface", &network.NetworkInterfaceArgs{
EnableAcceleratedNetworking: pulumi.Bool(true),
IpConfigurations: network.NetworkInterfaceIPConfigurationArray{
&network.NetworkInterfaceIPConfigurationArgs{
GatewayLoadBalancer: &network.SubResourceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"),
},
Name: pulumi.String("ipconfig1"),
PublicIPAddress: &network.PublicIPAddressTypeArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"),
},
Subnet: &network.SubnetTypeArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"),
},
},
},
Location: pulumi.String("eastus"),
NetworkInterfaceName: pulumi.String("test-nic"),
ResourceGroupName: pulumi.String("rg1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.NetworkInterface;
import com.pulumi.azurenative.network.NetworkInterfaceArgs;
import com.pulumi.azurenative.network.inputs.NetworkInterfaceIPConfigurationArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
import com.pulumi.azurenative.network.inputs.PublicIPAddressArgs;
import com.pulumi.azurenative.network.inputs.SubnetArgs;
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) {
var networkInterface = new NetworkInterface("networkInterface", NetworkInterfaceArgs.builder()
.enableAcceleratedNetworking(true)
.ipConfigurations(NetworkInterfaceIPConfigurationArgs.builder()
.gatewayLoadBalancer(SubResourceArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")
.build())
.name("ipconfig1")
.publicIPAddress(PublicIPAddressArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")
.build())
.subnet(SubnetArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")
.build())
.build())
.location("eastus")
.networkInterfaceName("test-nic")
.resourceGroupName("rg1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:NetworkInterface test-nic /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}

Constructors

Link copied to clipboard
constructor(auxiliaryMode: Output<Either<String, NetworkInterfaceAuxiliaryMode>>? = null, auxiliarySku: Output<Either<String, NetworkInterfaceAuxiliarySku>>? = null, disableTcpStateTracking: Output<Boolean>? = null, dnsSettings: Output<NetworkInterfaceDnsSettingsArgs>? = null, enableAcceleratedNetworking: Output<Boolean>? = null, enableIPForwarding: Output<Boolean>? = null, extendedLocation: Output<ExtendedLocationArgs>? = null, id: Output<String>? = null, ipConfigurations: Output<List<NetworkInterfaceIPConfigurationArgs>>? = null, location: Output<String>? = null, migrationPhase: Output<Either<String, NetworkInterfaceMigrationPhase>>? = null, networkInterfaceName: Output<String>? = null, networkSecurityGroup: Output<NetworkSecurityGroupArgs>? = null, nicType: Output<Either<String, NetworkInterfaceNicType>>? = null, privateLinkService: Output<PrivateLinkServiceArgs>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, workloadType: Output<String>? = null)

Properties

Link copied to clipboard
val auxiliaryMode: Output<Either<String, NetworkInterfaceAuxiliaryMode>>? = null

Auxiliary mode of Network Interface resource.

Link copied to clipboard
val auxiliarySku: Output<Either<String, NetworkInterfaceAuxiliarySku>>? = null

Auxiliary sku of Network Interface resource.

Link copied to clipboard
val disableTcpStateTracking: Output<Boolean>? = null

Indicates whether to disable tcp state tracking.

Link copied to clipboard

The DNS settings in network interface.

Link copied to clipboard

If the network interface is configured for accelerated networking. Not applicable to VM sizes which require accelerated networking.

Link copied to clipboard
val enableIPForwarding: Output<Boolean>? = null

Indicates whether IP forwarding is enabled on this network interface.

Link copied to clipboard

The extended location of the network interface.

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

Resource ID.

Link copied to clipboard

A list of IPConfigurations of the network interface.

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

Resource location.

Link copied to clipboard

Migration phase of Network Interface resource.

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

The name of the network interface.

Link copied to clipboard

The reference to the NetworkSecurityGroup resource.

Link copied to clipboard
val nicType: Output<Either<String, NetworkInterfaceNicType>>? = null

Type of Network Interface resource.

Link copied to clipboard

Privatelinkservice of the network interface resource.

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

The name of the resource group.

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

Resource tags.

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

WorkloadType of the NetworkInterface for BareMetal resources

Functions

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