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

add RDS #4241

Closed
wants to merge 36 commits into from
Closed

add RDS #4241

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3f911aa
add RDS
Dec 5, 2023
26b07c1
remove app name locals
Dec 5, 2023
6d21f1a
remove comma app_vars
Dec 5, 2023
f41583d
revise db_name
Dec 5, 2023
d9c205d
remove extra identifier
Dec 5, 2023
b3963a5
remove name argument
Dec 5, 2023
48b8d24
fix database.tf
Dec 7, 2023
30d22de
add s3 access for RDS
Dec 8, 2023
e82f75e
Merge branch 'main' into add_rds
roncitrus Dec 8, 2023
b69287e
Rename hosts (#4271)
pavmoj Dec 8, 2023
8279a02
NIT-981 deploy Oracle backup vault to all envs
Dec 8, 2023
bda9ff2
add s3 access for RDS
Dec 8, 2023
3225341
Pick up correct database type
ranbeersingh1 Dec 8, 2023
b216ce0
Merge pull request #4272 from ministryofjustice/NIT-981-delius-db-cre…
andrewmooreio Dec 8, 2023
a21d369
removed s3 info from rds instance
Dec 8, 2023
e5064a4
fixed typo
Dec 8, 2023
29da388
allow moj vpn access to rds (#4267)
matthewsearle01 Dec 8, 2023
e354de6
Pick up correct database type
ranbeersingh1 Dec 8, 2023
7af1d61
DSOS-2430: create dev oem (#4273)
drobinson-moj Dec 8, 2023
8486983
fixed typo
Dec 8, 2023
89095c2
Merge pull request #4274 from ministryofjustice/DBA-584
ranbeersingh1 Dec 8, 2023
6ede734
fix conflicts rebase
Dec 5, 2023
2d9c6aa
fix conflict locals
Dec 5, 2023
1b47b16
remove comma app_vars
Dec 5, 2023
789e504
revise db_name
Dec 5, 2023
9a977eb
remove extra identifier
Dec 5, 2023
17a3bb7
remove name argument
Dec 5, 2023
b3d48a3
fix database.tf
Dec 7, 2023
45fc12e
add s3 access for RDS
Dec 8, 2023
00facd1
fix conflicts
Dec 8, 2023
5f99bd5
fix conflicts
Dec 8, 2023
0653d5b
fixed conflicts
Dec 8, 2023
be57f08
fixed typo
Dec 8, 2023
b0b2ebf
fix conflicts
roncitrus Dec 8, 2023
852e9db
rebased branch
roncitrus Dec 8, 2023
d826ffb
add rds prepro and prod
roncitrus Dec 8, 2023
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
10 changes: 9 additions & 1 deletion terraform/environments/cdpt-chaps/application_variables.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"accounts": {
"development": {
"example_var": "dev-data"
"db_enabled": true,
"db_instance_class": "db.t3.small",
"db_user": "admin",
"db_allocated_storage": "75",
"db_name": "chaps-dev",
"env_name": "development",
"friendly_name": "Chaps development",
"container_instance_type": "windows",
"container_version": "preproduction",
},
"test": {
"example_var": "test-data"
Expand Down
35 changes: 35 additions & 0 deletions terraform/environments/cdpt-chaps/database.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#------------------------------------------------------------------------------
# Database
#------------------------------------------------------------------------------

resource "aws_db_instance" "database" {
identifier = local.application_name
allocated_storage = local.app_data.accounts[local.environment].db_allocated_storage
storage_type = "gp2"
engine = "sqlserver-web"
engine_version = "14.00.3381.3.v1"
instance_class = local.app_data.accounts[local.environment].db_instance_class
name = local.app_data.accounts[local.environment].db_name
username = local.app_data.accounts[local.environment].db_user
#password = aws_secretsmanager_secret_version.db_password.arn
}

resource "aws_security_group" "db" {
name = "db"
description = "Allow DB inbound traffic"

ingress {
from_port = 1433
to_port = 1433
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}

9 changes: 9 additions & 0 deletions terraform/environments/cdpt-chaps/locals.tf
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#### This file can be used to store locals specific to the member account ####


locals {

app_data = jsondecode(file("./application_variables.json"))

application_name = "Chaps"

}
Loading