Skip to content

azurermSignalrServiceNetworkAcl

Manages the Network ACL for a SignalR service.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermSignalrServiceExample = new azurerm.signalrService.SignalrService(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-signalr",
    resource_group_name: azurermResourceGroupExample.name,
    sku: [
      {
        capacity: 1,
        name: "Standard_S1",
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSignalrServiceExample.overrideLogicalId("example");
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_2",
  {
    address_space: ["10.5.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "example-vnet",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_3", {
  address_prefixes: ["10.5.2.0/24"],
  enforce_private_link_endpoint_network_policies: true,
  name: "example-subnet",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermPrivateEndpointExample =
  new azurerm.privateEndpoint.PrivateEndpoint(this, "example_4", {
    location: azurermResourceGroupExample.location,
    name: "example-privateendpoint",
    private_service_connection: [
      {
        is_manual_connection: false,
        name: "psc-sig-test",
        private_connection_resource_id: azurermSignalrServiceExample.id,
        subresource_names: ["signalr"],
      },
    ],
    resource_group_name: azurermResourceGroupExample.name,
    subnet_id: azurermSubnetExample.id,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPrivateEndpointExample.overrideLogicalId("example");
const azurermSignalrServiceNetworkAclExample =
  new azurerm.signalrServiceNetworkAcl.SignalrServiceNetworkAcl(
    this,
    "example_5",
    {
      default_action: "Deny",
      private_endpoint: [
        {
          allowed_request_types: ["ServerConnection"],
          id: azurermPrivateEndpointExample.id,
        },
      ],
      public_network: [
        {
          allowed_request_types: ["ClientConnection"],
        },
      ],
      signalr_service_id: azurermSignalrServiceExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSignalrServiceNetworkAclExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • signalrServiceId - (Required) The ID of the SignalR service. Changing this forces a new resource to be created.

  • defaultAction - (Required) The default action to control the network access when no other rule matches. Possible values are allow and deny.

  • publicNetwork - (Required) A publicNetwork block as defined below.

  • privateEndpoint - (Optional) A privateEndpoint block as defined below.


A publicNetwork block supports the following:

  • allowedRequestTypes - (Optional) The allowed request types for the public network. Possible values are clientConnection, serverConnection, restapi and trace.

\~> Note: When defaultAction is allow, allowedRequestTypescannot be set.

  • deniedRequestTypes - (Optional) The denied request types for the public network. Possible values are clientConnection, serverConnection, restapi and trace.

\~> Note: When defaultAction is deny, deniedRequestTypescannot be set.

\~> Note: allowedRequestTypes - (Optional) and deniedRequestTypes cannot be set together.


A privateEndpoint block supports the following:

  • id - (Required) The ID of the Private Endpoint which is based on the SignalR service.

  • allowedRequestTypes - (Optional) The allowed request types for the Private Endpoint Connection. Possible values are clientConnection, serverConnection, restapi and trace.

\~> Note: When defaultAction is allow, allowedRequestTypescannot be set.

  • deniedRequestTypes - (Optional) The denied request types for the Private Endpoint Connection. Possible values are clientConnection, serverConnection, restapi and trace.

\~> Note: When defaultAction is deny, deniedRequestTypescannot be set.

\~> Note: allowedRequestTypes - (Optional) and deniedRequestTypes cannot be set together.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the SignalR service.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Network ACL of the SignalR service
  • read - (Defaults to 5 minutes) Used when retrieving the Network ACL of the SignalR service
  • update - (Defaults to 30 minutes) Used when updating the Network ACL of the SignalR service
  • delete - (Defaults to 30 minutes) Used when deleting the Network ACL of the SignalR service

Import

Network ACLs for a SignalR service can be imported using the resourceId, e.g.

terraform import azurerm_signalr_service_network_acl.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/signalR/signalr1