1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. NetworkManagerScopeConnection

We recommend using Azure Native.

Azure Classic v6.3.1 published on Tuesday, Oct 1, 2024 by Pulumi

azure.network.NetworkManagerScopeConnection

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.3.1 published on Tuesday, Oct 1, 2024 by Pulumi

    Manages a Network Manager Scope Connection which may cross tenants.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const current = azure.core.getClientConfig({});
    const currentGetSubscription = azure.core.getSubscription({});
    const alt = azure.core.getSubscription({
        subscriptionId: "00000000-0000-0000-0000-000000000000",
    });
    const exampleNetworkManager = new azure.network.NetworkManager("example", {
        name: "example-networkmanager",
        location: example.location,
        resourceGroupName: example.name,
        scope: {
            subscriptionIds: [currentGetSubscription.then(currentGetSubscription => currentGetSubscription.id)],
        },
        scopeAccesses: ["SecurityAdmin"],
    });
    const exampleNetworkManagerScopeConnection = new azure.network.NetworkManagerScopeConnection("example", {
        name: "example-nsc",
        networkManagerId: exampleNetworkManager.id,
        tenantId: current.then(current => current.tenantId),
        targetScopeId: alt.then(alt => alt.id),
        description: "example",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    current = azure.core.get_client_config()
    current_get_subscription = azure.core.get_subscription()
    alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000")
    example_network_manager = azure.network.NetworkManager("example",
        name="example-networkmanager",
        location=example.location,
        resource_group_name=example.name,
        scope={
            "subscription_ids": [current_get_subscription.id],
        },
        scope_accesses=["SecurityAdmin"])
    example_network_manager_scope_connection = azure.network.NetworkManagerScopeConnection("example",
        name="example-nsc",
        network_manager_id=example_network_manager.id,
        tenant_id=current.tenant_id,
        target_scope_id=alt.id,
        description="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		current, err := core.GetClientConfig(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		currentGetSubscription, err := core.LookupSubscription(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		alt, err := core.LookupSubscription(ctx, &core.LookupSubscriptionArgs{
    			SubscriptionId: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleNetworkManager, err := network.NewNetworkManager(ctx, "example", &network.NetworkManagerArgs{
    			Name:              pulumi.String("example-networkmanager"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Scope: &network.NetworkManagerScopeArgs{
    				SubscriptionIds: pulumi.StringArray{
    					pulumi.String(currentGetSubscription.Id),
    				},
    			},
    			ScopeAccesses: pulumi.StringArray{
    				pulumi.String("SecurityAdmin"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = network.NewNetworkManagerScopeConnection(ctx, "example", &network.NetworkManagerScopeConnectionArgs{
    			Name:             pulumi.String("example-nsc"),
    			NetworkManagerId: exampleNetworkManager.ID(),
    			TenantId:         pulumi.String(current.TenantId),
    			TargetScopeId:    pulumi.String(alt.Id),
    			Description:      pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var current = Azure.Core.GetClientConfig.Invoke();
    
        var currentGetSubscription = Azure.Core.GetSubscription.Invoke();
    
        var alt = Azure.Core.GetSubscription.Invoke(new()
        {
            SubscriptionId = "00000000-0000-0000-0000-000000000000",
        });
    
        var exampleNetworkManager = new Azure.Network.NetworkManager("example", new()
        {
            Name = "example-networkmanager",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs
            {
                SubscriptionIds = new[]
                {
                    currentGetSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id),
                },
            },
            ScopeAccesses = new[]
            {
                "SecurityAdmin",
            },
        });
    
        var exampleNetworkManagerScopeConnection = new Azure.Network.NetworkManagerScopeConnection("example", new()
        {
            Name = "example-nsc",
            NetworkManagerId = exampleNetworkManager.Id,
            TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
            TargetScopeId = alt.Apply(getSubscriptionResult => getSubscriptionResult.Id),
            Description = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.core.CoreFunctions;
    import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
    import com.pulumi.azure.network.NetworkManager;
    import com.pulumi.azure.network.NetworkManagerArgs;
    import com.pulumi.azure.network.inputs.NetworkManagerScopeArgs;
    import com.pulumi.azure.network.NetworkManagerScopeConnection;
    import com.pulumi.azure.network.NetworkManagerScopeConnectionArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            final var current = CoreFunctions.getClientConfig();
    
            final var currentGetSubscription = CoreFunctions.getSubscription();
    
            final var alt = CoreFunctions.getSubscription(GetSubscriptionArgs.builder()
                .subscriptionId("00000000-0000-0000-0000-000000000000")
                .build());
    
            var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()
                .name("example-networkmanager")
                .location(example.location())
                .resourceGroupName(example.name())
                .scope(NetworkManagerScopeArgs.builder()
                    .subscriptionIds(currentGetSubscription.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
                    .build())
                .scopeAccesses("SecurityAdmin")
                .build());
    
            var exampleNetworkManagerScopeConnection = new NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", NetworkManagerScopeConnectionArgs.builder()
                .name("example-nsc")
                .networkManagerId(exampleNetworkManager.id())
                .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                .targetScopeId(alt.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
                .description("example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleNetworkManager:
        type: azure:network:NetworkManager
        name: example
        properties:
          name: example-networkmanager
          location: ${example.location}
          resourceGroupName: ${example.name}
          scope:
            subscriptionIds:
              - ${currentGetSubscription.id}
          scopeAccesses:
            - SecurityAdmin
      exampleNetworkManagerScopeConnection:
        type: azure:network:NetworkManagerScopeConnection
        name: example
        properties:
          name: example-nsc
          networkManagerId: ${exampleNetworkManager.id}
          tenantId: ${current.tenantId}
          targetScopeId: ${alt.id}
          description: example
    variables:
      current:
        fn::invoke:
          Function: azure:core:getClientConfig
          Arguments: {}
      currentGetSubscription:
        fn::invoke:
          Function: azure:core:getSubscription
          Arguments: {}
      alt:
        fn::invoke:
          Function: azure:core:getSubscription
          Arguments:
            subscriptionId: 00000000-0000-0000-0000-000000000000
    

    Create NetworkManagerScopeConnection Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NetworkManagerScopeConnection(name: string, args: NetworkManagerScopeConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkManagerScopeConnection(resource_name: str,
                                      args: NetworkManagerScopeConnectionArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkManagerScopeConnection(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      network_manager_id: Optional[str] = None,
                                      target_scope_id: Optional[str] = None,
                                      tenant_id: Optional[str] = None,
                                      description: Optional[str] = None,
                                      name: Optional[str] = None)
    func NewNetworkManagerScopeConnection(ctx *Context, name string, args NetworkManagerScopeConnectionArgs, opts ...ResourceOption) (*NetworkManagerScopeConnection, error)
    public NetworkManagerScopeConnection(string name, NetworkManagerScopeConnectionArgs args, CustomResourceOptions? opts = null)
    public NetworkManagerScopeConnection(String name, NetworkManagerScopeConnectionArgs args)
    public NetworkManagerScopeConnection(String name, NetworkManagerScopeConnectionArgs args, CustomResourceOptions options)
    
    type: azure:network:NetworkManagerScopeConnection
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NetworkManagerScopeConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NetworkManagerScopeConnectionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NetworkManagerScopeConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkManagerScopeConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkManagerScopeConnectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var networkManagerScopeConnectionResource = new Azure.Network.NetworkManagerScopeConnection("networkManagerScopeConnectionResource", new()
    {
        NetworkManagerId = "string",
        TargetScopeId = "string",
        TenantId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := network.NewNetworkManagerScopeConnection(ctx, "networkManagerScopeConnectionResource", &network.NetworkManagerScopeConnectionArgs{
    	NetworkManagerId: pulumi.String("string"),
    	TargetScopeId:    pulumi.String("string"),
    	TenantId:         pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	Name:             pulumi.String("string"),
    })
    
    var networkManagerScopeConnectionResource = new NetworkManagerScopeConnection("networkManagerScopeConnectionResource", NetworkManagerScopeConnectionArgs.builder()
        .networkManagerId("string")
        .targetScopeId("string")
        .tenantId("string")
        .description("string")
        .name("string")
        .build());
    
    network_manager_scope_connection_resource = azure.network.NetworkManagerScopeConnection("networkManagerScopeConnectionResource",
        network_manager_id="string",
        target_scope_id="string",
        tenant_id="string",
        description="string",
        name="string")
    
    const networkManagerScopeConnectionResource = new azure.network.NetworkManagerScopeConnection("networkManagerScopeConnectionResource", {
        networkManagerId: "string",
        targetScopeId: "string",
        tenantId: "string",
        description: "string",
        name: "string",
    });
    
    type: azure:network:NetworkManagerScopeConnection
    properties:
        description: string
        name: string
        networkManagerId: string
        targetScopeId: string
        tenantId: string
    

    NetworkManagerScopeConnection Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The NetworkManagerScopeConnection resource accepts the following input properties:

    NetworkManagerId string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    TargetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    Description string
    A description of the Network Manager Scope Connection.
    Name string
    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 string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    TargetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    Description string
    A description of the Network Manager Scope Connection.
    Name string
    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 String
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId String
    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 String
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    description String
    A description of the Network Manager Scope Connection.
    name String
    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 string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    description string
    A description of the Network Manager Scope Connection.
    name string
    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.
    network_manager_id str
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    target_scope_id str
    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.
    tenant_id str
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    description str
    A description of the Network Manager Scope Connection.
    name str
    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 String
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId String
    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 String
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    description String
    A description of the Network Manager Scope Connection.
    name String
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkManagerScopeConnection resource produces the following output properties:

    ConnectionState string
    The Connection state of the Network Manager Scope Connection.
    Id string
    The provider-assigned unique ID for this managed resource.
    ConnectionState string
    The Connection state of the Network Manager Scope Connection.
    Id string
    The provider-assigned unique ID for this managed resource.
    connectionState String
    The Connection state of the Network Manager Scope Connection.
    id String
    The provider-assigned unique ID for this managed resource.
    connectionState string
    The Connection state of the Network Manager Scope Connection.
    id string
    The provider-assigned unique ID for this managed resource.
    connection_state str
    The Connection state of the Network Manager Scope Connection.
    id str
    The provider-assigned unique ID for this managed resource.
    connectionState String
    The Connection state of the Network Manager Scope Connection.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing NetworkManagerScopeConnection Resource

    Get an existing NetworkManagerScopeConnection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkManagerScopeConnectionState, opts?: CustomResourceOptions): NetworkManagerScopeConnection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_state: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            network_manager_id: Optional[str] = None,
            target_scope_id: Optional[str] = None,
            tenant_id: Optional[str] = None) -> NetworkManagerScopeConnection
    func GetNetworkManagerScopeConnection(ctx *Context, name string, id IDInput, state *NetworkManagerScopeConnectionState, opts ...ResourceOption) (*NetworkManagerScopeConnection, error)
    public static NetworkManagerScopeConnection Get(string name, Input<string> id, NetworkManagerScopeConnectionState? state, CustomResourceOptions? opts = null)
    public static NetworkManagerScopeConnection get(String name, Output<String> id, NetworkManagerScopeConnectionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ConnectionState string
    The Connection state of the Network Manager Scope Connection.
    Description string
    A description of the Network Manager Scope Connection.
    Name string
    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 string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    TargetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    ConnectionState string
    The Connection state of the Network Manager Scope Connection.
    Description string
    A description of the Network Manager Scope Connection.
    Name string
    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 string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    TargetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    connectionState String
    The Connection state of the Network Manager Scope Connection.
    description String
    A description of the Network Manager Scope Connection.
    name String
    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 String
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId String
    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 String
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    connectionState string
    The Connection state of the Network Manager Scope Connection.
    description string
    A description of the Network Manager Scope Connection.
    name string
    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 string
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId string
    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 string
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    connection_state str
    The Connection state of the Network Manager Scope Connection.
    description str
    A description of the Network Manager Scope Connection.
    name str
    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.
    network_manager_id str
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    target_scope_id str
    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.
    tenant_id str
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.
    connectionState String
    The Connection state of the Network Manager Scope Connection.
    description String
    A description of the Network Manager Scope Connection.
    name String
    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 String
    Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
    targetScopeId String
    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 String
    Specifies the Tenant ID of the Resource which the Network Manager is connected to.

    Import

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

    $ pulumi import azure:network/networkManagerScopeConnection:NetworkManagerScopeConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/networkManagers/networkManager1/scopeConnections/scopeConnection1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.3.1 published on Tuesday, Oct 1, 2024 by Pulumi