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 arefreeF1
andstandardS1
. -
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 totrue
. -
tags
- (Optional) A mapping of tags to assign to the resource. -
liveTrace
- (Optional) AliveTrace
block as defined below. -
identity
- (Optional) Anidentity
block as defined below. -
localAuthEnabled
- (Optional) Whether to enable local auth? Defaults totrue
. -
aadAuthEnabled
- (Optional) Whether to enable AAD auth? Defaults totrue
. -
tlsClientCertEnabled
- (Optional) Whether to request client certificate during TLS handshake? Defaults tofalse
.
A liveTrace
block supports the following:
-
enabled
- (Optional) Whether the live trace is enabled? Defaults totrue
. -
messagingLogsEnabled
- (Optional) Whether the log categorymessagingLogs
is enabled? Defaults totrue
-
connectivityLogsEnabled
- (Optional) Whether the log categoryconnectivityLogs
is enabled? Defaults totrue
-
httpRequestLogsEnabled
- (Optional) Whether the log categoryhttpRequestLogs
is enabled? Defaults totrue
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 aresystemAssigned
,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
- Anidentity
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.