Commit 2f379b98 authored by Anton Babenko's avatar Anton Babenko Committed by GitHub

Renamed count to created in submodules (#44)

parent f3dfb61f
# EditorConfig is awesome: http://EditorConfig.org
# Uses editorconfig to maintain consistent coding styles
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true
[*.{tf,tfvars}]
indent_size = 2
indent_style = space
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[Makefile]
tab_width = 2
indent_style = tab
[COMMIT_EDITMSG]
max_line_length = 0
\ No newline at end of file
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
sha: v1.5.0
hooks:
- id: terraform_fmt
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.2.0
hooks:
- id: check-merge-conflict
...@@ -9,7 +9,7 @@ locals { ...@@ -9,7 +9,7 @@ locals {
module "db_subnet_group" { module "db_subnet_group" {
source = "./modules/db_subnet_group" source = "./modules/db_subnet_group"
count = "${local.enable_create_db_subnet_group}" create = "${local.enable_create_db_subnet_group}"
identifier = "${var.identifier}" identifier = "${var.identifier}"
name_prefix = "${var.identifier}-" name_prefix = "${var.identifier}-"
subnet_ids = ["${var.subnet_ids}"] subnet_ids = ["${var.subnet_ids}"]
...@@ -23,7 +23,7 @@ module "db_subnet_group" { ...@@ -23,7 +23,7 @@ module "db_subnet_group" {
module "db_parameter_group" { module "db_parameter_group" {
source = "./modules/db_parameter_group" source = "./modules/db_parameter_group"
count = "${var.create_db_parameter_group}" create = "${var.create_db_parameter_group}"
identifier = "${var.identifier}" identifier = "${var.identifier}"
name_prefix = "${var.identifier}-" name_prefix = "${var.identifier}-"
family = "${var.family}" family = "${var.family}"
...@@ -39,7 +39,7 @@ module "db_parameter_group" { ...@@ -39,7 +39,7 @@ module "db_parameter_group" {
module "db_instance" { module "db_instance" {
source = "./modules/db_instance" source = "./modules/db_instance"
count = "${var.create_db_instance}" create = "${var.create_db_instance}"
identifier = "${var.identifier}" identifier = "${var.identifier}"
engine = "${var.engine}" engine = "${var.engine}"
engine_version = "${var.engine_version}" engine_version = "${var.engine_version}"
......
...@@ -17,7 +17,7 @@ resource "aws_iam_role_policy_attachment" "enhanced_monitoring" { ...@@ -17,7 +17,7 @@ resource "aws_iam_role_policy_attachment" "enhanced_monitoring" {
} }
resource "aws_db_instance" "this" { resource "aws_db_instance" "this" {
count = "${var.count ? 1 : 0}" count = "${var.create ? 1 : 0}"
identifier = "${var.identifier}" identifier = "${var.identifier}"
......
variable "count" { variable "create" {
description = "Whether to create this resource or not?" description = "Whether to create this resource or not?"
default = 1 default = true
} }
variable "identifier" { variable "identifier" {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# DB parameter group # DB parameter group
##################### #####################
resource "aws_db_parameter_group" "this" { resource "aws_db_parameter_group" "this" {
count = "${var.count ? 1 : 0}" count = "${var.create ? 1 : 0}"
name_prefix = "${var.name_prefix}" name_prefix = "${var.name_prefix}"
description = "Database parameter group for ${var.identifier}" description = "Database parameter group for ${var.identifier}"
......
variable "count" { variable "create" {
description = "Whether to create this resource or not?" description = "Whether to create this resource or not?"
default = 1 default = true
} }
variable "name_prefix" { variable "name_prefix" {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# DB subnet group # DB subnet group
################## ##################
resource "aws_db_subnet_group" "this" { resource "aws_db_subnet_group" "this" {
count = "${var.count ? 1 : 0}" count = "${var.create ? 1 : 0}"
name_prefix = "${var.name_prefix}" name_prefix = "${var.name_prefix}"
description = "Database subnet group for ${var.identifier}" description = "Database subnet group for ${var.identifier}"
......
variable "count" { variable "create" {
description = "Whether to create this resource or not?" description = "Whether to create this resource or not?"
default = 1 default = true
} }
variable "name_prefix" { variable "name_prefix" {
......
...@@ -205,4 +205,3 @@ variable "create_db_instance" { ...@@ -205,4 +205,3 @@ variable "create_db_instance" {
description = "Whether to create a database instance" description = "Whether to create a database instance"
default = true default = true
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment