Skip to content

azurermNetworkManagerConnectivityConfiguration

Manages a Network Manager Connectivity Configuration.

-> Note: The azurermNetworkManagerConnectivityConfiguration deployment may modify or delete existing Network Peering resource.

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: "example-resources",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.0.0.0/16"],
    flow_timeout_in_minutes: 10,
    location: azurermResourceGroupExample.location,
    name: "example-net",
    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 dataAzurermSubscriptionCurrent =
  new azurerm.dataAzurermSubscription.DataAzurermSubscription(
    this,
    "current",
    {}
  );
const azurermNetworkManagerExample = new azurerm.networkManager.NetworkManager(
  this,
  "example_3",
  {
    description: "example network manager",
    location: azurermResourceGroupExample.location,
    name: "example-network-manager",
    resource_group_name: azurermResourceGroupExample.name,
    scope: [
      {
        subscription_ids: [dataAzurermSubscriptionCurrent.id],
      },
    ],
    scope_accesses: ["Connectivity", "SecurityAdmin"],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkManagerExample.overrideLogicalId("example");
const azurermNetworkManagerNetworkGroupExample =
  new azurerm.networkManagerNetworkGroup.NetworkManagerNetworkGroup(
    this,
    "example_4",
    {
      name: "example-group",
      network_manager_id: azurermNetworkManagerExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkManagerNetworkGroupExample.overrideLogicalId("example");
const azurermNetworkManagerConnectivityConfigurationExample =
  new azurerm.networkManagerConnectivityConfiguration.NetworkManagerConnectivityConfiguration(
    this,
    "example_5",
    {
      applies_to_group: [
        {
          group_connectivity: "DirectlyConnected",
          network_group_id: azurermNetworkManagerNetworkGroupExample.id,
        },
      ],
      connectivity_topology: "HubAndSpoke",
      hub: [
        {
          resource_id: azurermVirtualNetworkExample.id,
          resource_type: "Microsoft.Network/virtualNetworks",
        },
      ],
      name: "example-connectivity-conf",
      network_manager_id: azurermNetworkManagerExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkManagerConnectivityConfigurationExample.overrideLogicalId(
  "example"
);

Arguments Reference

The following arguments are supported:

  • name - (Required) Specifies the name which should be used for this Network Manager Connectivity Configuration. Changing this forces a new Network Manager Connectivity Configuration to be created.

  • networkManagerId - (Required) Specifies the ID of the Network Manager. Changing this forces a new Network Manager Connectivity Configuration to be created.

  • appliesToGroup - (Required) An appliesToGroup block as defined below.

  • connectivityTopology - (Required) Specifies the connectivity topology type. Possible values are hubAndSpoke and mesh.

  • deleteExistingPeeringEnabled - (Optional) Indicates whether to remove current existing Virtual Network Peering in the Connectivity Configuration affected scope. Possible values are true and false.

  • description - (Optional) A description of the Connectivity Configuration.

  • globalMeshEnabled - (Optional) Indicates whether to global mesh is supported. Possible values are true and false.

  • hub - (Optional) A hub block as defined below.


An appliesToGroup block supports the following:

  • groupConnectivity - (Required) Specifies the group connectivity type. Possible values are none and directlyConnected.

  • networkGroupId - (Required) Specifies the resource ID of Network Group which the configuration applies to.

  • globalMeshEnabled - (Optional) Indicates whether to global mesh is supported for this group. Possible values are true and false.

-> NOTE: A group can be global only if the groupConnectivity is directlyConnected.

  • useHubGateway - (Optional) Indicates whether the hub gateway is used. Possible values are true and false.

A hub block supports the following:

  • resourceId - (Required) Specifies the resource ID used as hub in Hub And Spoke topology.

  • resourceType - (Required) Specifies the resource Type used as hub in Hub And Spoke topology.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Network Manager Connectivity Configuration.

Timeouts

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

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

Import

Network Manager Connectivity Configuration can be imported using the resourceId, e.g.

terraform import azurerm_network_manager_connectivity_configuration.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/networkManagers/networkManager1/connectivityConfigurations/configuration1