From 11ef0dd5a574da94a6bc14ec42e99a40f3ff6c8d Mon Sep 17 00:00:00 2001 From: Arthur Fewell Date: Wed, 18 Oct 2023 06:53:57 -0700 Subject: [PATCH] fix: adding main.tf terraform file for tmc-akscluster --- terraform/tmc-akscluster/main.tf | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 terraform/tmc-akscluster/main.tf diff --git a/terraform/tmc-akscluster/main.tf b/terraform/tmc-akscluster/main.tf new file mode 100644 index 0000000..5f6497c --- /dev/null +++ b/terraform/tmc-akscluster/main.tf @@ -0,0 +1,49 @@ +terraform { + required_providers { + tanzu-mission-control = { + source = "vmware/tanzu-mission-control" + version = "1.2.3" + } + } +} + +// Basic details needed to configure Tanzu Mission Control provider +provider "tanzu-mission-control" { + endpoint = var.tmc_endpoint + vmw_cloud_api_token = var.vmw_cloud_api_token +} + +resource "tanzu-mission-control_akscluster" "aks_cluster" { + credential_name = var.azure_credential_name + subscription_id = var.azure_subscription_id + resource_group = var.azure_resource_group + name = var.cluster_name + meta { + description = var.cluster_description + labels = var.cluster_labels + } + spec { + cluster_group = var.cluster_group_name + config { + location = var.cluster_location + kubernetes_version = var.kubernetes_version + network_config { + dns_prefix = var.cluster_dns_prefix + } + } + nodepool { + name = var.nodepool_1_name + spec { + count = var.nodepool_1_count + mode = "SYSTEM" + vm_size = var.nodepool_1_vm_size + os_disk_size_gb = var.nodepool_1_node_disk_size_gb + auto_scaling_config { + enable = var.nodepool_1_enable_auto_scaling + max_count = var.nodepool_1_max_node_count + min_count = var.nodepool_1_min_node_count + } + } + } + } +}