Skip to content

Commit

Permalink
Update infra files
Browse files Browse the repository at this point in the history
  • Loading branch information
n-y-kim committed Mar 9, 2024
1 parent fd121cd commit fd752d5
Show file tree
Hide file tree
Showing 40 changed files with 285 additions and 258 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ build/
*.tfstate.backup
*.tfvars
*.tfplan
.terraform.lock.hcl

venv/
369 changes: 178 additions & 191 deletions infra/main.tf

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions infra/module/log-analytics/main.tf

This file was deleted.

11 changes: 0 additions & 11 deletions infra/module/log-analytics/variables.tf

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions infra/modules/log_analytics/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
sku = var.sku
tags = var.tags
retention_in_days = var.retention_in_days != "" ? var.retention_in_days : null

lifecycle {
ignore_changes = [
tags
]
}
}
File renamed without changes.
43 changes: 43 additions & 0 deletions infra/modules/log_analytics/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
variable "resource_group_name" {
description = "(Required) Specifies the resource group name"
type = string
}

variable "location" {
description = "(Required) Specifies the location of the log analytics workspace"
type = string
}

variable "name" {
description = "(Required) Specifies the name of the log analytics workspace"
type = string
}

variable "sku" {
description = "(Optional) Specifies the sku of the log analytics workspace"
type = string
default = "PerGB2018"

validation {
condition = contains(["Free", "Standalone", "PerNode", "PerGB2018"], var.sku)
error_message = "The log analytics sku is incorrect."
}
}

variable "solution_plan_map" {
description = "(Optional) Specifies the map structure containing the list of solutions to be enabled."
type = map(any)
default = {}
}

variable "tags" {
description = "(Optional) Specifies the tags of the log analytics workspace"
type = map(any)
default = {}
}

variable "retention_in_days" {
description = " (Optional) Specifies the workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730."
type = number
default = 30
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
98 changes: 49 additions & 49 deletions infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ variable "log_analytics_retention_days" {
default = 30
}

variable "solution_plan_map" {
description = "Specifies solutions to deploy to log analytics workspace"
default = {
ContainerInsights= {
product = "OMSGallery/ContainerInsights"
publisher = "Microsoft"
}
}
type = map(any)
}
# variable "solution_plan_map" {
# description = "Specifies solutions to deploy to log analytics workspace"
# default = {
# ContainerInsights= {
# product = "OMSGallery/ContainerInsights"
# publisher = "Microsoft"
# }
# }
# type = map(any)
# }

variable "location" {
description = "Specifies the location for the resource group and all the resources"
Expand Down Expand Up @@ -100,11 +100,11 @@ variable "vm_subnet_address_prefix" {
type = list(string)
}

variable "bastion_subnet_address_prefix" {
description = "Specifies the address prefix of the firewall subnet"
default = ["10.243.2.0/24"]
type = list(string)
}
# variable "bastion_subnet_address_prefix" {
# description = "Specifies the address prefix of the firewall subnet"
# default = ["10.243.2.0/24"]
# type = list(string)
# }

variable "aks_cluster_name" {
description = "(Required) Specifies the name of the AKS cluster."
Expand Down Expand Up @@ -160,7 +160,7 @@ variable "sku_tier" {

variable "kubernetes_version" {
description = "Specifies the AKS Kubernetes version"
default = "1.26.3"
default = "1.27.7"
type = string
}

Expand Down Expand Up @@ -558,10 +558,10 @@ variable "admin_username" {
default = "azadmin"
}

variable "ssh_public_key" {
description = "(Required) Specifies the SSH public key for the jumpbox virtual machine and AKS worker nodes."
type = string
}
# variable "ssh_public_key" {
# description = "(Required) Specifies the SSH public key for the jumpbox virtual machine and AKS worker nodes."
# type = string
# }

variable "keda_enabled" {
description = "(Optional) Specifies whether KEDA Autoscaler can be used for workloads."
Expand Down Expand Up @@ -712,32 +712,32 @@ variable "service_account_name" {
default = "magic8ball-sa"
}

variable "email" {
description = "Specifies the email address for the cert-manager cluster issuer."
type = string
default = "[email protected]"
}

variable "deployment_script_name" {
description = "(Required) Specifies the name of the Azure OpenAI Service"
type = string
default = "BashScript"
}

variable "deployment_script_azure_cli_version" {
description = "(Required) Azure CLI module version to be used."
type = string
default = "2.9.1"
}

variable "deployment_script_managed_identity_name" {
description = "Specifies the name of the user-defined managed identity used by the deployment script."
type = string
default = "ScriptManagedIdentity"
}

variable "deployment_script_primary_script_uri" {
description = "(Optional) Uri for the script. This is the entry point for the external script. Changing this forces a new Resource Deployment Script to be created."
type = string
default = "https://paolosalvatori.blob.core.windows.net/scripts/install-nginx-via-helm-and-create-sa.sh"
}
# variable "email" {
# description = "Specifies the email address for the cert-manager cluster issuer."
# type = string
# default = "[email protected]"
# }

# variable "deployment_script_name" {
# description = "(Required) Specifies the name of the Azure OpenAI Service"
# type = string
# default = "BashScript"
# }

# variable "deployment_script_azure_cli_version" {
# description = "(Required) Azure CLI module version to be used."
# type = string
# default = "2.9.1"
# }

# variable "deployment_script_managed_identity_name" {
# description = "Specifies the name of the user-defined managed identity used by the deployment script."
# type = string
# default = "ScriptManagedIdentity"
# }

# variable "deployment_script_primary_script_uri" {
# description = "(Optional) Uri for the script. This is the entry point for the external script. Changing this forces a new Resource Deployment Script to be created."
# type = string
# default = "https://paolosalvatori.blob.core.windows.net/scripts/install-nginx-via-helm-and-create-sa.sh"
# }

0 comments on commit fd752d5

Please sign in to comment.