terraform/examples/aws-rds/main.tf

20 lines
726 B
Terraform
Raw Normal View History

2015-06-09 17:02:19 +02:00
resource "aws_db_instance" "default" {
2015-06-09 18:37:22 +02:00
depends_on = "aws_security_group.default"
2015-06-09 17:02:19 +02:00
identifier = "${var.identifier}"
allocated_storage = "${var.storage}"
engine = "${var.engine}"
2015-06-09 18:37:22 +02:00
engine_version = "${lookup(var.engine_version, var.engine)}"
instance_class = "${var.instance_class}"
2015-06-09 17:02:19 +02:00
name = "${var.db_name}"
username = "${var.username}"
password = "${var.password}"
2015-06-09 18:37:22 +02:00
vpc_security_group_ids = ["${aws_security_group.default.id}"]
db_subnet_group_name = "${aws_db_subnet_group.default.id}"
2015-06-09 17:02:19 +02:00
}
resource "aws_db_subnet_group" "default" {
2015-06-09 18:37:22 +02:00
name = "main_subnet_group"
2015-06-09 17:02:19 +02:00
description = "Our main group of subnets"
subnet_ids = ["${aws_subnet.subnet_1.id}", "${aws_subnet.subnet_2.id}"]
}