Skip to content

azurermWebPubsub

Manages an Azure Web PubSub 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: "east us",
    name: "terraform-webpubsub",
  }
);
const azurermWebPubsubExample = new azurerm.webPubsub.WebPubsub(
  this,
  "example_1",
  {
    capacity: 1,
    identity: [
      {
        type: "SystemAssigned",
      },
    ],
    live_trace: [
      {
        connectivity_logs_enabled: false,
        enabled: true,
        messaging_logs_enabled: true,
      },
    ],
    location: azurermResourceGroupExample.location,
    name: "tfex-webpubsub",
    public_network_access_enabled: false,
    resource_group_name: azurermResourceGroupExample.name,
    sku: "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.*/
azurermWebPubsubExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Web PubSub service. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the Web PubSub service. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the Web PubSub service exists. Changing this forces a new resource to be created.

  • sku - (Required) Specifies which SKU to use. Possible values are freeF1 and standardS1.

  • capacity - (Optional) Specifies the number of units associated with this Web PubSub resource. Valid values are: Free: 1, Standard: 1, 2, 5, 10, 20, 50, 100.

  • publicNetworkAccessEnabled - (Optional) Whether to enable public network access? Defaults to true.

  • tags - (Optional) A mapping of tags to assign to the resource.

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

  • identity - (Optional) An identity block as defined below.

  • localAuthEnabled - (Optional) Whether to enable local auth? Defaults to true.

  • aadAuthEnabled - (Optional) Whether to enable AAD auth? Defaults to true.

  • tlsClientCertEnabled - (Optional) Whether to request client certificate during TLS handshake? Defaults to false.


A liveTrace block supports the following:

  • enabled - (Optional) Whether the live trace is enabled? Defaults to true.

  • messagingLogsEnabled - (Optional) Whether the log category messagingLogs is enabled? Defaults to true

  • connectivityLogsEnabled - (Optional) Whether the log category connectivityLogs is enabled? Defaults to true

  • httpRequestLogsEnabled - (Optional) Whether the log category httpRequestLogs is enabled? Defaults to true


An identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Web PubSub. Possible values are systemAssigned, userAssigned.

  • identityIds - (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this Web PubSub.

\~> NOTE: This is required when type is set to userAssigned

Attributes Reference

The following attributes are exported:

  • id - The ID of the Web PubSub service.

  • hostname - The FQDN of the Web PubSub service.

  • identity - An identity block as defined below.

  • externalIp - The publicly accessible IP of the Web PubSub service.

  • publicPort - The publicly accessible port of the Web PubSub service which is designed for browser/client use.

  • serverPort - The publicly accessible port of the Web PubSub service which is designed for customer server side use.

  • primaryAccessKey - The primary access key for the Web PubSub service.

  • primaryConnectionString - The primary connection string for the Web PubSub service.

  • secondaryAccessKey - The secondary access key for the Web PubSub service.

  • secondaryConnectionString - The secondary connection string for the Web PubSub service.


An identity block exports the following:

  • principalId - The Principal ID associated with this Managed Service Identity.

  • tenantId - The Tenant ID associated with this Managed Service Identity.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Web PubSub Service.
  • update - (Defaults to 30 minutes) Used when updating the Web PubSub Service.
  • read - (Defaults to 5 minutes) Used when retrieving the Web PubSub Service.
  • delete - (Defaults to 30 minutes) Used when deleting the Web PubSub Service.

Import

Web PubSub services can be imported using the resourceId, e.g.

terraform import azurerm_web_pubsub.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/pubsub1