Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Jun 9, 2019
1 parent 2d42736 commit 05360c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Root module calls these modules which can also be used separately to create inde
* [db_parameter_group](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_parameter_group) - creates RDS DB parameter group
* [db_option_group](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_option_group) - creates RDS DB option group

## Terraform versions

Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch.

Terraform 0.11. Pin module version to `~> v1.0`. Submit pull-requests to `terraform011` branch.

## Usage

```hcl
Expand Down
8 changes: 6 additions & 2 deletions examples/enhanced-monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,31 @@ module "db" {
storage_encrypted = false

# kms_key_id = "arm:aws:kms:<region>:<accound id>:key/<kms key id>"

name = "demodb"
username = "user"
password = "YourPwdShouldBeLongAndSecure!"
port = "3306"
vpc_security_group_ids = ["${data.aws_security_group.default.id}"]
maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
backup_retention_period = 0 // disable backups to create DB faster
backup_retention_period = 0 // disable backups to create DB faster

tags = {
Owner = "user"
Environment = "dev"
}

# DB subnet group
subnet_ids = ["${data.aws_subnet_ids.all.ids}"]

# DB parameter group
family = "mysql5.7"

# DB option group
major_engine_version = "5.7"
monitoring_interval = "30"
monitoring_role_arn = "${aws_iam_role.rds_enhanced_monitoring.arn}"

# Database Deletion Protection
deletion_protection = true
}
4 changes: 2 additions & 2 deletions modules/db_instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
is_mssql = "${element(split("-",var.engine), 0) == "sqlserver"}"
is_mssql = "${element(split("-", var.engine), 0) == "sqlserver"}"
}

resource "aws_iam_role" "enhanced_monitoring" {
Expand All @@ -18,7 +18,7 @@ resource "aws_iam_role_policy_attachment" "enhanced_monitoring" {
}

resource "aws_db_instance" "this" {
count = "${var.create && !local.is_mssql ? 1 : 0}"
count = "${var.create && ! local.is_mssql ? 1 : 0}"

identifier = "${var.identifier}"

Expand Down

0 comments on commit 05360c2

Please sign in to comment.