Skip to content

Commit 97065ff

Browse files
authored
fix: hardcoded sensitive vars (#15)
2 parents fe43b4e + b24f174 commit 97065ff

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resource "aws_db_instance" "this" {
1414
identifier = "soat-tc-rds-db"
1515
engine = "postgres"
1616

17-
db_name = "backend"
17+
db_name = var.db_name
1818

1919
allocated_storage = 20
2020
storage_type = "gp2"

providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ provider "aws" {
66

77
default_tags {
88
tags = {
9-
Organization = var.repo_owner
10-
Repository = var.repository
9+
Organization = "soat-tech-challenge"
10+
Workspace = "database-staging"
1111
}
1212
}
1313
}

variables.tf

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
variable "repo_owner" {
2-
type = string
3-
default = "soat-tech-challenge"
4-
}
5-
6-
variable "repository" {
7-
type = string
8-
default = "soat-tech-challenge/terraform-aws-rds"
1+
variable "aws_region" {
2+
description = "AWS Region to create resources on"
3+
type = string
4+
default = "us-east-2"
95
}
106

117
variable "aws_access_key" {
@@ -18,28 +14,26 @@ variable "aws_secret_key" {
1814
type = string
1915
}
2016

21-
variable "db_port" {
22-
description = "Porta da instância RDS"
23-
type = string
24-
default = "5432"
25-
}
26-
2717
variable "db_username" {
28-
description = "Nome de usuário do banco de dados"
18+
description = "Database username"
2919
type = string
30-
default = "postgres"
3120
}
3221

3322
variable "db_password" {
34-
description = "Senha do banco de dados"
23+
description = "Database password"
3524
type = string
36-
default = "postgres"
3725
}
3826

39-
variable "aws_region" {
40-
description = "Região AWS onde criar a instância RDS"
27+
variable "db_name" {
28+
description = "Database name"
4129
type = string
42-
default = "us-east-2"
30+
default = "backend_db"
31+
}
32+
33+
variable "db_port" {
34+
description = "Database port"
35+
type = number
36+
default = 5432
4337
}
4438

4539
variable "vpc_name" {

0 commit comments

Comments
 (0)