Azure module to deploy a Azure Static Web Apps.
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 |
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.
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.
module "static_web_app" {
source = "claranet/static-web-app/azurerm"
version = "x.x.x"
location = module.azure_region.location
location_short = module.azure_region.location_short
resource_group_name = module.rg.name
client_name = var.client_name
environment = var.environment
stack = var.stack
logs_destinations_ids = [
module.run.logs_storage_account_id,
module.run.log_analytics_workspace_id
]
extra_tags = {
foo = "bar"
}
}
Name | Version |
---|---|
azurecaf | ~> 1.2.28 |
azurerm | ~> 4.31 |
Name | Source | Version |
---|---|---|
diagnostics | claranet/diagnostic-settings/azurerm | ~> 8.0 |
Name | Type |
---|---|
azurerm_static_web_app.main | resource |
azurerm_static_web_app_custom_domain.main | resource |
azurecaf_name.static_web_app | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
app_settings | App settings for the Static Web App. | map(string) |
null |
no |
basic_auth | Basic authentication block information. | object({ |
null |
no |
client_name | Client name/account used in naming. | string |
n/a | yes |
configuration_file_changes_enabled | Should changes to the configuration file be permitted. | bool |
true |
no |
custom_domains | Custom domains block information. | list(object({ |
[] |
no |
custom_name | Custom Azure Static Web Apps, generated if not set. | string |
"" |
no |
default_tags_enabled | Option to enable or disable default tags. | bool |
true |
no |
diagnostic_settings_custom_name | Custom name of the diagnostics settings, name will be default if not set. |
string |
"default" |
no |
environment | Project environment. | string |
n/a | yes |
extra_tags | Additional tags to add on resources. | map(string) |
{} |
no |
identity | Identity block information. | object({ |
{} |
no |
location | Azure region to use. | string |
n/a | yes |
location_short | Short string for Azure location. | string |
n/a | yes |
logs_categories | Log categories to send to destinations. | list(string) |
null |
no |
logs_destinations_ids | List of destination resources IDs for logs diagnostic destination. Can be Storage Account , Log Analytics Workspace and Event Hub . No more than one of each can be set.If you want to use Azure EventHub as a destination, you must provide a formatted string containing both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the | character. |
list(string) |
n/a | yes |
logs_metrics_categories | Metrics categories to send to destinations. | list(string) |
null |
no |
name_prefix | Optional prefix for the generated name. | string |
"" |
no |
name_suffix | Optional suffix for the generated name. | string |
"" |
no |
preview_environments_enabled | Should preview environments be enabled. | bool |
true |
no |
public_network_access_enabled | Whether the Azure Static Web Apps is available from public network. | bool |
false |
no |
repository | Repository block information. | object({ |
null |
no |
resource_group_name | Name of the resource group. | string |
n/a | yes |
sku | The SKU of the Static Web App. | string |
"Standard" |
no |
stack | Project stack name. | string |
n/a | yes |
Name | Description |
---|---|
api_key | Azure Static Web Apps API key. |
default_hostname | Azure Static Web Apps default hostname. |
id | Azure Static Web Apps ID. |
identity_principal_id | Azure Static Web Apps system identity principal ID. |
module_diagnostics | Diagnostics settings module outputs. |
name | Azure Static Web Apps name. |
resource | Azure Static Web Apps resource object. |
resource_custom_domains | Azure Static Web Apps custom domains. |
Microsoft Azure documentation: xxxx