Skip to content

azurermNetworkManagerScopeConnection

Manages a Network Manager Scope Connection which may cross tenants.

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 dataAzurermClientConfigCurrent =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "current",
    {}
  );
const dataAzurermSubscriptionAlt =
  new azurerm.dataAzurermSubscription.DataAzurermSubscription(this, "alt", {
    subscription_id: "00000000-0000-0000-0000-000000000000",
  });
const dataAzurermSubscriptionCurrent =
  new azurerm.dataAzurermSubscription.DataAzurermSubscription(
    this,
    "current_3",
    {}
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermSubscriptionCurrent.overrideLogicalId("current");
const azurermNetworkManagerExample = new azurerm.networkManager.NetworkManager(
  this,
  "example_4",
  {
    location: azurermResourceGroupExample.location,
    name: "example-networkmanager",
    resource_group_name: azurermResourceGroupExample.name,
    scope: [
      {
        subscription_ids: [dataAzurermSubscriptionCurrent.id],
      },
    ],
    scope_accesses: ["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 azurermNetworkManagerScopeConnectionExample =
  new azurerm.networkManagerScopeConnection.NetworkManagerScopeConnection(
    this,
    "example_5",
    {
      description: "example",
      name: "example-nsc",
      network_manager_id: azurermNetworkManagerExample.id,
      target_scope_id: dataAzurermSubscriptionAlt.id,
      tenant_id: dataAzurermClientConfigCurrent.tenantId,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkManagerScopeConnectionExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

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

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

  • targetScopeId - (Required) Specifies the Resource ID of the target scope which the Network Manager is connected to. It should be either Subscription ID or Management Group ID.

  • tenantId - (Required) Specifies the Tenant ID of the Resource which the Network Manager is connected to.

  • description - (Optional) A description of the Network Manager Scope Connection.

Attributes Reference

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

  • id - The ID of the Network Manager Scope Connection.

  • connectionState - The Connection state of the Network Manager Scope Connection.

Timeouts

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

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

Import

Network Manager Scope Connection can be imported using the resourceId, e.g.

terraform import azurerm_network_manager_scope_connection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/networkManagers/networkManager1/scopeConnections/scopeConnection1