azure.network.NetworkManagerScopeConnection
Explore with Pulumi AI
Manages a Network Manager Scope 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 currentClientConfig = Azure.Core.GetClientConfig.Invoke();
var currentSubscription = Azure.Core.GetSubscription.Invoke();
var alt = Azure.Core.GetSubscription.Invoke(new()
{
SubscriptionId = "00000000-0000-0000-0000-000000000000",
});
var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs
{
SubscriptionIds = new[]
{
currentSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id),
},
},
ScopeAccesses = new[]
{
"SecurityAdmin",
},
});
var exampleNetworkManagerScopeConnection = new Azure.Network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", new()
{
NetworkManagerId = exampleNetworkManager.Id,
TenantId = currentClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId),
TargetScopeId = alt.Apply(getSubscriptionResult => getSubscriptionResult.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
}
currentClientConfig, err := core.GetClientConfig(ctx, nil, nil)
if err != nil {
return err
}
currentSubscription, 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, "exampleNetworkManager", &network.NetworkManagerArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Scope: &network.NetworkManagerScopeArgs{
SubscriptionIds: pulumi.StringArray{
*pulumi.String(currentSubscription.Id),
},
},
ScopeAccesses: pulumi.StringArray{
pulumi.String("SecurityAdmin"),
},
})
if err != nil {
return err
}
_, err = network.NewNetworkManagerScopeConnection(ctx, "exampleNetworkManagerScopeConnection", &network.NetworkManagerScopeConnectionArgs{
NetworkManagerId: exampleNetworkManager.ID(),
TenantId: *pulumi.String(currentClientConfig.TenantId),
TargetScopeId: *pulumi.String(alt.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.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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
final var currentClientConfig = CoreFunctions.getClientConfig();
final var currentSubscription = CoreFunctions.getSubscription();
final var alt = CoreFunctions.getSubscription(GetSubscriptionArgs.builder()
.subscriptionId("00000000-0000-0000-0000-000000000000")
.build());
var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.scope(NetworkManagerScopeArgs.builder()
.subscriptionIds(currentSubscription.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.build())
.scopeAccesses("SecurityAdmin")
.build());
var exampleNetworkManagerScopeConnection = new NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", NetworkManagerScopeConnectionArgs.builder()
.networkManagerId(exampleNetworkManager.id())
.tenantId(currentClientConfig.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.targetScopeId(alt.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.description("example")
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
current_client_config = azure.core.get_client_config()
current_subscription = azure.core.get_subscription()
alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000")
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_subscription.id],
),
scope_accesses=["SecurityAdmin"])
example_network_manager_scope_connection = azure.network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection",
network_manager_id=example_network_manager.id,
tenant_id=current_client_config.tenant_id,
target_scope_id=alt.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 currentClientConfig = azure.core.getClientConfig({});
const currentSubscription = azure.core.getSubscription({});
const alt = azure.core.getSubscription({
subscriptionId: "00000000-0000-0000-0000-000000000000",
});
const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
scope: {
subscriptionIds: [currentSubscription.then(currentSubscription => currentSubscription.id)],
},
scopeAccesses: ["SecurityAdmin"],
});
const exampleNetworkManagerScopeConnection = new azure.network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", {
networkManagerId: exampleNetworkManager.id,
tenantId: currentClientConfig.then(currentClientConfig => currentClientConfig.tenantId),
targetScopeId: alt.then(alt => alt.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:
- ${currentSubscription.id}
scopeAccesses:
- SecurityAdmin
exampleNetworkManagerScopeConnection:
type: azure:network:NetworkManagerScopeConnection
properties:
networkManagerId: ${exampleNetworkManager.id}
tenantId: ${currentClientConfig.tenantId}
targetScopeId: ${alt.id}
description: example
variables:
currentClientConfig:
fn::invoke:
Function: azure:core:getClientConfig
Arguments: {}
currentSubscription:
fn::invoke:
Function: azure:core:getSubscription
Arguments: {}
alt:
fn::invoke:
Function: azure:core:getSubscription
Arguments:
subscriptionId: 00000000-0000-0000-0000-000000000000
Create NetworkManagerScopeConnection Resource
new NetworkManagerScopeConnection(name: string, args: NetworkManagerScopeConnectionArgs, opts?: CustomResourceOptions);
@overload
def NetworkManagerScopeConnection(resource_name: str,
opts: Optional[ResourceOptions] = 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)
@overload
def NetworkManagerScopeConnection(resource_name: str,
args: NetworkManagerScopeConnectionArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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:
- Network
Manager stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- Target
Scope stringId 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 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 stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- Target
Scope stringId 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 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 StringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope StringId 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 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 stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope stringId 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 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_ strid Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target_
scope_ strid 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.
- network
Manager StringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope StringId 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 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:
- Connection
State string The Connection state of the Network Manager Scope Connection.
- Id string
The provider-assigned unique ID for this managed resource.
- Connection
State string The Connection state of the Network Manager Scope Connection.
- Id string
The provider-assigned unique ID for this managed resource.
- connection
State String The Connection state of the Network Manager Scope Connection.
- id String
The provider-assigned unique ID for this managed resource.
- connection
State 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.
- connection
State 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.
- Connection
State 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.
- Network
Manager stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- Target
Scope stringId 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 string Specifies the Tenant ID of the Resource which the Network Manager is connected to.
- Connection
State 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.
- Network
Manager stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- Target
Scope stringId 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 string Specifies the Tenant ID of the Resource which the Network Manager is connected to.
- connection
State 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.
- network
Manager StringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope StringId 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 String Specifies the Tenant ID of the Resource which the Network Manager is connected to.
- connection
State 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.
- network
Manager stringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope stringId 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 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_ strid Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target_
scope_ strid 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.
- connection
State 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.
- network
Manager StringId Specifies the ID of the Network Manager Scope Connection. Changing this forces a new Network Manager Scope Connection to be created.
- target
Scope StringId 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 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
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.