variable "rds_postgres_username" {}
variable "rds_postgres_password" {}
variable "rds_postgres_databasename" {}

resource "aws_db_instance" "postgres" {
  allocated_storage    = 10
  storage_type         = "gp2"
  engine               = "postgres"
  engine_version       = "9.6.8"
  instance_class       = "db.t2.micro"
  skip_final_snapshot  = true
  name                 = "${var.rds_postgres_databasename}"
  username             = "${var.rds_postgres_username}"
  password             = "${var.rds_postgres_password}"
  db_subnet_group_name = "${aws_db_subnet_group.default.id}"
  parameter_group_name = "default.postgres9.6"
  publicly_accessible    = true
}

output "aws_postgres_endpoint" {
  value = "${aws_db_instance.postgres.endpoint}"
}

variable "rds_postgres_username" {}
variable "rds_postgres_password" {}
variable "rds_postgres_databasename" {}

resource "aws_db_instance" "postgres" {
  allocated_storage    = 10
  storage_type         = "gp2"
  engine               = "postgres"
  engine_version       = "9.6.8"
  instance_class       = "db.t2.micro"
  skip_final_snapshot  = true
  name                 = "${var.rds_postgres_databasename}"
  username             = "${var.rds_postgres_username}"
  password             = "${var.rds_postgres_password}"
  vpc_security_group_ids = ["${aws_security_group.allow-db-access.id}"]
  db_subnet_group_name = "${aws_db_subnet_group.default.id}"
  parameter_group_name = "default.postgres9.6"
  publicly_accessible    = true
}

output "aws_postgres_endpoint" {
  value = "${aws_db_instance.postgres.endpoint}"
}

Allow all inbound access to aws postgres instances
Allow all inbound access to aws postgres instances

[#158168890](https://www.pivotaltracker.com/story/show/158168890)

Co-authored-by: Luan Santos <509a85c757dc22c0257f4655fb3fb682d42f965b@pivotal.io>

barthy1/bosh,barthy1/bosh,barthy1/bosh,barthy1/bosh