Created
June 3, 2019 14:02
-
-
Save carlosescura/d52e07c675e1e872c5380a4463d69979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* subnet group used by rds */ | |
resource "aws_db_subnet_group" "rds_subnet_group" { | |
name = "redash-rds-subnet-group" | |
description = "Redash RDS subnet group" | |
subnet_ids = ["${var.rds_subnet_ids}"] | |
tags { | |
Environment = "${var.environment}" | |
} | |
} | |
resource "aws_db_instance" "rds" { | |
identifier = "redash-db" | |
allocated_storage = "${var.rds_allocated_storage}" | |
engine = "postgres" | |
engine_version = "9.6.11" | |
instance_class = "${var.rds_instance_class}" | |
multi_az = "${var.rds_multi_az}" | |
name = "${var.rds_database_name}" | |
username = "${var.rds_database_username}" | |
password = "${var.rds_database_password}" | |
db_subnet_group_name = "${aws_db_subnet_group.rds_subnet_group.id}" | |
vpc_security_group_ids = ["${aws_security_group.db_access_sg.id}"] | |
skip_final_snapshot = true | |
backup_retention_period = 7 | |
deletion_protection = true | |
storage_encrypted = true | |
tags { | |
Environment = "${var.environment}" | |
Team = "${var.team_arn}" | |
} | |
depends_on = ["aws_db_subnet_group.rds_subnet_group"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment