-
Notifications
You must be signed in to change notification settings - Fork 0
/
06_document-db.tf
26 lines (23 loc) · 992 Bytes
/
06_document-db.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
resource "aws_docdb_subnet_group" "main" {
subnet_ids = [
module.private_subnet_0.id,
module.private_subnet_1.id
]
}
resource "aws_docdb_cluster" "main" {
cluster_identifier = "${var.namespace}-${var.environment}-cluster"
master_username = var.doc_db_master_username
master_password = var.doc_db_master_password
db_subnet_group_name = aws_docdb_subnet_group.main.name
vpc_security_group_ids = [
aws_security_group.private_docdb.id
]
tags = merge(local.tags, {"Name"="${var.namespace}-${var.environment}-docdb-cluster"})
}
resource "aws_docdb_cluster_instance" "instance_0" {
auto_minor_version_upgrade = true
cluster_identifier = aws_docdb_cluster.main.id
instance_class = "db.t3.medium"
identifier = "${var.namespace}-${var.environment}-instance-0"
tags = merge(local.tags, {"Name"="${var.namespace}-${var.environment}-docdb-instance-0"})
}