Skip to content

Commit 192cc2a

Browse files
authored
[fix/#17] RDS 접근을 public access 대신 ec2에서 접속하도록 변경 (#18)
* fix: DB 연결을 public access가 아닌 ec2를 거쳐 진행하도록 변경 * feat: ec2 터널링 파일 깃 ignore에 추가
1 parent 1231dfa commit 192cc2a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ application-local.yml
4242
*.tfstate
4343
*.tfstate.*
4444
*.tfvars
45-
!*.tfvars.example
45+
!*.tfvars.example
46+
47+
### tunnel ###
48+
application-local-tunnel.yml
49+
start-dev-tunnel.sh
50+
stop-dev-tunnel.sh

infra/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ resource "aws_instance" "app" {
410410
# RDS Subnet Group
411411
resource "aws_db_subnet_group" "main" {
412412
name = "${var.project_name}-${var.environment}-db-subnet-group"
413-
subnet_ids = aws_subnet.public[*].id
413+
subnet_ids = aws_subnet.private[*].id
414414

415415
tags = {
416416
Name = "${var.project_name}-${var.environment}-db-subnet-group"
@@ -434,7 +434,7 @@ resource "aws_db_instance" "main" {
434434
vpc_security_group_ids = [aws_security_group.rds.id]
435435

436436
skip_final_snapshot = true
437-
publicly_accessible = true
437+
publicly_accessible = false
438438
backup_retention_period = 7
439439
enabled_cloudwatch_logs_exports = ["error", "general", "slowquery"]
440440

0 commit comments

Comments
 (0)