Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon RDS deployment strategy #341

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,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
10 changes: 10 additions & 0 deletions modules/database/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,13 @@ 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."
}
harshit410 marked this conversation as resolved.
Show resolved Hide resolved

variable "allow_multiple_azs" {
type = bool
description = "Determine Amazon RDS Postgres deployment strategy."
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,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
Loading