Commit a1b1a8c2 authored by Felipe Martin's avatar Felipe Martin

Using `encrypted` to set the db_instance.storage_encrypted

parent 0e1f9c7a
...@@ -63,5 +63,7 @@ module "db_instance" { ...@@ -63,5 +63,7 @@ module "db_instance" {
backup_retention_period = "${var.backup_retention_period}" backup_retention_period = "${var.backup_retention_period}"
backup_window = "${var.backup_window}" backup_window = "${var.backup_window}"
storage_encrypted = "${var.encrypted}"
tags = "${var.tags}" tags = "${var.tags}"
} }
...@@ -34,5 +34,7 @@ resource "aws_db_instance" "this" { ...@@ -34,5 +34,7 @@ resource "aws_db_instance" "this" {
backup_retention_period = "${var.backup_retention_period}" backup_retention_period = "${var.backup_retention_period}"
backup_window = "${var.backup_window}" backup_window = "${var.backup_window}"
storage_encrypted = "${var.storage_encrypted}"
tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}" tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}"
} }
...@@ -116,3 +116,8 @@ variable "tags" { ...@@ -116,3 +116,8 @@ variable "tags" {
description = "A mapping of tags to assign to all resources" description = "A mapping of tags to assign to all resources"
default = {} default = {}
} }
variable "storage_encrypted" {
description = "Defines if the storage should be encrypted or not"
default = false
}
...@@ -112,6 +112,11 @@ variable "tags" { ...@@ -112,6 +112,11 @@ variable "tags" {
default = {} default = {}
} }
variable "encrypted" {
description = "Defines wether this instance should be encrypted or not"
default = false
}
# DB subnet group # DB subnet group
variable "subnet_ids" { variable "subnet_ids" {
type = "list" type = "list"
......
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