mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 17:01:04 -06:00
c6beaa7ce8
Signed-off-by: Valentin Pichard <valentin.pichard@corp.ovh.com>
20 lines
817 B
HCL
20 lines
817 B
HCL
resource "aws_db_instance" "default" {
|
|
depends_on = ["aws_security_group.default"]
|
|
identifier = "${var.identifier}"
|
|
allocated_storage = "${var.storage}"
|
|
engine = "${var.engine}"
|
|
engine_version = "${lookup(var.engine_version, var.engine)}"
|
|
instance_class = "${var.instance_class}"
|
|
name = "${var.db_name}"
|
|
username = "${var.username}"
|
|
password = "${var.password}"
|
|
vpc_security_group_ids = ["${aws_security_group.default.id}"]
|
|
db_subnet_group_name = "${aws_db_subnet_group.default.id}"
|
|
}
|
|
|
|
resource "aws_db_subnet_group" "default" {
|
|
name = "main_subnet_group"
|
|
description = "Our main group of subnets"
|
|
subnet_ids = ["${aws_subnet.subnet_1.id}", "${aws_subnet.subnet_2.id}"]
|
|
}
|