Skip to content

Commit

Permalink
fix: Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMaharshi committed Jul 15, 2024
1 parent 9608ecc commit 722608b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
22 changes: 11 additions & 11 deletions _example/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ module "log-analytics" {

# APP Service
module "windows-web-app" {
source = "../../"
source = "../../"
# enable = true
count = var.enable && var.is_linux_webapp ? 0 :1
count = var.enable && var.is_linux_webapp ? 0 : 1
name = "app"
environment = "testing"
label_order = ["name", "environment", ]
Expand All @@ -39,9 +39,9 @@ module "windows-web-app" {
os_type = var.windows_os_type
sku_name = var.windows_sku_name

#log-analytics
#log-analytics
log_analytics_workspace_id = module.log-analytics.workspace_id
app_insights_workspace_id = module.log-analytics.workspace_id # insights mein log analytics ki workspace id
app_insights_workspace_id = module.log-analytics.workspace_id # insights mein log analytics ki workspace id

#app-service logs
# app_service_logs = var.app_service_logs
Expand All @@ -58,7 +58,7 @@ module "windows-web-app" {
# enable_https = true

site_config = {
use_32_bit_worker_process = true
use_32_bit_worker_process = true
}

# site_config = var.site_config
Expand All @@ -67,15 +67,15 @@ module "windows-web-app" {


app_settings = {
WEBSITE_NODE_DEFAULT_VERSION = "~16"
WEBSITE_NODE_DEFAULT_VERSION = "~16"
# linux_fx_version = "node|18-lts"
}
}


# APP Service
module "linux-web-app" {
source = "../../"
source = "../../"
# enable = true
count = var.enable && var.is_linux_webapp ? 1 : 0
name = "app"
Expand All @@ -87,9 +87,9 @@ module "linux-web-app" {
os_type = var.linux_os_type
sku_name = var.linux_sku_name

#log-analytics
#log-analytics
log_analytics_workspace_id = module.log-analytics.workspace_id
app_insights_workspace_id = module.log-analytics.workspace_id # insights mein log analytics ki workspace id
app_insights_workspace_id = module.log-analytics.workspace_id # insights mein log analytics ki workspace id

#app-service logs
# app_service_logs = var.app_service_logs
Expand All @@ -106,7 +106,7 @@ module "linux-web-app" {
# enable_https = true

site_config = {
use_32_bit_worker_process = true
use_32_bit_worker_process = true
}

# site_config = var.site_config
Expand All @@ -115,7 +115,7 @@ module "linux-web-app" {


app_settings = {
WEBSITE_NODE_DEFAULT_VERSION = "~16"
WEBSITE_NODE_DEFAULT_VERSION = "~16"
# linux_fx_version = "node|18-lts"
}
}
Expand Down
8 changes: 4 additions & 4 deletions _example/complete/variables.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# App Service Plan

variable "windows_sku_name"{
variable "windows_sku_name" {
default = "S1"
}

variable "windows_os_type" {
default = "Windows"
}

variable "linux_sku_name"{
variable "linux_sku_name" {
default = "B1"

}

variable "linux_os_type" {
default = "Linux"

}

variable "enable" {
Expand Down
20 changes: 10 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ locals {
}

auth_settings_v2_login = try(var.auth_settings_v2.login, null) == null ? local.auth_settings_v2_login_default : var.auth_settings_v2.login
resource_group_name = var.resource_group_name
location = var.location
valid_rg_name = var.existing_private_dns_zone == null ? local.resource_group_name : (var.existing_private_dns_zone_resource_group_name == "" ? local.resource_group_name : var.existing_private_dns_zone_resource_group_name)
private_dns_zone_name = var.existing_private_dns_zone == null ? join("", azurerm_private_dns_zone.dnszone.*.name) : var.existing_private_dns_zone
resource_group_name = var.resource_group_name
location = var.location
valid_rg_name = var.existing_private_dns_zone == null ? local.resource_group_name : (var.existing_private_dns_zone_resource_group_name == "" ? local.resource_group_name : var.existing_private_dns_zone_resource_group_name)
private_dns_zone_name = var.existing_private_dns_zone == null ? join("", azurerm_private_dns_zone.dnszone.*.name) : var.existing_private_dns_zone
}

#---------------------------------------------Linux web app-----------------------------------------------------#
Expand All @@ -191,7 +191,7 @@ resource "azurerm_linux_web_app" "main" {
for_each = [local.site_config]

content {
linux_fx_version = lookup(site_config.value, "linux_fx_version", null) # ----> Added
linux_fx_version = lookup(site_config.value, "linux_fx_version", null) # ----> Added
container_registry_managed_identity_client_id = lookup(site_config.value, "container_registry_managed_identity_client_id", null)
container_registry_use_managed_identity = lookup(site_config.value, "container_registry_use_managed_identity", null)

Expand Down Expand Up @@ -497,7 +497,7 @@ resource "azurerm_linux_web_app" "main" {

lifecycle {
ignore_changes = [
app_settings,
app_settings,
site_config.0.application_stack,
site_config.0.cors,
site_config.0.ip_restriction_default_action,
Expand Down Expand Up @@ -527,7 +527,7 @@ resource "azurerm_application_insights" "app_insights" {
retention_in_days = var.retention_in_days
disable_ip_masking = var.disable_ip_masking
tags = module.labels.tags
workspace_id = var.app_insights_workspace_id # Added log analytics workspace id from module in main using this variable app_insights_workspace_id
workspace_id = var.app_insights_workspace_id # Added log analytics workspace id from module in main using this variable app_insights_workspace_id
}

#----------------------------End point ---------------------------------------------------#
Expand Down Expand Up @@ -600,7 +600,7 @@ resource "azurerm_monitor_diagnostic_setting" "diagnostic" {
count = var.enable && var.enable_diagnostic ? 1 : 0
name = format("%s-diagnostic-log", module.labels.id)
target_resource_id = var.enable && var.is_linux_webapp ? azurerm_linux_web_app.main[0].id : azurerm_windows_web_app.main[0].id # Added condition for both linux and windows
log_analytics_workspace_id = var.log_analytics_workspace_id
log_analytics_workspace_id = var.log_analytics_workspace_id
storage_account_id = var.storage_account_id
eventhub_name = var.eventhub_name
eventhub_authorization_rule_id = var.eventhub_authorization_rule_id
Expand Down Expand Up @@ -638,7 +638,7 @@ resource "azurerm_windows_web_app" "main" {
for_each = [local.site_config]

content {
windows_fx_version = lookup(site_config.value, "windows_fx_version", null) # --> Added
windows_fx_version = lookup(site_config.value, "windows_fx_version", null) # --> Added
container_registry_managed_identity_client_id = lookup(site_config.value, "container_registry_managed_identity_client_id", null)
container_registry_use_managed_identity = lookup(site_config.value, "container_registry_use_managed_identity", null)

Expand Down Expand Up @@ -945,7 +945,7 @@ resource "azurerm_windows_web_app" "main" {

lifecycle {
ignore_changes = [
app_settings,
app_settings,
site_config.0.application_stack,
site_config.0.cors,
site_config.0.ip_restriction_default_action,
Expand Down
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ variable "eventhub_authorization_rule_id" {

variable "is_linux_webapp" {
description = "Enable linux web app"
type = bool
default = true
type = bool
default = true
}


Expand Down Expand Up @@ -653,8 +653,8 @@ variable "integration_subnet_id" {
}

variable "app_insights_workspace_id" {
type = string
default = null
type = string
default = null
}

variable "read_permissions" {
Expand Down

0 comments on commit 722608b

Please sign in to comment.