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

Upgrade PSQL to v16 #126

Merged
merged 12 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ Important: During credentials rotation, SIMPHERA will not be available for a sho
| <a name="input_map_roles"></a> [map\_roles](#input\_map\_roles) | Additional IAM roles to add to the aws-auth ConfigMap | <pre>list(object({<br> rolearn = string<br> username = string<br> groups = list(string)<br> }))</pre> | `[]` | no |
| <a name="input_map_users"></a> [map\_users](#input\_map\_users) | Additional IAM users to add to the aws-auth ConfigMap | <pre>list(object({<br> userarn = string<br> username = string<br> groups = list(string)<br> }))</pre> | `[]` | no |
| <a name="input_scan_schedule"></a> [scan\_schedule](#input\_scan\_schedule) | 6-field Cron expression describing the scan maintenance schedule. Must not overlap with variable install\_schedule. | `string` | `"cron(0 0 * * ? *)"` | no |
| <a name="input_simpheraInstances"></a> [simpheraInstances](#input\_simpheraInstances) | A list containing the individual SIMPHERA instances, such as 'staging' and 'production'. | <pre>map(object({<br> name = string<br> postgresqlVersion = string<br> postgresqlStorage = number<br> postgresqlMaxStorage = number<br> db_instance_type_simphera = string<br> postgresqlStorageKeycloak = number<br> postgresqlMaxStorageKeycloak = number<br> db_instance_type_keycloak = string<br> k8s_namespace = string<br> secretname = string<br> enable_backup_service = bool<br> backup_retention = number<br> enable_deletion_protection = bool<br><br> }))</pre> | <pre>{<br> "production": {<br> "backup_retention": 35,<br> "db_instance_type_keycloak": "db.t3.large",<br> "db_instance_type_simphera": "db.t3.large",<br> "enable_backup_service": true,<br> "enable_deletion_protection": true,<br> "k8s_namespace": "simphera",<br> "name": "production",<br> "postgresqlMaxStorage": 100,<br> "postgresqlMaxStorageKeycloak": 100,<br> "postgresqlStorage": 20,<br> "postgresqlStorageKeycloak": 20,<br> "postgresqlVersion": "11",<br> "secretname": "aws-simphera-dev-production"<br> }<br>}</pre> | no |
| <a name="input_simpheraInstances"></a> [simpheraInstances](#input\_simpheraInstances) | A list containing the individual SIMPHERA instances, such as 'staging' and 'production'. | <pre>map(object({<br> name = string<br> postgresqlApplyImmediately = bool<br> postgresqlVersion = string<br> postgresqlStorage = number<br> postgresqlMaxStorage = number<br> db_instance_type_simphera = string<br> postgresqlStorageKeycloak = number<br> postgresqlMaxStorageKeycloak = number<br> db_instance_type_keycloak = string<br> k8s_namespace = string<br> secretname = string<br> enable_backup_service = bool<br> backup_retention = number<br> enable_deletion_protection = bool<br><br> }))</pre> | <pre>{<br> "production": {<br> "backup_retention": 35,<br> "db_instance_type_keycloak": "db.t3.large",<br> "db_instance_type_simphera": "db.t3.large",<br> "enable_backup_service": true,<br> "enable_deletion_protection": true,<br> "k8s_namespace": "simphera",<br> "name": "production",<br> "postgresqlApplyImmediately": false,<br> "postgresqlMaxStorage": 100,<br> "postgresqlMaxStorageKeycloak": 100,<br> "postgresqlStorage": 20,<br> "postgresqlStorageKeycloak": 20,<br> "postgresqlVersion": "16",<br> "secretname": "aws-simphera-dev-production"<br> }<br>}</pre> | no |
| <a name="input_tags"></a> [tags](#input\_tags) | The tags to be added to all resources. | `map(any)` | `{}` | no |
| <a name="input_vpcCidr"></a> [vpcCidr](#input\_vpcCidr) | The CIDR for the virtual private cluster. | `string` | `"10.1.0.0/18"` | no |
| <a name="input_vpcDatabaseSubnets"></a> [vpcDatabaseSubnets](#input\_vpcDatabaseSubnets) | List of CIDRs for the database subnets. | `list(any)` | <pre>[<br> "10.1.24.0/22",<br> "10.1.28.0/22",<br> "10.1.32.0/22"<br>]</pre> | no |
Expand Down
5 changes: 5 additions & 0 deletions modules/simphera_aws_instance/postgresql.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
resource "aws_db_instance" "simphera" {

apply_immediately = var.postgresqlApplyImmediately
allocated_storage = var.postgresqlStorage
max_allocated_storage = var.postgresqlMaxStorage
auto_minor_version_upgrade = true # [RDS.13] RDS automatic minor version upgrades should be enabled
allow_major_version_upgrade = true
engine = "postgres"
engine_version = var.postgresqlVersion
instance_class = var.db_instance_type_simphera
Expand Down Expand Up @@ -35,9 +37,12 @@ resource "aws_db_instance" "simphera" {
}

resource "aws_db_instance" "keycloak" {

apply_immediately = var.postgresqlApplyImmediately
allocated_storage = var.postgresqlStorageKeycloak
max_allocated_storage = var.postgresqlMaxStorageKeycloak
auto_minor_version_upgrade = true # [RDS.13] RDS automatic minor version upgrades should be enabled
allow_major_version_upgrade = true
engine = "postgres"
engine_version = var.postgresqlVersion
instance_class = var.db_instance_type_keycloak
Expand Down
8 changes: 7 additions & 1 deletion modules/simphera_aws_instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ variable "name" {
description = "The name of the SIMPHERA instance. e.g. production"
}

variable "postgresqlApplyImmediately" {
type = bool
description = "Apply PostgreSQL changes immediately (true) or during next maintenance window (false)"
default = false
}

variable "postgresqlVersion" {
type = string
description = "PostgreSQL Server version to deploy"
default = "11"
default = "16"
}

variable "postgresqlStorage" {
Expand Down
1 change: 1 addition & 0 deletions simphera-instances.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module "simphera_instance" {
eks_oidc_issuer_url = module.eks.eks_oidc_issuer_url
eks_oidc_provider_arn = module.eks.eks_oidc_provider_arn
name = each.value.name
postgresqlApplyImmediately = each.value.postgresqlApplyImmediately
postgresqlVersion = each.value.postgresqlVersion
postgresqlStorage = each.value.postgresqlStorage
postgresqlMaxStorage = each.value.postgresqlMaxStorage
Expand Down
3 changes: 2 additions & 1 deletion terraform.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@
"enable_deletion_protection": true,
"k8s_namespace": "simphera",
"name": "production",
"postgresqlApplyImmediately": false,
"postgresqlMaxStorage": 100,
"postgresqlMaxStorageKeycloak": 100,
"postgresqlStorage": 20,
"postgresqlStorageKeycloak": 20,
"postgresqlVersion": "11",
"postgresqlVersion": "16",
"secretname": "aws-simphera-dev-production"
}
},
Expand Down
3 changes: 2 additions & 1 deletion terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ simpheraInstances = {
"enable_deletion_protection" : true,
"k8s_namespace" : "simphera",
"name" : "production",
"postgresqlApplyImmediately" : false
"postgresqlMaxStorage" : 100,
"postgresqlMaxStorageKeycloak" : 100,
"postgresqlStorage" : 20,
"postgresqlStorageKeycloak" : 20,
"postgresqlVersion" : "11",
"postgresqlVersion" : "16",
"secretname" : "aws-simphera-dev-production"
}
}
Expand Down
4 changes: 3 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ variable "map_users" {
variable "simpheraInstances" {
type = map(object({
name = string
postgresqlApplyImmediately = bool
postgresqlVersion = string
postgresqlStorage = number
postgresqlMaxStorage = number
Expand All @@ -206,7 +207,8 @@ variable "simpheraInstances" {
default = {
"production" = {
name = "production"
postgresqlVersion = "11"
postgresqlApplyImmediately = false
postgresqlVersion = "16"
postgresqlStorage = 20
postgresqlMaxStorage = 100
postgresqlStorageKeycloak = 20
Expand Down
Loading