NetworkInterface

class NetworkInterface : KotlinCustomResource

A network interface in a resource group. Uses Azure REST API version 2023-02-01. In version 1.x of the Azure Native provider, it used API version 2020-11-01. Other available API versions: 2018-07-01, 2019-02-01, 2019-06-01, 2019-08-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-05-01.

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",
},
},
},
Location = "eastus",
NetworkInterfaceName = "test-nic",
ResourceGroupName = "rg1",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"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"),
},
},
},
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())
.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/v2"
"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}

Properties

Link copied to clipboard
val auxiliaryMode: Output<String>?

Auxiliary mode of Network Interface resource.

Link copied to clipboard
val auxiliarySku: Output<String>?

Auxiliary sku of Network Interface resource.

Link copied to clipboard

Indicates whether to disable tcp state tracking.

Link copied to clipboard

The DNS settings in network interface.

Link copied to clipboard

A reference to the dscp configuration to which the network interface is linked.

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

Indicates whether IP forwarding is enabled on this network interface.

Link copied to clipboard
val etag: Output<String>

A unique read-only string that changes whenever the resource is updated.

Link copied to clipboard

The extended location of the network interface.

Link copied to clipboard

A list of references to linked BareMetal resources.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

A list of IPConfigurations of the network interface.

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

Resource location.

Link copied to clipboard
val macAddress: Output<String>

The MAC address of the network interface.

Link copied to clipboard
val migrationPhase: Output<String>?

Migration phase of Network Interface resource.

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

The reference to the NetworkSecurityGroup resource.

Link copied to clipboard
val nicType: Output<String>?

Type of Network Interface resource.

Link copied to clipboard
val primary: Output<Boolean>

Whether this is a primary network interface on a virtual machine.

Link copied to clipboard

A reference to the private endpoint to which the network interface is linked.

Link copied to clipboard

Privatelinkservice of the network interface resource.

Link copied to clipboard

The provisioning state of the network interface resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGuid: Output<String>

The resource GUID property of the network interface resource.

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

Resource tags.

Link copied to clipboard

A list of TapConfigurations of the network interface.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The reference to a virtual machine.

Link copied to clipboard

Whether the virtual machine this nic is attached to supports encryption.

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

WorkloadType of the NetworkInterface for BareMetal resources