#------------------- # RDS Postgresql Database #------------------- resource "aws_db_instance" "postgresql" { identifier = "db-${var.stack_name}" allocated_storage = "${var.rds_allocated_storage}" engine = "postgres" engine_version = "${var.rds_engine_version}" instance_class = "${var.rds_instance_class}" name = "nuxeo" username = "${var.database_user}" password = "${var.database_password}" // Because we're assuming a VPC, we use this option, but only one SG id vpc_security_group_ids = ["${var.security_group_ids}"] // We're creating a subnet group in the module and passing in the name db_subnet_group_name = "${aws_db_subnet_group.postgresql.id}" parameter_group_name = "default.postgres9.4" multi_az = "${var.rds_is_multi_az}" storage_type = "${var.rds_storage_type}" tags { Name = "${var.stack_name} - Nuxeo Postgres Database" billing-category = "customers" billing-subcategory = "${var.stack_name}" role= "nuxeo.db" } } resource "aws_db_subnet_group" "postgresql" { name = "${var.stack_name}-db-subnet-group" description = "RDS private subnet group" subnet_ids = ["${var.subnet_ids}"] }