Skip to content

Commit

Permalink
Nit 927 delius db standby db required (#3944)
Browse files Browse the repository at this point in the history
* start for each

* Update variables.tf

* var type

* ebs volumes fix

* remove debug output

* fix tag generation

* start for each

* Update variables.tf

* var type

* ebs volumes fix

* remove debug output

* fix tag generation

* correct block name

* Update db_ec2.tf
  • Loading branch information
georgepstaylor authored Nov 13, 2023
1 parent a3d84af commit 1c48f3d
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 137 deletions.
143 changes: 126 additions & 17 deletions terraform/environments/delius-core/locals_development_dev1.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ locals {
efs_datasync_destination_arn = module.environment_test[0].ldap_efs_location
}

db_config_dev = {
name = try(local.db_config_lower_environments.name, "db")
db_config_dev = [{
name = "primarydb"
ami_name_regex = local.db_config_lower_environments.ami_name_regex
user_data_raw = base64encode(
templatefile(
Expand All @@ -47,10 +47,13 @@ locals {
}
)
)
instance = merge(local.db_config_lower_environments.instance, {
instance_type = "r6i.xlarge"
monitoring = false
})

instance = {
instance_type = "r6i.xlarge"
monitoring = false
vpc_security_group_ids = []
disable_api_termination = true
}

ebs_volumes = {
kms_key_id = data.aws_kms_key.ebs_shared.arn
Expand All @@ -62,39 +65,54 @@ locals {
volume_size = 30
}
ebs_non_root_volumes = {
"/dev/sdb" = { # /u01 oracle app disk
"/dev/sdb" = {
# /u01 oracle app disk
volume_type = "gp3"
volume_size = 200
no_device = false
}
"/dev/sdc" = { # /u02 oracle app disk
"/dev/sdc" = {
# /u02 oracle app disk
volume_type = "gp3"
volume_size = 100
no_device = false
}
"/dev/sds" = { # swap disk
"/dev/sds" = {
# swap disk
volume_type = "gp3"
volume_size = 4
no_device = false
}
"/dev/sde" = { # oracle asm disk DATA01
"/dev/sde" = {
# oracle asm disk DATA01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdf" = { # oracle asm disk DATA02
"/dev/sdf" = {
# oracle asm disk DATA02
no_device = true
}
"/dev/sdg" = { # oracle asm disk DATA03
"/dev/sdg" = {
# oracle asm disk DATA03
no_device = true
}
"/dev/sdh" = { # oracle asm disk DATA04
"/dev/sdh" = {
# oracle asm disk DATA04
no_device = true
}
"/dev/sdi" = { # oracle asm disk DATA05
"/dev/sdi" = {
# oracle asm disk DATA05
no_device = true
}
"/dev/sdj" = { # oracle asm disk FLASH01
"/dev/sdj" = {
# oracle asm disk FLASH01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdk" = { # oracle asm disk FLASH02
"/dev/sdk" = {
# oracle asm disk FLASH02
no_device = true
}
}
Expand All @@ -103,7 +121,98 @@ locals {
create_internal_record = true
create_external_record = false
}
}
},
{
name = "standbydb1"
ami_name_regex = local.db_config_lower_environments.ami_name_regex
user_data_raw = base64encode(
templatefile(
"${path.module}/templates/userdata.sh.tftpl",
{
branch = local.db_config.user_data_param.branch
ansible_repo = local.db_config.user_data_param.ansible_repo
ansible_repo_basedir = local.db_config.user_data_param.ansible_repo_basedir
ansible_args = local.db_config.user_data_param.ansible_args
}
)
)

instance = {
instance_type = "r6i.xlarge"
monitoring = false
vpc_security_group_ids = []
disable_api_termination = true
}

ebs_volumes = {
kms_key_id = data.aws_kms_key.ebs_shared.arn
tags = local.tags
iops = 3000
throughput = 125
root_volume = {
volume_type = "gp3"
volume_size = 30
no_device = false
}
ebs_non_root_volumes = {
"/dev/sdb" = {
# /u01 oracle app disk
volume_type = "gp3"
volume_size = 200
no_device = false
}
"/dev/sdc" = {
# /u02 oracle app disk
volume_type = "gp3"
volume_size = 100
no_device = false
}
"/dev/sds" = {
# swap disk
volume_type = "gp3"
volume_size = 4
no_device = false
}
"/dev/sde" = {
# oracle asm disk DATA01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdf" = {
# oracle asm disk DATA02
no_device = true
}
"/dev/sdg" = {
# oracle asm disk DATA03
no_device = true
}
"/dev/sdh" = {
# oracle asm disk DATA04
no_device = true
}
"/dev/sdi" = {
# oracle asm disk DATA05
no_device = true
}
"/dev/sdj" = {
# oracle asm disk FLASH01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdk" = {
# oracle asm disk FLASH02
no_device = true
}
}
}
route53_records = {
create_internal_record = true
create_external_record = false
}
}
]

weblogic_config_dev = {
name = try(local.weblogic_config_lower_environments.name, "weblogic")
Expand Down
54 changes: 37 additions & 17 deletions terraform/environments/delius-core/locals_development_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ locals {
efs_datasync_destination_arn = null
}

db_config_test = {
name = try(local.db_config_lower_environments.name, "db")
db_config_test = [{
name = "primarydb"
ami_name_regex = local.db_config_lower_environments.ami_name_regex
user_data_raw = base64encode(
templatefile(
Expand All @@ -47,10 +47,13 @@ locals {
}
)
)
instance = merge(local.db_config_lower_environments.instance, {
instance_type = "r6i.xlarge"
monitoring = false
})

instance = {
instance_type = "r6i.xlarge"
monitoring = false
vpc_security_group_ids = []
disable_api_termination = true
}

ebs_volumes = {
kms_key_id = data.aws_kms_key.ebs_shared.arn
Expand All @@ -60,41 +63,57 @@ locals {
root_volume = {
volume_type = "gp3"
volume_size = 30
no_device = false
}
ebs_non_root_volumes = {
"/dev/sdb" = { # /u01 oracle app disk
"/dev/sdb" = {
# /u01 oracle app disk
volume_type = "gp3"
volume_size = 200
no_device = false
}
"/dev/sdc" = { # /u02 oracle app disk
"/dev/sdc" = {
# /u02 oracle app disk
volume_type = "gp3"
volume_size = 100
no_device = false
}
"/dev/sds" = { # swap disk
"/dev/sds" = {
# swap disk
volume_type = "gp3"
volume_size = 4
no_device = false
}
"/dev/sde" = { # oracle asm disk DATA01
"/dev/sde" = {
# oracle asm disk DATA01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdf" = { # oracle asm disk DATA02
"/dev/sdf" = {
# oracle asm disk DATA02
no_device = true
}
"/dev/sdg" = { # oracle asm disk DATA03
"/dev/sdg" = {
# oracle asm disk DATA03
no_device = true
}
"/dev/sdh" = { # oracle asm disk DATA04
"/dev/sdh" = {
# oracle asm disk DATA04
no_device = true
}
"/dev/sdi" = { # oracle asm disk DATA05
"/dev/sdi" = {
# oracle asm disk DATA05
no_device = true
}
"/dev/sdj" = { # oracle asm disk FLASH01
"/dev/sdj" = {
# oracle asm disk FLASH01
volume_type = "gp3"
volume_size = 500
no_device = false
}
"/dev/sdk" = { # oracle asm disk FLASH02
"/dev/sdk" = {
# oracle asm disk FLASH02
no_device = true
}
}
Expand All @@ -103,7 +122,8 @@ locals {
create_internal_record = true
create_external_record = false
}
}
}
]

weblogic_config_test = {
name = try(local.weblogic_config_lower_environments.name, "weblogic")
Expand Down
Loading

0 comments on commit 1c48f3d

Please sign in to comment.