azure.network.NetworkManagerSubscriptionConnection

Explore with Pulumi AI

Manages a Network Manager Subscription Connection which may cross tenants.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var current = Azure.Core.GetSubscription.Invoke();

    var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs
        {
            SubscriptionIds = new[]
            {
                current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
            },
        },
        ScopeAccesses = new[]
        {
            "SecurityAdmin",
        },
    });

    var exampleNetworkManagerSubscriptionConnection = new Azure.Network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", new()
    {
        SubscriptionId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
        NetworkManagerId = exampleNetworkManager.Id,
        Description = "example",
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		current, err := core.LookupSubscription(ctx, nil, nil)
		if err != nil {
			return err
		}
		exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Scope: &network.NetworkManagerScopeArgs{
				SubscriptionIds: pulumi.StringArray{
					*pulumi.String(current.Id),
				},
			},
			ScopeAccesses: pulumi.StringArray{
				pulumi.String("SecurityAdmin"),
			},
		})
		if err != nil {
			return err
		}
		_, err = network.NewNetworkManagerSubscriptionConnection(ctx, "exampleNetworkManagerSubscriptionConnection", &network.NetworkManagerSubscriptionConnectionArgs{
			SubscriptionId:   *pulumi.String(current.Id),
			NetworkManagerId: exampleNetworkManager.ID(),
			Description:      pulumi.String("example"),
		})
		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.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.NetworkManagerSubscriptionConnection;
import com.pulumi.azure.network.NetworkManagerSubscriptionConnectionArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        final var current = CoreFunctions.getSubscription();

        var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .scope(NetworkManagerScopeArgs.builder()
                .subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
                .build())
            .scopeAccesses("SecurityAdmin")
            .build());

        var exampleNetworkManagerSubscriptionConnection = new NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", NetworkManagerSubscriptionConnectionArgs.builder()        
            .subscriptionId(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
            .networkManagerId(exampleNetworkManager.id())
            .description("example")
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
current = azure.core.get_subscription()
example_network_manager = azure.network.NetworkManager("exampleNetworkManager",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    scope=azure.network.NetworkManagerScopeArgs(
        subscription_ids=[current.id],
    ),
    scope_accesses=["SecurityAdmin"])
example_network_manager_subscription_connection = azure.network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection",
    subscription_id=current.id,
    network_manager_id=example_network_manager.id,
    description="example")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const current = azure.core.getSubscription({});
const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    scope: {
        subscriptionIds: [current.then(current => current.id)],
    },
    scopeAccesses: ["SecurityAdmin"],
});
const exampleNetworkManagerSubscriptionConnection = new azure.network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", {
    subscriptionId: current.then(current => current.id),
    networkManagerId: exampleNetworkManager.id,
    description: "example",
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleNetworkManager:
    type: azure:network:NetworkManager
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      scope:
        subscriptionIds:
          - ${current.id}
      scopeAccesses:
        - SecurityAdmin
  exampleNetworkManagerSubscriptionConnection:
    type: azure:network:NetworkManagerSubscriptionConnection
    properties:
      subscriptionId: ${current.id}
      networkManagerId: ${exampleNetworkManager.id}
      description: example
variables:
  current:
    fn::invoke:
      Function: azure:core:getSubscription
      Arguments: {}

Create NetworkManagerSubscriptionConnection Resource

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

name string
The unique name of the resource.
args NetworkManagerSubscriptionConnectionArgs
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 NetworkManagerSubscriptionConnectionArgs
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 NetworkManagerSubscriptionConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NetworkManagerSubscriptionConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args NetworkManagerSubscriptionConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

NetworkManagerSubscriptionConnection 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 NetworkManagerSubscriptionConnection resource accepts the following input properties:

NetworkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

SubscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

Description string

A description of the Network Manager Subscription Connection.

Name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

NetworkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

SubscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

Description string

A description of the Network Manager Subscription Connection.

Name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId String

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId String

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

description String

A description of the Network Manager Subscription Connection.

name String

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

description string

A description of the Network Manager Subscription Connection.

name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

network_manager_id str

Specifies the ID of the Network Manager which the Subscription is connected to.

subscription_id str

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

description str

A description of the Network Manager Subscription Connection.

name str

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId String

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId String

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

description String

A description of the Network Manager Subscription Connection.

name String

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

Outputs

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

ConnectionState string

The Connection state of the Network Manager Subscription Connection.

Id string

The provider-assigned unique ID for this managed resource.

ConnectionState string

The Connection state of the Network Manager Subscription Connection.

Id string

The provider-assigned unique ID for this managed resource.

connectionState String

The Connection state of the Network Manager Subscription Connection.

id String

The provider-assigned unique ID for this managed resource.

connectionState string

The Connection state of the Network Manager Subscription Connection.

id string

The provider-assigned unique ID for this managed resource.

connection_state str

The Connection state of the Network Manager Subscription Connection.

id str

The provider-assigned unique ID for this managed resource.

connectionState String

The Connection state of the Network Manager Subscription Connection.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing NetworkManagerSubscriptionConnection Resource

Get an existing NetworkManagerSubscriptionConnection 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?: NetworkManagerSubscriptionConnectionState, opts?: CustomResourceOptions): NetworkManagerSubscriptionConnection
@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,
        subscription_id: Optional[str] = None) -> NetworkManagerSubscriptionConnection
func GetNetworkManagerSubscriptionConnection(ctx *Context, name string, id IDInput, state *NetworkManagerSubscriptionConnectionState, opts ...ResourceOption) (*NetworkManagerSubscriptionConnection, error)
public static NetworkManagerSubscriptionConnection Get(string name, Input<string> id, NetworkManagerSubscriptionConnectionState? state, CustomResourceOptions? opts = null)
public static NetworkManagerSubscriptionConnection get(String name, Output<String> id, NetworkManagerSubscriptionConnectionState 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 Subscription Connection.

Description string

A description of the Network Manager Subscription Connection.

Name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

NetworkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

SubscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

ConnectionState string

The Connection state of the Network Manager Subscription Connection.

Description string

A description of the Network Manager Subscription Connection.

Name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

NetworkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

SubscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

connectionState String

The Connection state of the Network Manager Subscription Connection.

description String

A description of the Network Manager Subscription Connection.

name String

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId String

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId String

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

connectionState string

The Connection state of the Network Manager Subscription Connection.

description string

A description of the Network Manager Subscription Connection.

name string

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId string

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId string

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

connection_state str

The Connection state of the Network Manager Subscription Connection.

description str

A description of the Network Manager Subscription Connection.

name str

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

network_manager_id str

Specifies the ID of the Network Manager which the Subscription is connected to.

subscription_id str

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

connectionState String

The Connection state of the Network Manager Subscription Connection.

description String

A description of the Network Manager Subscription Connection.

name String

Specifies the name which should be used for this Network Subscription Network Manager Connection. Changing this forces a new Network Subscription Network Manager Connection to be created.

networkManagerId String

Specifies the ID of the Network Manager which the Subscription is connected to.

subscriptionId String

Specifies the ID of the target Subscription. Changing this forces a new resource to be created.

Import

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

 $ pulumi import azure:network/networkManagerSubscriptionConnection:NetworkManagerSubscriptionConnection example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/networkManagerConnection1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.