Skip to content

azurermNetworkProfile

Manages a Network Profile.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "examplegroup",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.1.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "examplevnet",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_2", {
  address_prefixes: ["10.1.0.0/24"],
  delegation: [
    {
      name: "delegation",
      service_delegation: [
        {
          actions: ["Microsoft.Network/virtualNetworks/subnets/action"],
          name: "Microsoft.ContainerInstance/containerGroups",
        },
      ],
    },
  ],
  name: "examplesubnet",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermNetworkProfileExample = new azurerm.networkProfile.NetworkProfile(
  this,
  "example_3",
  {
    container_network_interface: [
      {
        ip_configuration: [
          {
            name: "exampleipconfig",
            subnet_id: azurermSubnetExample.id,
          },
        ],
        name: "examplecnic",
      },
    ],
    location: azurermResourceGroupExample.location,
    name: "examplenetprofile",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkProfileExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Network Profile. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the resource. Changing this forces a new resource to be created.

  • containerNetworkInterface - (Required) A containerNetworkInterface block as documented below.

  • tags - (Optional) A mapping of tags to assign to the resource.


A containerNetworkInterface block supports the following:

  • name - (Required) Specifies the name of the IP Configuration.

  • ipConfiguration - (Required) One or more ipConfiguration blocks as documented below.


A ipConfiguration block supports the following:

  • name - (Required) Specifies the name of the IP Configuration.

  • subnetId - (Required) Reference to the subnet associated with the IP Configuration.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Network Profile.

  • containerNetworkInterfaceIds - A list of Container Network Interface IDs.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Network Profile.
  • update - (Defaults to 30 minutes) Used when updating the Network Profile.
  • read - (Defaults to 5 minutes) Used when retrieving the Network Profile.
  • delete - (Defaults to 30 minutes) Used when deleting the Network Profile.

Import

Network Profile can be imported using the resourceId, e.g.

terraform import azurerm_network_profile.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/networkProfiles/examplenetprofile