diff --git a/README.md b/README.md index b6c38d2..843d95a 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,52 @@ resource "aws_rds_cluster_parameter_group" "aurora_57_cluster_parameter_group" { description = "test-aurora-57-cluster-parameter-group" } ``` +### Aurora 2.x (MySQL 5.7) (I/O Optimised) + +```hcl +resource "aws_sns_topic" "db_alarms" { + name = "aurora-db-alarms" +} + +module "aurora_db_57" { + source = "claranet/aurora/aws" + engine = "aurora-mysql" + engine-version = "5.7.12" + name = "test-aurora-db-57" + envname = "test-57" + envtype = "test" + subnets = ["${module.vpc.private_subnets}"] + azs = ["${module.vpc.availability_zones}"] + replica_count = "1" + security_groups = ["${aws_security_group.allow_all.id}"] + instance_type = "db.t2.medium" + username = "root" + password = "changeme" + backup_retention_period = "5" + final_snapshot_identifier = "final-db-snapshot-prod" + storage_encrypted = "true" + storage_type = "aurora-iopt1" + apply_immediately = "true" + monitoring_interval = "10" + cw_alarms = true + cw_sns_topic = "${aws_sns_topic.db_alarms.id}" + db_parameter_group_name = "${aws_db_parameter_group.aurora_db_57_parameter_group.id}" + db_cluster_parameter_group_name = "${aws_rds_cluster_parameter_group.aurora_57_cluster_parameter_group.id}" +} + +resource "aws_db_parameter_group" "aurora_db_57_parameter_group" { + name = "test-aurora-db-57-parameter-group" + family = "aurora-mysql5.7" + description = "test-aurora-db-57-parameter-group" +} + +resource "aws_rds_cluster_parameter_group" "aurora_57_cluster_parameter_group" { + name = "test-aurora-57-cluster-parameter-group" + family = "aurora-mysql5.7" + description = "test-aurora-57-cluster-parameter-group" +} +``` + ### Aurora PostgreSQL ```hcl @@ -203,6 +249,7 @@ resource "aws_rds_cluster_parameter_group" "aurora_cluster_postgres96_parameter_ | skip_final_snapshot | Should a final snapshot be created on cluster destroy | string | `false` | no | | snapshot_identifier | DB snapshot to create this database from | string | `""` | no | | storage_encrypted | Specifies whether the underlying storage layer should be encrypted | string | `true` | no | +| storage_type | Specifies the storage type to be associated with the DB cluster (use aurora-iopt1 for I/O Optimized) | string | `""` | no | | subnets | List of subnet IDs to use | list | - | yes | | username | Master DB username | string | `root` | no | diff --git a/main.tf b/main.tf index eb40537..4a0f686 100644 --- a/main.tf +++ b/main.tf @@ -241,6 +241,7 @@ resource "aws_rds_cluster" "default" { vpc_security_group_ids = var.security_groups snapshot_identifier = var.snapshot_identifier storage_encrypted = var.storage_encrypted + storage_type = var.storage_type apply_immediately = var.apply_immediately db_cluster_parameter_group_name = var.db_cluster_parameter_group_name deletion_protection = var.deletion_protection diff --git a/variables.tf b/variables.tf index 9018b8d..a0b0358 100644 --- a/variables.tf +++ b/variables.tf @@ -152,6 +152,12 @@ variable "storage_encrypted" { description = "Specifies whether the underlying storage layer should be encrypted" } +variable "storage_type" { + type = string + default = "" + description = "Specifies the storage type to be associated with the DB cluster" +} + variable "cw_alarms" { type = string default = false