From 39b6e20b5bd74bd5c0c37fc7afe057dd54fc662d Mon Sep 17 00:00:00 2001 From: NotMaharshi Date: Wed, 7 Aug 2024 16:25:39 +0530 Subject: [PATCH] fix: code cleanup, removed unnecessary comments --- _example/complete/linux_web_app/main.tf | 4 ++-- _example/complete/linux_web_app/versions.tf | 2 +- _example/complete/windows_web_app/main.tf | 6 ++--- _example/complete/windows_web_app/versions.tf | 2 +- main.tf | 9 ++----- variables.tf | 24 ------------------- versions.tf | 2 +- 7 files changed, 10 insertions(+), 39 deletions(-) diff --git a/_example/complete/linux_web_app/main.tf b/_example/complete/linux_web_app/main.tf index 2bf97bb..0735b30 100644 --- a/_example/complete/linux_web_app/main.tf +++ b/_example/complete/linux_web_app/main.tf @@ -50,7 +50,7 @@ module "linux-web-app" { ##----------------------------------------------------------------------------- ## To Deploy Container ##----------------------------------------------------------------------------- - use_docker = true + use_docker = false docker_image_name = var.docker_image_name docker_registry_url = ".azurecr.io" docker_registry_username = "" @@ -60,7 +60,7 @@ module "linux-web-app" { ##----------------------------------------------------------------------------- ## Node application ##----------------------------------------------------------------------------- - use_node = false + use_node = true node_version = var.node_version ##----------------------------------------------------------------------------- diff --git a/_example/complete/linux_web_app/versions.tf b/_example/complete/linux_web_app/versions.tf index 76ed51f..53e561f 100644 --- a/_example/complete/linux_web_app/versions.tf +++ b/_example/complete/linux_web_app/versions.tf @@ -6,7 +6,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "=3.109.0" #3.100.0 + version = ">=3.109.0" } } } \ No newline at end of file diff --git a/_example/complete/windows_web_app/main.tf b/_example/complete/windows_web_app/main.tf index 96707c6..909bcec 100644 --- a/_example/complete/windows_web_app/main.tf +++ b/_example/complete/windows_web_app/main.tf @@ -66,7 +66,7 @@ module "windows-web-app" { ##----------------------------------------------------------------------------- ## Dot net ##----------------------------------------------------------------------------- - use_dotnet = false # Make it true if want to use it + use_dotnet = true # Make it true if want to use it dotnet_version = var.dotnet_version # For dotnet dotnet_core_version = var.dotnet_core_version # For dotnetcore @@ -93,14 +93,14 @@ module "windows-web-app" { ## java application ##----------------------------------------------------------------------------- - use_java = true + use_java = false java_version = var.java_version ##----------------------------------------------------------------------------- ## To Deploy Docker Container ##----------------------------------------------------------------------------- - use_docker = true # Make it true if want to use it + use_docker = false # Make it true if want to use it docker_image_name = var.docker_image_name docker_registry_url = ".azurecr.io" docker_registry_username = "" diff --git a/_example/complete/windows_web_app/versions.tf b/_example/complete/windows_web_app/versions.tf index 76ed51f..c3d7de8 100644 --- a/_example/complete/windows_web_app/versions.tf +++ b/_example/complete/windows_web_app/versions.tf @@ -6,7 +6,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "=3.109.0" #3.100.0 + version = ">=3.109.0" } } } \ No newline at end of file diff --git a/main.tf b/main.tf index 4beb4d5..a6dba1a 100644 --- a/main.tf +++ b/main.tf @@ -199,7 +199,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) 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) @@ -242,8 +242,6 @@ resource "azurerm_linux_web_app" "main" { headers = scm_ip_restriction.value.headers } } - - # scm_type = lookup(site_config.value, "scm_type", null) scm_minimum_tls_version = lookup(site_config.value, "scm_minimum_tls_version", "1.2") scm_use_main_ip_restriction = length(var.scm_authorized_ips) > 0 || var.scm_authorized_subnet_ids != null ? false : true @@ -535,7 +533,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) 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) @@ -578,8 +576,6 @@ resource "azurerm_windows_web_app" "main" { headers = scm_ip_restriction.value.headers } } - - # scm_type = lookup(site_config.value, "scm_type", null) scm_minimum_tls_version = lookup(site_config.value, "scm_minimum_tls_version", "1.2") scm_use_main_ip_restriction = length(var.scm_authorized_ips) > 0 || var.scm_authorized_subnet_ids != null ? false : true @@ -844,7 +840,6 @@ resource "azurerm_windows_web_app" "main" { lifecycle { ignore_changes = [ app_settings, - # site_config.0.application_stack, site_config.0.cors, site_config.0.ip_restriction_default_action, site_config.0.scm_ip_restriction_default_action, diff --git a/variables.tf b/variables.tf index e271e4c..6baba91 100644 --- a/variables.tf +++ b/variables.tf @@ -1,6 +1,3 @@ -#Module : LABEL -#Description : Terraform label module variables. - #Module : LABEL #Description : Terraform label module variables. variable "name" { @@ -477,27 +474,6 @@ variable "addon_virtual_network_id" { description = "The name of the addon vnet link vnet id" } -# # app insights -# variable "application_insights_enabled" { -# description = "Specify the Application Insights use for this App Service" -# default = true -# } - -# variable "application_insights_id" { -# description = "Resource ID of the existing Application Insights" -# default = null -# } - -# variable "app_insights_name" { -# description = "The Name of the application insights" -# default = "" -# } - -# variable "application_insights_type" { -# description = "Specifies the type of Application Insights to create. Valid values are `ios` for iOS, `java` for Java web, `MobileCenter` for App Center, `Node.JS` for Node.js, `other` for General, `phone` for Windows Phone, `store` for Windows Store and `web` for ASP.NET." -# default = "web" -# } - variable "retention_in_days" { description = "Specifies the retention period in days. Possible values are `30`, `60`, `90`, `120`, `180`, `270`, `365`, `550` or `730`" default = 90 diff --git a/versions.tf b/versions.tf index 52e8081..c3d7de8 100644 --- a/versions.tf +++ b/versions.tf @@ -6,7 +6,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "=3.109.0" + version = ">=3.109.0" } } } \ No newline at end of file