Skip to content

Commit

Permalink
Merge pull request #4493 from ministryofjustice/chaps-RDS
Browse files Browse the repository at this point in the history
Chaps rds
  • Loading branch information
roncitrus authored Jan 10, 2024
2 parents 84c327e + fe0cae1 commit d6ee2a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"db_enabled": true,
"db_instance_class": "db.t3.small",
"db_user": "dbadmin",
"db_allocated_storage": "75",
"db_allocated_storage": "100",
"db_name": "chaps-dev",
"env_name": "development",
"db_instance_identifier": "db-chaps-dev",
Expand Down
7 changes: 4 additions & 3 deletions terraform/environments/cdpt-chaps/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#------------------------------------------------------------------------------

resource "aws_db_instance" "database" {
allocated_storage = local.application_data.accounts[local.environment].db_allocated_storage
allocated_storage = local.application_data.accounts[local.environment].db_allocated_storage
storage_type = "gp2"
engine = "sqlserver-web"
engine_version = "14.00.3381.3.v1"
Expand All @@ -13,9 +13,10 @@ resource "aws_db_instance" "database" {
password = data.aws_secretsmanager_secret_version.db_password.secret_string
vpc_security_group_ids = [aws_security_group.db.id]
depends_on = [aws_security_group.db]
snapshot_identifier = "arn:aws:rds:eu-west-2:613903586696:snapshot:dev-modplatform-snapshot"
snapshot_identifier = "arn:aws:rds:eu-west-2:613903586696:snapshot:cdpt-dev-staging-snapshot-9-1-24"
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.db.id
publicly_accessible = true
}

resource "aws_db_instance_role_association" "database" {
Expand All @@ -40,7 +41,7 @@ resource "aws_db_subnet_group" "db" {
}

resource "aws_security_group" "db" {
name = "${local.application_name}-db-sg"
name = "${local.application_name}-db-sg"
description = "Allow DB inbound traffic"
vpc_id = data.aws_vpc.shared.id
ingress {
Expand Down

0 comments on commit d6ee2a7

Please sign in to comment.