Skip to content

Commit

Permalink
Arrumando RDS subnet group
Browse files Browse the repository at this point in the history
  • Loading branch information
jonilsonds9 committed Oct 28, 2023
1 parent 3c8f11f commit 54ca42a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion infra/rds.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
resource "aws_db_subnet_group" "rds" {
name = "subnet_group_rds"

subnet_ids = [ local.subnet_ids ]

tags = {
Name = "DB subnet group"
}
}

resource "aws_security_group" "rds" {
name = "${var.project_name}-rds-sg"
description = "SG for RDS"
Expand Down Expand Up @@ -40,5 +50,5 @@ resource "aws_db_instance" "rds" {
vpc_security_group_ids = [aws_security_group.rds.id]
publicly_accessible = true
skip_final_snapshot = true
db_subnet_group_name = aws_subnet.this["pub_b"].name
db_subnet_group_name = aws_db_subnet_group.rds.name
}

0 comments on commit 54ca42a

Please sign in to comment.