From dc5b72bfbb8710a3081fdf0f3b64d062d96e6230 Mon Sep 17 00:00:00 2001 From: Robin Mordasiewicz Date: Tue, 17 Sep 2024 10:06:40 -0400 Subject: [PATCH] adding init --- terraform/hub-network.tf | 2 +- terraform/terraform.auto.tfvars | 5 +++-- terraform/terraform.tf | 19 +++++++++---------- terraform/variables.tf | 15 ++++++++++----- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/terraform/hub-network.tf b/terraform/hub-network.tf index ad580afe..00b6184a 100644 --- a/terraform/hub-network.tf +++ b/terraform/hub-network.tf @@ -72,7 +72,7 @@ resource "azurerm_network_security_group" "hub-external_network_security_group" access = "Allow" protocol = "Tcp" source_port_range = "*" - destination_port_ranges = var.spoke-aks-node-image-gpu == true ? ["80", "443", "8080", "11434"] : ["80", "443"] #checkov:skip=CKV_AZURE_160: Allow HTTP redirects + destination_port_ranges = var.spoke-k8s-node-pool-gpu == true ? ["80", "443", "8080", "11434"] : ["80", "443"] #checkov:skip=CKV_AZURE_160: Allow HTTP redirects source_address_prefix = "*" destination_address_prefix = var.hub-nva-vip } diff --git a/terraform/terraform.auto.tfvars b/terraform/terraform.auto.tfvars index 593e5c26..55c9e1f5 100644 --- a/terraform/terraform.auto.tfvars +++ b/terraform/terraform.auto.tfvars @@ -19,5 +19,6 @@ spoke-aks-subnet_prefix = "10.1.2.0/24" spoke-aks_dns_service_ip = "10.1.2.10" spoke-check-internet-up-ip = "8.8.8.8" spoke-aks-node-ip = "10.1.1.4" -spoke-aks-node-image-gpu = false -spoke-k8s-node-pool-gpu = false +#spoke-aks-node-image-gpu = false +spoke-k8s-node-pool-gpu = true +subscription_id = "6dced100-9c31-416f-aed1-67e8cfc9fe5f" \ No newline at end of file diff --git a/terraform/terraform.tf b/terraform/terraform.tf index c12c0ce9..d0892aa0 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -33,14 +33,16 @@ terraform { source = "hashicorp/external" version = "2.3.4" } - #kubernetes = { - # source = "hashicorp/kubernetes" - # version = "2.31.0" - #} } # backend "azurerm" {} } +data "azurerm_subscription" "current" { +} + +data "azurerm_client_config" "current" { +} + provider "azurerm" { features { api_management { @@ -51,15 +53,12 @@ provider "azurerm" { prevent_deletion_if_contains_resources = false } } - skip_provider_registration = true + subscription_id = var.subscription_id + #resource_provider_registrations = "none" } provider "random" {} provider "tls" {} provider "http" {} provider "local" {} -provider "git" {} -#provider "kubernetes" { -# config_path = local_file.kube_config.filename -#} - +provider "git" {} \ No newline at end of file diff --git a/terraform/variables.tf b/terraform/variables.tf index 0edb9669..60e727b7 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,3 +1,8 @@ +variable "subscription_id" { + description = "Azure subscription ID" + type = string +} + variable "owner_email" { default = "root@example.com" description = "Email address for use with Owner tag." @@ -222,11 +227,11 @@ variable "spoke-aks-node-image" { type = string } -variable "spoke-aks-node-image-gpu" { - default = false - description = "Set to true to enable GPU workloads" - type = bool -} +#variable "spoke-aks-node-image-gpu" { +# default = false +# description = "Set to true to enable GPU workloads" +# type = bool +#} variable "spoke-k8s-node-pool-gpu" { default = false