We recommend using Azure Native.
azure.network.NetworkManagerSubscriptionConnection
Explore with Pulumi AI
Manages a Network Manager Subscription 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.getSubscription({});
const exampleNetworkManager = new azure.network.NetworkManager("example", {
name: "example-networkmanager",
location: example.location,
resourceGroupName: example.name,
scope: {
subscriptionIds: [current.then(current => current.id)],
},
scopeAccesses: ["SecurityAdmin"],
});
const exampleNetworkManagerSubscriptionConnection = new azure.network.NetworkManagerSubscriptionConnection("example", {
name: "example-nsnmc",
subscriptionId: current.then(current => current.id),
networkManagerId: exampleNetworkManager.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_subscription()
example_network_manager = azure.network.NetworkManager("example",
name="example-networkmanager",
location=example.location,
resource_group_name=example.name,
scope=azure.network.NetworkManagerScopeArgs(
subscription_ids=[current.id],
),
scope_accesses=["SecurityAdmin"])
example_network_manager_subscription_connection = azure.network.NetworkManagerSubscriptionConnection("example",
name="example-nsnmc",
subscription_id=current.id,
network_manager_id=example_network_manager.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 {
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.LookupSubscription(ctx, nil, 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(current.Id),
},
},
ScopeAccesses: pulumi.StringArray{
pulumi.String("SecurityAdmin"),
},
})
if err != nil {
return err
}
_, err = network.NewNetworkManagerSubscriptionConnection(ctx, "example", &network.NetworkManagerSubscriptionConnectionArgs{
Name: pulumi.String("example-nsnmc"),
SubscriptionId: pulumi.String(current.Id),
NetworkManagerId: exampleNetworkManager.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.GetSubscription.Invoke();
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[]
{
current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
},
},
ScopeAccesses = new[]
{
"SecurityAdmin",
},
});
var exampleNetworkManagerSubscriptionConnection = new Azure.Network.NetworkManagerSubscriptionConnection("example", new()
{
Name = "example-nsnmc",
SubscriptionId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
NetworkManagerId = exampleNetworkManager.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.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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
final var current = CoreFunctions.getSubscription();
var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()
.name("example-networkmanager")
.location(example.location())
.resourceGroupName(example.name())
.scope(NetworkManagerScopeArgs.builder()
.subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.build())
.scopeAccesses("SecurityAdmin")
.build());
var exampleNetworkManagerSubscriptionConnection = new NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", NetworkManagerSubscriptionConnectionArgs.builder()
.name("example-nsnmc")
.subscriptionId(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.networkManagerId(exampleNetworkManager.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:
- ${current.id}
scopeAccesses:
- SecurityAdmin
exampleNetworkManagerSubscriptionConnection:
type: azure:network:NetworkManagerSubscriptionConnection
name: example
properties:
name: example-nsnmc
subscriptionId: ${current.id}
networkManagerId: ${exampleNetworkManager.id}
description: example
variables:
current:
fn::invoke:
Function: azure:core:getSubscription
Arguments: {}
Create NetworkManagerSubscriptionConnection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NetworkManagerSubscriptionConnection(name: string, args: NetworkManagerSubscriptionConnectionArgs, opts?: CustomResourceOptions);
@overload
def NetworkManagerSubscriptionConnection(resource_name: str,
args: NetworkManagerSubscriptionConnectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NetworkManagerSubscriptionConnection(resource_name: str,
opts: Optional[ResourceOptions] = None,
network_manager_id: Optional[str] = None,
subscription_id: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var networkManagerSubscriptionConnectionResource = new Azure.Network.NetworkManagerSubscriptionConnection("networkManagerSubscriptionConnectionResource", new()
{
NetworkManagerId = "string",
SubscriptionId = "string",
Description = "string",
Name = "string",
});
example, err := network.NewNetworkManagerSubscriptionConnection(ctx, "networkManagerSubscriptionConnectionResource", &network.NetworkManagerSubscriptionConnectionArgs{
NetworkManagerId: pulumi.String("string"),
SubscriptionId: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var networkManagerSubscriptionConnectionResource = new NetworkManagerSubscriptionConnection("networkManagerSubscriptionConnectionResource", NetworkManagerSubscriptionConnectionArgs.builder()
.networkManagerId("string")
.subscriptionId("string")
.description("string")
.name("string")
.build());
network_manager_subscription_connection_resource = azure.network.NetworkManagerSubscriptionConnection("networkManagerSubscriptionConnectionResource",
network_manager_id="string",
subscription_id="string",
description="string",
name="string")
const networkManagerSubscriptionConnectionResource = new azure.network.NetworkManagerSubscriptionConnection("networkManagerSubscriptionConnectionResource", {
networkManagerId: "string",
subscriptionId: "string",
description: "string",
name: "string",
});
type: azure:network:NetworkManagerSubscriptionConnection
properties:
description: string
name: string
networkManagerId: string
subscriptionId: string
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:
- Network
Manager stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- Subscription
Id 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 stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- Subscription
Id 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 StringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id 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 stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id 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_ strid - 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.
- network
Manager StringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id 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:
- Connection
State string - The Connection state of the Network Manager Subscription Connection.
- Id string
- The provider-assigned unique ID for this managed resource.
- Connection
State string - The Connection state of the Network Manager Subscription Connection.
- Id string
- The provider-assigned unique ID for this managed resource.
- connection
State String - The Connection state of the Network Manager Subscription Connection.
- id String
- The provider-assigned unique ID for this managed resource.
- connection
State 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.
- connection
State 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.
- Connection
State 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.
- Network
Manager stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- Subscription
Id string - Specifies the ID of the target Subscription. Changing this forces a new resource to be created.
- Connection
State 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.
- Network
Manager stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- Subscription
Id string - Specifies the ID of the target Subscription. Changing this forces a new resource to be created.
- connection
State 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.
- network
Manager StringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id String - Specifies the ID of the target Subscription. Changing this forces a new resource to be created.
- connection
State 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.
- network
Manager stringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id 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_ strid - 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.
- connection
State 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.
- network
Manager StringId - Specifies the ID of the Network Manager which the Subscription is connected to.
- subscription
Id 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
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.