azurermSignalrService
Manages an Azure 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: "terraform-signalr",
}
);
const azurermSignalrServiceExample = new azurerm.signalrService.SignalrService(
this,
"example_1",
{
connectivity_logs_enabled: true,
cors: [
{
allowed_origins: ["http://www.example.com"],
},
],
location: azurermResourceGroupExample.location,
messaging_logs_enabled: true,
name: "tfex-signalr",
public_network_access_enabled: false,
resource_group_name: azurermResourceGroupExample.name,
service_mode: "Default",
sku: [
{
capacity: 1,
name: "Free_F1",
},
],
upstream_endpoint: [
{
category_pattern: ["connections", "messages"],
event_pattern: ["*"],
hub_pattern: ["hub1"],
url_template: "http://foo.com",
},
],
}
);
/*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");
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the SignalR service. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which to create the SignalR service. Changing this forces a new resource to be created. -
location
- (Required) Specifies the supported Azure location where the SignalR service exists. Changing this forces a new resource to be created. -
sku
- (Required) Asku
block as documented below. -
cors
- (Optional) Acors
block as documented below. -
connectivityLogsEnabled
- (Optional) Specifies if Connectivity Logs are enabled or not. Defaults tofalse
. -
messagingLogsEnabled
- (Optional) Specifies if Messaging Logs are enabled or not. Defaults tofalse
. -
liveTraceEnabled
- (Optional) Specifies if Live Trace is enabled or not. Defaults tofalse
. -
identity
- (Optional) Anidentity
block as defined below. -
publicNetworkAccessEnabled
- (Optional) Whether to enable public network access? Defaults totrue
.
\~> Note: publicNetworkAccessEnabled
cannot be set to false
in free
sku tier.
-
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
.
\~> Note: tlsClientCertEnabled
cannot be set to true
in free
sku tier.
-
serverlessConnectionTimeoutInSeconds
- (Optional) Specifies the client connection timeout. Defaults to30
. -
serviceMode
- (Optional) Specifies the service mode. Possible values areclassic
,default
andserverless
. Defaults todefault
. -
upstreamEndpoint
- (Optional) AnupstreamEndpoint
block as documented below. Using this block requires the SignalR service to be Serverless. When creating multiple blocks they will be processed in the order they are defined in. -
liveTrace
- (Optional) AliveTrace
block as defined below. -
tags
- (Optional) A mapping of tags to assign to the resource.
A cors
block supports the following:
allowedOrigins
- (Required) A list of origins which should be able to make cross-origin calls.*
can be used to allow all calls.
An upstreamEndpoint
block supports the following:
-
urlTemplate
- (Required) The upstream URL Template. This can be a url or a template such ashttp://hostCom/{hub}/api/{category}/{event}
. -
categoryPattern
- (Required) The categories to match on, or*
for all. -
eventPattern
- (Required) The events to match on, or*
for all. -
hubPattern
- (Required) The hubs to match on, or*
for all.
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
A sku
block supports the following:
-
name
- (Required) Specifies which tier to use. Valid values arefreeF1
,standardS1
andpremiumP1
. -
capacity
- (Required) Specifies the number of units associated with this SignalR service. Valid values are1
,2
,5
,10
,20
,50
and100
.
An identity
block supports the following:
-
type
- (Required) Specifies the type of Managed Service Identity that should be configured on this signalR. Possible values aresystemAssigned
,userAssigned
. -
identityIds
- (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this signalR.
\~> NOTE: This is required when type
is set to userAssigned
Attributes Reference
The following attributes are exported:
-
id
- The ID of the SignalR service. -
hostname
- The FQDN of the SignalR service. -
ipAddress
- The publicly accessible IP of the SignalR service. -
publicPort
- The publicly accessible port of the SignalR service which is designed for browser/client use. -
serverPort
- The publicly accessible port of the SignalR service which is designed for customer server side use. -
primaryAccessKey
- The primary access key for the SignalR service. -
primaryConnectionString
- The primary connection string for the SignalR service. -
secondaryAccessKey
- The secondary access key for the SignalR service. -
secondaryConnectionString
- The secondary connection string for the SignalR service.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the SignalR Service.update
- (Defaults to 30 minutes) Used when updating the SignalR Service.read
- (Defaults to 5 minutes) Used when retrieving the SignalR Service.delete
- (Defaults to 30 minutes) Used when deleting the SignalR Service.
Import
SignalR services can be imported using the resourceId
, e.g.