Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrampeter committed Dec 10, 2024
2 parents 862d329 + 7fb831d commit 76c0a2d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ module "database" {
network_subnets_private = local.network_private_subnets
tfe_instance_sg = module.vm.tfe_instance_sg
kms_key_arn = local.kms_key_arn
allow_major_version_upgrade = var.allow_major_version_upgrade
allow_multiple_azs = var.allow_multiple_azs
}

# -----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_db_instance" "postgresql" {
# no special characters allowed
username = var.db_username

allow_major_version_upgrade = false
allow_major_version_upgrade = var.allow_major_version_upgrade
apply_immediately = true
auto_minor_version_upgrade = true
backup_retention_period = var.db_backup_retention
Expand All @@ -73,7 +73,7 @@ resource "aws_db_instance" "postgresql" {
engine_version = var.engine_version
identifier_prefix = "${var.friendly_name_prefix}-tfe"
max_allocated_storage = 0
multi_az = true
multi_az = var.allow_multiple_azs
# no special characters allowed
db_name = var.db_name
port = 5432
Expand Down
12 changes: 12 additions & 0 deletions modules/database/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@ variable "kms_key_arn" {
description = "The Amazon Resource Name of the KMS key which will be used by the Redis Elasticache replication group to encrypt data at rest."
type = string
}

variable "allow_major_version_upgrade" {
type = bool
description = "Determine whether postgres major version upgrade is required or not."
default = false
}

variable "allow_multiple_azs" {
type = bool
description = "Determine Amazon RDS Postgres deployment strategy."
default = true
}
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ output "key" {
value = data.aws_kms_key.main.id
description = "The KMS key used to encrypt data."
}

output "s3_bucket" {
value = local.object_storage.s3_bucket
description = "S3 bucket name"
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ variable "postgres_engine_version" {
description = "PostgreSQL version."
}

variable "allow_major_version_upgrade" {
type = bool
description = "Determine whether postgres major version upgrade is required or not."
default = false
}

variable "allow_multiple_azs" {
type = bool
description = "Determine Amazon RDS Postgres deployment strategy."
default = true
}

# Aurora
# ------
variable "enable_aurora" {
Expand Down

0 comments on commit 76c0a2d

Please sign in to comment.