Skip to content

Commit 0fa607c

Browse files
committed
freeform tags for each oke resource
Signed-off-by: junior <junior@users.noreply.github.com>
1 parent dc1de3a commit 0fa607c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

module-oke.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ module "oke" {
4444
region = var.region
4545

4646
# Deployment Tags + Freeform Tags
47-
freeform_deployment_tags = local.freeform_deployment_tags
47+
cluster_freeform_deployment_tags = local.freeform_deployment_tags
48+
load_balancers_freeform_deployment_tags = local.freeform_deployment_tags
49+
block_volumes_freeform_deployment_tags = local.freeform_deployment_tags
4850

4951
# OKE Cluster
5052
## create_new_oke_cluster
@@ -74,7 +76,8 @@ module "oke_node_pool" {
7476
source = "./modules/oke-node-pool"
7577

7678
# Deployment Tags + Freeform Tags
77-
freeform_deployment_tags = local.freeform_deployment_tags
79+
node_pools_freeform_deployment_tags = local.freeform_deployment_tags
80+
worker_nodes_freeform_deployment_tags = local.freeform_deployment_tags
7881

7982
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
8083
tenancy_ocid = var.tenancy_ocid
@@ -135,10 +138,6 @@ module "oke_cluster_autoscaler" {
135138
}
136139

137140
## OKE Cluster Details
138-
variable "app_name" {
139-
default = "K8s App"
140-
description = "Application name. Will be used as prefix to identify resources, such as OKE, VCN, ATP, and others"
141-
}
142141
variable "create_new_oke_cluster" {
143142
default = true
144143
description = "Creates a new OKE cluster, node pool and network resources"
@@ -293,7 +292,7 @@ resource "random_string" "deploy_id" {
293292
resource "oci_identity_compartment" "oke_compartment" {
294293
compartment_id = var.compartment_ocid
295294
name = "${local.app_name_normalized}-${local.deploy_id}"
296-
description = "${var.app_name} ${var.oke_compartment_description} (Deployment ${local.deploy_id})"
295+
description = "${local.app_name} ${var.oke_compartment_description} (Deployment ${local.deploy_id})"
297296
enable_delete = true
298297

299298
count = var.create_new_compartment_for_oke ? 1 : 0
@@ -315,7 +314,9 @@ locals {
315314
"Quickstart" = "oke_base" }
316315
freeform_deployment_tags = merge(var.tag_values.freeformTags, local.deploy_tags)
317316
workers_public_ssh_key = var.generate_public_ssh_key ? tls_private_key.oke_worker_node_ssh_key.public_key_openssh : var.public_ssh_key
317+
app_name = var.app_name
318318
app_name_normalized = substr(replace(lower(var.app_name), " ", "-"), 0, 6)
319+
app_name_for_dns = substr(lower(replace(var.app_name, "/\\W|_|\\s/", "")), 0, 6)
319320
}
320321

321322
# OKE Outputs

0 commit comments

Comments
 (0)