205 lines
5.8 KiB
HCL
205 lines
5.8 KiB
HCL
# module "static_web_app" {
|
|
# source = "./modules/static_web_app"
|
|
# region = var.REGION
|
|
# resource_group_name = azurerm_resource_group.resource_group.name
|
|
# static_web_app_name = var.STATIC_WEB_APP_NAME
|
|
# custom_domain_name_count = var.CUSTOM_DOMAIN_NAME_COUNT
|
|
# domain_name = var.DOMAIN_NAME
|
|
# subdomain_name = var.SUBDOMAIN_NAME
|
|
# }
|
|
|
|
# resource "azurerm_static_web_app" "static_web_app" {
|
|
# name = var.STATIC_WEB_APP_NAME
|
|
# resource_group_name = azurerm_resource_group.resource_group.name
|
|
# location = var.REGION
|
|
# }
|
|
|
|
# resource "azurerm_static_web_app_custom_domain" "static_web_app_custom_domain" {
|
|
# static_web_app_id = azurerm_static_web_app.static_web_app.id
|
|
# domain_name = var.WEBSITE_NAME
|
|
# validation_type = "dns-txt-token"
|
|
# }
|
|
|
|
# resource "azurerm_dns_a_record" "dns_a_record" {
|
|
# name = var.WEBSITE_NAME == var.DOMAIN_NAME ? "@" : split(".", var.WEBSITE_NAME)[0]
|
|
# zone_name = azurerm_dns_zone.dns_zone.name
|
|
# resource_group_name = azurerm_resource_group.resource_group.name
|
|
# ttl = 14400
|
|
# target_resource_id = azurerm_static_web_app.static_web_app.id
|
|
# }
|
|
|
|
# resource "azurerm_dns_cname_record" "dns_cname_record" {
|
|
# name = "www"
|
|
# zone_name = azurerm_dns_zone.dns_zone.name
|
|
# resource_group_name = azurerm_resource_group.resource_group.name
|
|
# ttl = 14400
|
|
# record = azurerm_static_web_app.static_web_app.default_host_name
|
|
# }
|
|
|
|
# resource "azurerm_static_web_app_custom_domain" "static_web_app_custom_domain_www" {
|
|
# static_web_app_id = azurerm_static_web_app.static_web_app.id
|
|
# domain_name = "www.${var.DOMAIN_NAME}"
|
|
# validation_type = "cname-delegation"
|
|
|
|
# depends_on = [ azurerm_dns_cname_record.dns_cname_record ]
|
|
# }
|
|
|
|
|
|
# data "azurerm_client_config" "current" {
|
|
# }
|
|
|
|
# resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {
|
|
# name = module.environment.log_analytics_workspace_name
|
|
# location = data.azurerm_resource_group.resource_group.location
|
|
# resource_group_name = data.azurerm_resource_group.resource_group.name
|
|
# sku = "PerGB2018"
|
|
# retention_in_days = 30
|
|
# }
|
|
|
|
# resource "azurerm_container_app_environment" "container_app_environment" {
|
|
# name = module.environment.container_app_environment_name
|
|
# location = data.azurerm_resource_group.resource_group.location
|
|
# resource_group_name = data.azurerm_resource_group.resource_group.name
|
|
# log_analytics_workspace_id = azurerm_log_analytics_workspace.log_analytics_workspace.id
|
|
# }
|
|
|
|
# resource "azurerm_container_app" "container_app_api" {
|
|
# name = module.environment.container_app_api_name
|
|
# container_app_environment_id = azurerm_container_app_environment.container_app_environment.id
|
|
# resource_group_name = data.azurerm_resource_group.resource_group.name
|
|
# revision_mode = "Single"
|
|
|
|
# registry {
|
|
# server = "index.docker.io"
|
|
# username = var.DOCKER_IO_USERNAME
|
|
# password_secret_name = "docker-io-password"
|
|
# }
|
|
|
|
# template {
|
|
# min_replicas = 0
|
|
# max_replicas = 2
|
|
|
|
# container {
|
|
# name = module.environment.container_app_api_container_name
|
|
# image = module.environment.container_app_api_container_image
|
|
# cpu = 0.25
|
|
# memory = "0.5Gi"
|
|
|
|
# env {
|
|
# name = "AZURE_STORAGE_CONNECTION_STRING"
|
|
# secret_name = "azure-storage-connection-string"
|
|
# }
|
|
|
|
# env {
|
|
# name = "CLIENT_ID"
|
|
# secret_name = "client-id"
|
|
# }
|
|
|
|
# env {
|
|
# name = "CLIENT_SECRET"
|
|
# secret_name = "client-secret"
|
|
# }
|
|
|
|
# env {
|
|
# name = "TENANT_ID"
|
|
# secret_name = "tenant-id"
|
|
# }
|
|
# }
|
|
# }
|
|
|
|
# ingress {
|
|
# allow_insecure_connections = false
|
|
# external_enabled = true
|
|
# target_port = 3000
|
|
# transport = "auto"
|
|
|
|
# traffic_weight {
|
|
# latest_revision = true
|
|
# percentage = 100
|
|
# }
|
|
# }
|
|
|
|
# secret {
|
|
# name = "docker-io-password"
|
|
# value = var.DOCKER_IO_PASSWORD
|
|
# }
|
|
|
|
# secret {
|
|
# name = "azure-storage-connection-string"
|
|
# value = azurerm_storage_account.storage_account.primary_connection_string
|
|
# }
|
|
|
|
# secret {
|
|
# name = "client-id"
|
|
# value = var.CLIENT_ID
|
|
# }
|
|
|
|
# secret {
|
|
# name = "client-secret"
|
|
# value = var.CLIENT_SECRET
|
|
# }
|
|
|
|
# secret {
|
|
# name = "tenant-id"
|
|
# value = var.TENANT_ID
|
|
# }
|
|
|
|
# lifecycle {
|
|
# ignore_changes = [ template[0].container[0].image ]
|
|
# }
|
|
# }
|
|
|
|
# resource "azurerm_container_app" "container_app_app" {
|
|
# name = module.environment.container_app_app_name
|
|
# container_app_environment_id = azurerm_container_app_environment.container_app_environment.id
|
|
# resource_group_name = data.azurerm_resource_group.resource_group.name
|
|
# revision_mode = "Single"
|
|
|
|
# registry {
|
|
# server = "index.docker.io"
|
|
# username = var.DOCKER_IO_USERNAME
|
|
# password_secret_name = "docker-io-password"
|
|
# }
|
|
|
|
# template {
|
|
# min_replicas = 0
|
|
# max_replicas = 2
|
|
|
|
# container {
|
|
# name = module.environment.container_app_app_container_name
|
|
# image = module.environment.container_app_app_container_image
|
|
# cpu = 0.25
|
|
# memory = "0.5Gi"
|
|
# }
|
|
# }
|
|
|
|
# ingress {
|
|
# allow_insecure_connections = false
|
|
# external_enabled = true
|
|
# target_port = 8080
|
|
# transport = "auto"
|
|
|
|
# traffic_weight {
|
|
# latest_revision = true
|
|
# percentage = 100
|
|
# }
|
|
# }
|
|
|
|
# secret {
|
|
# name = "docker-io-password"
|
|
# value = var.DOCKER_IO_PASSWORD
|
|
# }
|
|
|
|
# lifecycle {
|
|
# ignore_changes = [ template[0].container[0].image ]
|
|
# }
|
|
# }
|
|
|
|
# resource "azurerm_container_app_custom_domain" "custom_domain" {
|
|
# name = trimsuffix(trimprefix(azurerm_dns_txt_record.dns_txt_record.fqdn, "asuid."), ".")
|
|
# container_app_id = azurerm_container_app.container_app_app.id
|
|
|
|
# lifecycle {
|
|
# ignore_changes = [ certificate_binding_type, container_app_environment_certificate_id ]
|
|
# }
|
|
# } |