Skip to content

claranet/terraform-azurerm-signalr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure SignalR Service

Changelog Notice Apache V2 License OpenTofu Registry

This terraform module creates an Azure SignalR service and its associated Network Rules when needed. Diagnostic settings are also deployed.

Global versioning rule for Claranet Azure modules

Module version Terraform version OpenTofu version AzureRM version
>= 8.x.x Unverified 1.8.x >= 4.0
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with Hashicorp Terraform. Instead, we recommend to use OpenTofu.

module "azure_region" {
  source  = "claranet/regions/azurerm"
  version = "x.x.x"

  azure_region = var.azure_region
}

module "rg" {
  source  = "claranet/rg/azurerm"
  version = "x.x.x"

  location    = module.azure_region.location
  client_name = var.client_name
  environment = var.environment
  stack       = var.stack
}

module "signalr" {
  source  = "claranet/signalr/azurerm"
  version = "x.x.x"

  client_name         = var.client_name
  environment         = var.environment
  stack               = var.stack
  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name

  sku = {
    name     = "Standard_S1"
    capacity = 1
  }

  network_rules = [
    {
      name      = "AllowClientConnection"
      rule_type = "allow"
      endpoint  = "public-network"
      services  = ["ClientConnection"]
    },
    {
      name      = "DenyAllOthers"
      rule_type = "deny"
      endpoint  = "public-network"
      services  = ["ServerConnection", "RESTAPI"]
    }
  ]
}

Providers

Name Version
azurecaf ~> 1.2, >= 1.2.22
azurerm >= 3.58
null >= 2.0

Modules

No modules.

Resources

Name Type
azurerm_signalr_service.signalr resource
null_resource.signalr_rule resource
azurecaf_name.signalr data source
azurerm_subscription.current data source

Inputs

Name Description Type Default Required
allowed_origins A List of origins which should be able to make cross-origin calls. list(string) [] no
client_name Client name string n/a yes
connectivity_logs_enabled Specifies if Connectivity Logs are enabled or not bool false no
custom_name Custom name for signalr service. Autogenerated if not set. string null no
default_tags_enabled Option to enable or disable default tags bool true no
environment Environment name string n/a yes
extra_tags Tags to add to the resource map(string) null no
live_trace_enabled Specifies if Live Trace is enabled or not bool false no
location Azure location for App Service Plan. string n/a yes
location_short Short string for Azure location. string n/a yes
messaging_logs_enabled Specifies if Messaging Logs are enabled or not bool false no
name_prefix Optional prefix for the generated name string "" no
name_suffix Optional suffix for the generated name string "" no
network_rules Network Rules to apply to SignalR.
name Name of the rule
rule_type allowed values are allow or deny
endpoint allowed values public-network or the name of the private link
services allowed values ["ClientConnection", "ServerConnection", "RESTAPI"]
list(object({
name = string
rule_type = string
endpoint = string
services = list(string)
}))
[] no
public_network_access_enabled Specifies if the public access is enabled or not. bool false no
resource_group_name Resource group name string n/a yes
service_mode Specifies the service mode string "Default" no
sku Signalr SKU
object({
name = string,
capacity = number
})
{
"capacity": 1,
"name": "Free_F1"
}
no
stack Stack name string n/a yes
use_caf_naming Use the Azure CAF naming provider to generate default resource name. custom_name override this if set. Legacy default name is used if this is set to false. bool true no

Outputs

Name Description
hostname The FQDN of the SignalR service
id The ID of the SignalR service.
primary_access_key The primary access key for the SignalR service.
primary_connection_string The primary connection string for the SignalR service.
public_port The publicly accessible port of the SignalR service which is designed for browser/client use.
secondary_access_key The secondary access key for the SignalR service.
secondary_connection_string The secondary connection string for the SignalR service.
server_port The publicly accessible port of the SignalR service which is designed for customer server side use.

Related documentations