1. Packages
  2. Azure Classic
  3. API Docs
  4. webpubsub
  5. NetworkAcl

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.webpubsub.NetworkAcl

Explore with Pulumi AI

Manages the Network ACL for a Web Pubsub.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: terraform-webpubsub
      location: east us
  exampleService:
    type: azure:webpubsub:Service
    name: example
    properties:
      name: tfex-webpubsub
      location: ${example.location}
      resourceGroupName: ${example.name}
      sku: Standard_S1
      capacity: 1
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    name: example
    properties:
      name: example-vnet
      resourceGroupName: ${example.name}
      location: ${example.location}
      addressSpaces:
        - 10.5.0.0/16
  exampleSubnet:
    type: azure:network:Subnet
    name: example
    properties:
      name: example-subnet
      resourceGroupName: ${example.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.5.2.0/24
      enforcePrivateLinkEndpointNetworkPolicies: true
  exampleEndpoint:
    type: azure:privatelink:Endpoint
    name: example
    properties:
      name: example-privateendpoint
      resourceGroupName: ${example.name}
      location: ${example.location}
      subnetId: ${exampleSubnet.id}
      privateServiceConnection:
        name: psc-sig-test
        isManualConnection: false
        privateConnectionResourceId: ${exampleService.id}
        subresourceNames:
          - webpubsub
  exampleNetworkAcl:
    type: azure:webpubsub:NetworkAcl
    name: example
    properties:
      webPubsubId: ${exampleService.id}
      defaultAction: Allow
      publicNetwork:
        deniedRequestTypes:
          - ClientConnection
      privateEndpoints:
        - id: ${exampleEndpoint.id}
          deniedRequestTypes:
            - RESTAPI
            - ClientConnection
    options:
      dependsOn:
        - ${exampleEndpoint}
Copy

Create NetworkAcl Resource

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

Constructor syntax

new NetworkAcl(name: string, args: NetworkAclArgs, opts?: CustomResourceOptions);
@overload
def NetworkAcl(resource_name: str,
               args: NetworkAclArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def NetworkAcl(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               public_network: Optional[NetworkAclPublicNetworkArgs] = None,
               web_pubsub_id: Optional[str] = None,
               default_action: Optional[str] = None,
               private_endpoints: Optional[Sequence[NetworkAclPrivateEndpointArgs]] = None)
func NewNetworkAcl(ctx *Context, name string, args NetworkAclArgs, opts ...ResourceOption) (*NetworkAcl, error)
public NetworkAcl(string name, NetworkAclArgs args, CustomResourceOptions? opts = null)
public NetworkAcl(String name, NetworkAclArgs args)
public NetworkAcl(String name, NetworkAclArgs args, CustomResourceOptions options)
type: azure:webpubsub:NetworkAcl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NetworkAclArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NetworkAclArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkAclArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkAclArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NetworkAclArgs
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 networkAclResource = new Azure.WebPubSub.NetworkAcl("networkAclResource", new()
{
    PublicNetwork = new Azure.WebPubSub.Inputs.NetworkAclPublicNetworkArgs
    {
        AllowedRequestTypes = new[]
        {
            "string",
        },
        DeniedRequestTypes = new[]
        {
            "string",
        },
    },
    WebPubsubId = "string",
    DefaultAction = "string",
    PrivateEndpoints = new[]
    {
        new Azure.WebPubSub.Inputs.NetworkAclPrivateEndpointArgs
        {
            Id = "string",
            AllowedRequestTypes = new[]
            {
                "string",
            },
            DeniedRequestTypes = new[]
            {
                "string",
            },
        },
    },
});
Copy
example, err := webpubsub.NewNetworkAcl(ctx, "networkAclResource", &webpubsub.NetworkAclArgs{
	PublicNetwork: &webpubsub.NetworkAclPublicNetworkArgs{
		AllowedRequestTypes: pulumi.StringArray{
			pulumi.String("string"),
		},
		DeniedRequestTypes: pulumi.StringArray{
			pulumi.String("string"),
		},
	},
	WebPubsubId:   pulumi.String("string"),
	DefaultAction: pulumi.String("string"),
	PrivateEndpoints: webpubsub.NetworkAclPrivateEndpointArray{
		&webpubsub.NetworkAclPrivateEndpointArgs{
			Id: pulumi.String("string"),
			AllowedRequestTypes: pulumi.StringArray{
				pulumi.String("string"),
			},
			DeniedRequestTypes: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
	},
})
Copy
var networkAclResource = new NetworkAcl("networkAclResource", NetworkAclArgs.builder()
    .publicNetwork(NetworkAclPublicNetworkArgs.builder()
        .allowedRequestTypes("string")
        .deniedRequestTypes("string")
        .build())
    .webPubsubId("string")
    .defaultAction("string")
    .privateEndpoints(NetworkAclPrivateEndpointArgs.builder()
        .id("string")
        .allowedRequestTypes("string")
        .deniedRequestTypes("string")
        .build())
    .build());
Copy
network_acl_resource = azure.webpubsub.NetworkAcl("networkAclResource",
    public_network={
        "allowed_request_types": ["string"],
        "denied_request_types": ["string"],
    },
    web_pubsub_id="string",
    default_action="string",
    private_endpoints=[{
        "id": "string",
        "allowed_request_types": ["string"],
        "denied_request_types": ["string"],
    }])
Copy
const networkAclResource = new azure.webpubsub.NetworkAcl("networkAclResource", {
    publicNetwork: {
        allowedRequestTypes: ["string"],
        deniedRequestTypes: ["string"],
    },
    webPubsubId: "string",
    defaultAction: "string",
    privateEndpoints: [{
        id: "string",
        allowedRequestTypes: ["string"],
        deniedRequestTypes: ["string"],
    }],
});
Copy
type: azure:webpubsub:NetworkAcl
properties:
    defaultAction: string
    privateEndpoints:
        - allowedRequestTypes:
            - string
          deniedRequestTypes:
            - string
          id: string
    publicNetwork:
        allowedRequestTypes:
            - string
        deniedRequestTypes:
            - string
    webPubsubId: string
Copy

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

PublicNetwork This property is required. NetworkAclPublicNetwork
A public_network block as defined below.
WebPubsubId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
DefaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
PrivateEndpoints List<NetworkAclPrivateEndpoint>
A private_endpoint block as defined below.
PublicNetwork This property is required. NetworkAclPublicNetworkArgs
A public_network block as defined below.
WebPubsubId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
DefaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
PrivateEndpoints []NetworkAclPrivateEndpointArgs
A private_endpoint block as defined below.
publicNetwork This property is required. NetworkAclPublicNetwork
A public_network block as defined below.
webPubsubId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction String
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints List<NetworkAclPrivateEndpoint>
A private_endpoint block as defined below.
publicNetwork This property is required. NetworkAclPublicNetwork
A public_network block as defined below.
webPubsubId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints NetworkAclPrivateEndpoint[]
A private_endpoint block as defined below.
public_network This property is required. NetworkAclPublicNetworkArgs
A public_network block as defined below.
web_pubsub_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
default_action str
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
private_endpoints Sequence[NetworkAclPrivateEndpointArgs]
A private_endpoint block as defined below.
publicNetwork This property is required. Property Map
A public_network block as defined below.
webPubsubId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction String
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints List<Property Map>
A private_endpoint block as defined below.

Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkAcl 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 NetworkAcl Resource

Get an existing NetworkAcl 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?: NetworkAclState, opts?: CustomResourceOptions): NetworkAcl
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_action: Optional[str] = None,
        private_endpoints: Optional[Sequence[NetworkAclPrivateEndpointArgs]] = None,
        public_network: Optional[NetworkAclPublicNetworkArgs] = None,
        web_pubsub_id: Optional[str] = None) -> NetworkAcl
func GetNetworkAcl(ctx *Context, name string, id IDInput, state *NetworkAclState, opts ...ResourceOption) (*NetworkAcl, error)
public static NetworkAcl Get(string name, Input<string> id, NetworkAclState? state, CustomResourceOptions? opts = null)
public static NetworkAcl get(String name, Output<String> id, NetworkAclState state, CustomResourceOptions options)
resources:  _:    type: azure:webpubsub:NetworkAcl    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DefaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
PrivateEndpoints List<NetworkAclPrivateEndpoint>
A private_endpoint block as defined below.
PublicNetwork NetworkAclPublicNetwork
A public_network block as defined below.
WebPubsubId Changes to this property will trigger replacement. string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
DefaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
PrivateEndpoints []NetworkAclPrivateEndpointArgs
A private_endpoint block as defined below.
PublicNetwork NetworkAclPublicNetworkArgs
A public_network block as defined below.
WebPubsubId Changes to this property will trigger replacement. string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction String
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints List<NetworkAclPrivateEndpoint>
A private_endpoint block as defined below.
publicNetwork NetworkAclPublicNetwork
A public_network block as defined below.
webPubsubId Changes to this property will trigger replacement. String
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction string
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints NetworkAclPrivateEndpoint[]
A private_endpoint block as defined below.
publicNetwork NetworkAclPublicNetwork
A public_network block as defined below.
webPubsubId Changes to this property will trigger replacement. string
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
default_action str
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
private_endpoints Sequence[NetworkAclPrivateEndpointArgs]
A private_endpoint block as defined below.
public_network NetworkAclPublicNetworkArgs
A public_network block as defined below.
web_pubsub_id Changes to this property will trigger replacement. str
The ID of the Web Pubsub service. Changing this forces a new resource to be created.
defaultAction String
The default action to control the network access when no other rule matches. Possible values are Allow and Deny. Defaults to Deny.
privateEndpoints List<Property Map>
A private_endpoint block as defined below.
publicNetwork Property Map
A public_network block as defined below.
webPubsubId Changes to this property will trigger replacement. String
The ID of the Web Pubsub service. Changing this forces a new resource to be created.

Supporting Types

NetworkAclPrivateEndpoint
, NetworkAclPrivateEndpointArgs

Id This property is required. string
The ID of the Private Endpoint which is based on the Web Pubsub service.
AllowedRequestTypes List<string>
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
DeniedRequestTypes List<string>

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

Id This property is required. string
The ID of the Private Endpoint which is based on the Web Pubsub service.
AllowedRequestTypes []string
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
DeniedRequestTypes []string

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

id This property is required. String
The ID of the Private Endpoint which is based on the Web Pubsub service.
allowedRequestTypes List<String>
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes List<String>

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

id This property is required. string
The ID of the Private Endpoint which is based on the Web Pubsub service.
allowedRequestTypes string[]
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes string[]

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

id This property is required. str
The ID of the Private Endpoint which is based on the Web Pubsub service.
allowed_request_types Sequence[str]
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
denied_request_types Sequence[str]

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

id This property is required. String
The ID of the Private Endpoint which is based on the Web Pubsub service.
allowedRequestTypes List<String>
The allowed request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes List<String>

The denied request types for the Private Endpoint Connection. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

NetworkAclPublicNetwork
, NetworkAclPublicNetworkArgs

AllowedRequestTypes List<string>
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
DeniedRequestTypes List<string>

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

AllowedRequestTypes []string
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
DeniedRequestTypes []string

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

allowedRequestTypes List<String>
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes List<String>

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

allowedRequestTypes string[]
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes string[]

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

allowed_request_types Sequence[str]
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
denied_request_types Sequence[str]

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

allowedRequestTypes List<String>
The allowed request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.
deniedRequestTypes List<String>

The denied request types for the public network. Possible values are ClientConnection, ServerConnection, RESTAPI and Trace.

NOTE: When default_action is Allow, allowed_request_typescannot be set. When default_action is Deny, denied_request_typescannot be set.

Import

Network ACLs for a Web Pubsub service can be imported using the resource id, e.g.

$ pulumi import azure:webpubsub/networkAcl:NetworkAcl example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/webpubsub1
Copy

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.