We recommend using Azure Native.
Manages a Network Security Perimeter Association.
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 exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
name: "example",
location: "West Europe",
resourceGroupName: example.name,
});
const exampleNetworkSecurityPerimeter = new azure.network.NetworkSecurityPerimeter("example", {
name: "example",
resourceGroupName: example.name,
location: "West Europe",
});
const exampleNetworkSecurityPerimeterProfile = new azure.network.NetworkSecurityPerimeterProfile("example", {
name: "example",
networkSecurityPerimeterId: exampleNetworkSecurityPerimeter.id,
});
const exampleNetworkSecurityPerimeterAssociation = new azure.network.NetworkSecurityPerimeterAssociation("example", {
name: "example",
accessMode: "Enforced",
networkSecurityPerimeterProfileId: exampleNetworkSecurityPerimeterProfile.id,
resourceId: exampleAnalyticsWorkspace.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
name="example",
location="West Europe",
resource_group_name=example.name)
example_network_security_perimeter = azure.network.NetworkSecurityPerimeter("example",
name="example",
resource_group_name=example.name,
location="West Europe")
example_network_security_perimeter_profile = azure.network.NetworkSecurityPerimeterProfile("example",
name="example",
network_security_perimeter_id=example_network_security_perimeter.id)
example_network_security_perimeter_association = azure.network.NetworkSecurityPerimeterAssociation("example",
name="example",
access_mode="Enforced",
network_security_perimeter_profile_id=example_network_security_perimeter_profile.id,
resource_id=example_analytics_workspace.id)
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-azure/sdk/v6/go/azure/operationalinsights"
"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
}
exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
Name: pulumi.String("example"),
Location: pulumi.String("West Europe"),
ResourceGroupName: example.Name,
})
if err != nil {
return err
}
exampleNetworkSecurityPerimeter, err := network.NewNetworkSecurityPerimeter(ctx, "example", &network.NetworkSecurityPerimeterArgs{
Name: pulumi.String("example"),
ResourceGroupName: example.Name,
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleNetworkSecurityPerimeterProfile, err := network.NewNetworkSecurityPerimeterProfile(ctx, "example", &network.NetworkSecurityPerimeterProfileArgs{
Name: pulumi.String("example"),
NetworkSecurityPerimeterId: exampleNetworkSecurityPerimeter.ID(),
})
if err != nil {
return err
}
_, err = network.NewNetworkSecurityPerimeterAssociation(ctx, "example", &network.NetworkSecurityPerimeterAssociationArgs{
Name: pulumi.String("example"),
AccessMode: pulumi.String("Enforced"),
NetworkSecurityPerimeterProfileId: exampleNetworkSecurityPerimeterProfile.ID(),
ResourceId: exampleAnalyticsWorkspace.ID(),
})
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 exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
{
Name = "example",
Location = "West Europe",
ResourceGroupName = example.Name,
});
var exampleNetworkSecurityPerimeter = new Azure.Network.NetworkSecurityPerimeter("example", new()
{
Name = "example",
ResourceGroupName = example.Name,
Location = "West Europe",
});
var exampleNetworkSecurityPerimeterProfile = new Azure.Network.NetworkSecurityPerimeterProfile("example", new()
{
Name = "example",
NetworkSecurityPerimeterId = exampleNetworkSecurityPerimeter.Id,
});
var exampleNetworkSecurityPerimeterAssociation = new Azure.Network.NetworkSecurityPerimeterAssociation("example", new()
{
Name = "example",
AccessMode = "Enforced",
NetworkSecurityPerimeterProfileId = exampleNetworkSecurityPerimeterProfile.Id,
ResourceId = exampleAnalyticsWorkspace.Id,
});
});
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.operationalinsights.AnalyticsWorkspace;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
import com.pulumi.azure.network.NetworkSecurityPerimeter;
import com.pulumi.azure.network.NetworkSecurityPerimeterArgs;
import com.pulumi.azure.network.NetworkSecurityPerimeterProfile;
import com.pulumi.azure.network.NetworkSecurityPerimeterProfileArgs;
import com.pulumi.azure.network.NetworkSecurityPerimeterAssociation;
import com.pulumi.azure.network.NetworkSecurityPerimeterAssociationArgs;
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());
var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
.name("example")
.location("West Europe")
.resourceGroupName(example.name())
.build());
var exampleNetworkSecurityPerimeter = new NetworkSecurityPerimeter("exampleNetworkSecurityPerimeter", NetworkSecurityPerimeterArgs.builder()
.name("example")
.resourceGroupName(example.name())
.location("West Europe")
.build());
var exampleNetworkSecurityPerimeterProfile = new NetworkSecurityPerimeterProfile("exampleNetworkSecurityPerimeterProfile", NetworkSecurityPerimeterProfileArgs.builder()
.name("example")
.networkSecurityPerimeterId(exampleNetworkSecurityPerimeter.id())
.build());
var exampleNetworkSecurityPerimeterAssociation = new NetworkSecurityPerimeterAssociation("exampleNetworkSecurityPerimeterAssociation", NetworkSecurityPerimeterAssociationArgs.builder()
.name("example")
.accessMode("Enforced")
.networkSecurityPerimeterProfileId(exampleNetworkSecurityPerimeterProfile.id())
.resourceId(exampleAnalyticsWorkspace.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAnalyticsWorkspace:
type: azure:operationalinsights:AnalyticsWorkspace
name: example
properties:
name: example
location: West Europe
resourceGroupName: ${example.name}
exampleNetworkSecurityPerimeter:
type: azure:network:NetworkSecurityPerimeter
name: example
properties:
name: example
resourceGroupName: ${example.name}
location: West Europe
exampleNetworkSecurityPerimeterProfile:
type: azure:network:NetworkSecurityPerimeterProfile
name: example
properties:
name: example
networkSecurityPerimeterId: ${exampleNetworkSecurityPerimeter.id}
exampleNetworkSecurityPerimeterAssociation:
type: azure:network:NetworkSecurityPerimeterAssociation
name: example
properties:
name: example
accessMode: Enforced
networkSecurityPerimeterProfileId: ${exampleNetworkSecurityPerimeterProfile.id}
resourceId: ${exampleAnalyticsWorkspace.id}
API Providers
This resource uses the following Azure API Providers:
Microsoft.Network- 2025-01-01
Create NetworkSecurityPerimeterAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NetworkSecurityPerimeterAssociation(name: string, args: NetworkSecurityPerimeterAssociationArgs, opts?: CustomResourceOptions);@overload
def NetworkSecurityPerimeterAssociation(resource_name: str,
args: NetworkSecurityPerimeterAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NetworkSecurityPerimeterAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_mode: Optional[str] = None,
network_security_perimeter_profile_id: Optional[str] = None,
resource_id: Optional[str] = None,
name: Optional[str] = None)func NewNetworkSecurityPerimeterAssociation(ctx *Context, name string, args NetworkSecurityPerimeterAssociationArgs, opts ...ResourceOption) (*NetworkSecurityPerimeterAssociation, error)public NetworkSecurityPerimeterAssociation(string name, NetworkSecurityPerimeterAssociationArgs args, CustomResourceOptions? opts = null)
public NetworkSecurityPerimeterAssociation(String name, NetworkSecurityPerimeterAssociationArgs args)
public NetworkSecurityPerimeterAssociation(String name, NetworkSecurityPerimeterAssociationArgs args, CustomResourceOptions options)
type: azure:network:NetworkSecurityPerimeterAssociation
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 NetworkSecurityPerimeterAssociationArgs
- 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 NetworkSecurityPerimeterAssociationArgs
- 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 NetworkSecurityPerimeterAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkSecurityPerimeterAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkSecurityPerimeterAssociationArgs
- 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 networkSecurityPerimeterAssociationResource = new Azure.Network.NetworkSecurityPerimeterAssociation("networkSecurityPerimeterAssociationResource", new()
{
AccessMode = "string",
NetworkSecurityPerimeterProfileId = "string",
ResourceId = "string",
Name = "string",
});
example, err := network.NewNetworkSecurityPerimeterAssociation(ctx, "networkSecurityPerimeterAssociationResource", &network.NetworkSecurityPerimeterAssociationArgs{
AccessMode: pulumi.String("string"),
NetworkSecurityPerimeterProfileId: pulumi.String("string"),
ResourceId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var networkSecurityPerimeterAssociationResource = new NetworkSecurityPerimeterAssociation("networkSecurityPerimeterAssociationResource", NetworkSecurityPerimeterAssociationArgs.builder()
.accessMode("string")
.networkSecurityPerimeterProfileId("string")
.resourceId("string")
.name("string")
.build());
network_security_perimeter_association_resource = azure.network.NetworkSecurityPerimeterAssociation("networkSecurityPerimeterAssociationResource",
access_mode="string",
network_security_perimeter_profile_id="string",
resource_id="string",
name="string")
const networkSecurityPerimeterAssociationResource = new azure.network.NetworkSecurityPerimeterAssociation("networkSecurityPerimeterAssociationResource", {
accessMode: "string",
networkSecurityPerimeterProfileId: "string",
resourceId: "string",
name: "string",
});
type: azure:network:NetworkSecurityPerimeterAssociation
properties:
accessMode: string
name: string
networkSecurityPerimeterProfileId: string
resourceId: string
NetworkSecurityPerimeterAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The NetworkSecurityPerimeterAssociation resource accepts the following input properties:
- Access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - Network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- Resource
Id string - Name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- Access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - Network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- Resource
Id string - Name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- access
Mode String - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - network
Security StringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id String - name String
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id string - name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- access_
mode str - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - network_
security_ strperimeter_ profile_ id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource_
id str - name str
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- access
Mode String - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - network
Security StringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id String - name String
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkSecurityPerimeterAssociation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing NetworkSecurityPerimeterAssociation Resource
Get an existing NetworkSecurityPerimeterAssociation 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?: NetworkSecurityPerimeterAssociationState, opts?: CustomResourceOptions): NetworkSecurityPerimeterAssociation@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_mode: Optional[str] = None,
name: Optional[str] = None,
network_security_perimeter_profile_id: Optional[str] = None,
resource_id: Optional[str] = None) -> NetworkSecurityPerimeterAssociationfunc GetNetworkSecurityPerimeterAssociation(ctx *Context, name string, id IDInput, state *NetworkSecurityPerimeterAssociationState, opts ...ResourceOption) (*NetworkSecurityPerimeterAssociation, error)public static NetworkSecurityPerimeterAssociation Get(string name, Input<string> id, NetworkSecurityPerimeterAssociationState? state, CustomResourceOptions? opts = null)public static NetworkSecurityPerimeterAssociation get(String name, Output<String> id, NetworkSecurityPerimeterAssociationState state, CustomResourceOptions options)resources: _: type: azure:network:NetworkSecurityPerimeterAssociation get: id: ${id}- 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.
- Access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - Name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- Network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- Resource
Id string
- Access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - Name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- Network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- Resource
Id string
- access
Mode String - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - name String
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- network
Security StringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id String
- access
Mode string - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - name string
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- network
Security stringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id string
- access_
mode str - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - name str
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- network_
security_ strperimeter_ profile_ id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource_
id str
- access
Mode String - Access mode for the associated resource on the Network Security Perimeter. Possible values are
Audit,Enforced, andLearning. - name String
- The name which should be used for this Network Security Perimeter Association. Changing this forces a new Network Security Perimeter Association to be created.
- network
Security StringPerimeter Profile Id - The ID of the Network Security Perimeter Profile. Changing this forces a new Network Security Perimeter Association to be created.
- resource
Id String
Import
Network Security Perimeter Associations can be imported using the resource id, e.g.
$ pulumi import azure:network/networkSecurityPerimeterAssociation:NetworkSecurityPerimeterAssociation example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/networkSecurityPerimeters/example-nsp/resourceAssociations/example-assoc
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
azurermTerraform Provider.
