Skip to content

Commit

Permalink
update to allow for engine version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
drpebcak committed Dec 2, 2020
1 parent 1182ab6 commit 0588e1b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ resource "aws_docdb_subnet_group" "docdb" {
subnet_ids = var.group_subnets
}

resource "aws_docdb_cluster" "api_docdb" {
resource "aws_docdb_cluster" "docdb" {
cluster_identifier_prefix = var.name
db_subnet_group_name = aws_docdb_subnet_group.docdb.name
db_cluster_parameter_group_name = aws_docdb_cluster_parameter_group.api_docdb.name
db_cluster_parameter_group_name = aws_docdb_cluster_parameter_group.docdb.name
vpc_security_group_ids = var.cluster_security_group
engine = "docdb"
engine = var.engine
master_username = var.master_username
master_password = var.master_password
storage_encrypted = var.storage_encrypted
Expand All @@ -22,13 +22,13 @@ resource "aws_docdb_cluster" "api_docdb" {
resource "aws_docdb_cluster_instance" "cluster_instances" {
count = var.cluster_instance_count
identifier = "${var.name}-${count.index}"
cluster_identifier = aws_docdb_cluster.api_docdb.id
cluster_identifier = aws_docdb_cluster.docdb.id
instance_class = var.cluster_instance_class
ca_cert_identifier = var.ca_cert_identifier
}

resource "aws_docdb_cluster_parameter_group" "api_docdb" {
family = "docdb3.6"
resource "aws_docdb_cluster_parameter_group" "docdb" {
family = var.family
name_prefix = var.name
description = "${var.name} docdb cluster parameter group"
dynamic "parameter" {
Expand Down
14 changes: 7 additions & 7 deletions output.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
output "arn" {
value = aws_docdb_cluster.api_docdb.arn
value = aws_docdb_cluster.docdb.arn
}

output "cluster_members" {
value = aws_docdb_cluster.api_docdb.cluster_members
value = aws_docdb_cluster.docdb.cluster_members
}

output "cluster_resource_id" {
value = aws_docdb_cluster.api_docdb.cluster_resource_id
value = aws_docdb_cluster.docdb.cluster_resource_id
}

output "endpoint" {
value = aws_docdb_cluster.api_docdb.endpoint
value = aws_docdb_cluster.docdb.endpoint
}

output "hosted_zone_id" {
value = aws_docdb_cluster.api_docdb.hosted_zone_id
value = aws_docdb_cluster.docdb.hosted_zone_id
}

output "id" {
value = aws_docdb_cluster.api_docdb.id
value = aws_docdb_cluster.docdb.id
}

output "reader_endpoint" {
value = aws_docdb_cluster.api_docdb.reader_endpoint
value = aws_docdb_cluster.docdb.reader_endpoint
}
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,21 @@ variable "ca_cert_identifier" {
description = "Optional, identifier of the CA certificate to use for DB instance"
type = string
}

variable "family" {
default = "docdb3.6"
description = "Version of docdb family being created"
type = string
}

variable "engine" {
default = "docdb"
description = "The name of the database engine to be used for this DB cluster. Only `docdb` is supported."
type = string
}

variable "engine_version" {
default = "3.6.0"
description = "The database engine version. Updating this argument results in an outage."
type = string
}

0 comments on commit 0588e1b

Please sign in to comment.