Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from FIAP-3SOAT-G15/store-ssm-params
Browse files Browse the repository at this point in the history
Store SSM params
  • Loading branch information
wellyfrs authored Mar 16, 2024
2 parents 7ab5376 + ec8ea71 commit e07c08c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
locals {
name = "selfordermanagementdb"
name = "selfordermanagementdb"
username = "master"
port = 5432
}

data "terraform_remote_state" "tech-challenge" {
Expand Down Expand Up @@ -30,8 +32,8 @@ module "db" {
storage_encrypted = false

db_name = local.name
username = "master"
port = 5432
username = local.username
port = local.port

manage_master_user_password = true

Expand Down Expand Up @@ -60,3 +62,14 @@ module "security_group" {
},
]
}

module "ssm_parameters" {
source = "terraform-aws-modules/ssm-parameter/aws"
name = "live/selfordermanagement/db"
type = "String"
value = jsonencode({
name : local.name,
host : module.db.db_instance_endpoint,
port : local.port
})
}

0 comments on commit e07c08c

Please sign in to comment.