Skip to content

Commit

Permalink
silly tags
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Apr 30, 2024
1 parent 686fe26 commit 3885455
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {
instance_name_index = var.db_type == "primary" ? var.db_count_index : var.db_count_index + 1
database_tag = var.db_type == "primary" ? "${split("_", var.server_type_tag)[0]}_${var.db_type}db" : "${split("_", var.server_type_tag)[0]}_${var.db_type}db${var.db_count_index}"
database_tag = var.db_type == "primary" ? "${var.database_tag_prefix}_${var.db_type}db" : "${var.database_tag_prefix}_${var.db_type}db${var.db_count_index}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "server_type_tag" {
default = "delius_core_db"
}

variable "database_tag_prefix" {
description = "tag to set on each instance for key `database`"
default = "delius"
}

variable "subnet_id" {
description = "Subnet ID to launch the instance in"
type = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ module "oracle_db_dsd" {
name_regex = var.dsd_db_config.ami_name_regex
owner = "self"
}
db_type = "primary"
db_suffix = "dsd-db"
server_type_tag = "mis_db"
db_type = "primary"
db_suffix = "dsd-db"
server_type_tag = "mis_db"
database_tag_prefix = "dsd"

count = 1
db_count_index = count.index + 1
Expand Down Expand Up @@ -92,9 +93,10 @@ module "oracle_db_boe" {
name_regex = var.boe_db_config.ami_name_regex
owner = "self"
}
db_type = "primary"
db_suffix = "boe-db"
server_type_tag = "mis_db"
db_type = "primary"
db_suffix = "boe-db"
server_type_tag = "mis_db"
database_tag_prefix = "boe"

count = 1
db_count_index = count.index + 1
Expand Down Expand Up @@ -143,9 +145,11 @@ module "oracle_db_mis" {
name_regex = var.mis_db_config.ami_name_regex
owner = "self"
}
db_type = "primary"
db_suffix = "mis-db"
server_type_tag = "mis_db"
db_type = "primary"
db_suffix = "mis-db"
server_type_tag = "mis_db"
database_tag_prefix = "mis"

count = 1
db_count_index = count.index + 1
ec2_instance_type = var.mis_db_config.instance_type
Expand Down

0 comments on commit 3885455

Please sign in to comment.