From a30ab325dd03729abac1e77a58ff01f28b3f7d22 Mon Sep 17 00:00:00 2001 From: Prakash Subramani Date: Fri, 8 Dec 2023 14:15:47 +0000 Subject: [PATCH] TF static analysis --- infra/main.tf | 24 ++++++++++++++++++++++++ infra/rds.tf | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 infra/rds.tf diff --git a/infra/main.tf b/infra/main.tf index 01c46de..4e16314 100644 --- a/infra/main.tf +++ b/infra/main.tf @@ -1,3 +1,27 @@ +terraform { + backend "s3" { + } +} + +provider "aws" { + region = "eu-west-2" +} + +provider "aws" { + alias = "london" + region = "eu-west-2" + default_tags { + tags = { + GithubTeam = "platform" + } + } +} + +provider "aws" { + alias = "ireland" + region = "eu-west-1" +} + resource "random_string" "random" { length = 16 special = true diff --git a/infra/rds.tf b/infra/rds.tf new file mode 100644 index 0000000..1aa4491 --- /dev/null +++ b/infra/rds.tf @@ -0,0 +1,28 @@ + +module "rds" { + source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=6.0.0" + + vpc_name = var.vpc_name + + application = "test" + environment_name = "development" + is_production = false + infrastructure_support = "support" + team_name = "cloud" + db_instance_class = "db.t4g.small" + db_max_allocated_storage = "10000" + rds_family = "postgres12" + db_engine_version = "12" + namespace = "prakash-dev" + business_unit = "cloud-platform" + + db_name = "test" + + # Set to true for replica database. No backups or snapshots are created for read replica + skip_final_snapshot = "true" + db_backup_retention_period = 0 + + providers = { + aws = aws.london + } +} \ No newline at end of file