feat: adding rds disk encryption option

This commit is contained in:
Pierre Mavro
2021-12-21 00:45:55 +01:00
committed by Pierre Mavro
parent b4402cf03b
commit 3e8c93e902
18 changed files with 41 additions and 2 deletions

View File

@@ -90,6 +90,7 @@ resource "aws_docdb_cluster" "documentdb_cluster" {
master_username = var.username
engine = "docdb"
{%- endif %}
storage_encrypted = var.encrypt_disk
# Network
db_subnet_group_name = data.aws_subnet_ids.k8s_subnet_ids.id

View File

@@ -34,4 +34,10 @@ variable "password" {
description = "Admin password for the master DB user"
default = "{{ database_password }}"
type = string
}
variable "encrypt_disk" {
description = "Enable disk encryption"
default = "{{ encrypt_disk }}"
type = string
}

View File

@@ -87,6 +87,7 @@ resource "aws_db_instance" "mysql_instance" {
password = var.password
name = var.database_name
parameter_group_name = aws_db_parameter_group.mysql_parameter_group.name
storage_encrypted = var.encrypt_disk
{%- if snapshot is defined and snapshot["snapshot_id"] %}
# Snapshot
snapshot_identifier = var.snapshot_identifier

View File

@@ -36,6 +36,12 @@ variable "storage_type" {
type = string
}
variable "encrypt_disk" {
description = "Enable disk encryption"
default = "{{ encrypt_disk }}"
type = string
}
variable "instance_class" {
description = "Type of instance: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html"
default = "{{database_instance_type}}"

View File

@@ -73,6 +73,7 @@ resource "aws_db_instance" "postgresql_instance" {
delete = "60m"
}
password = var.password
storage_encrypted = var.encrypt_disk
{%- if snapshot and snapshot["snapshot_id"] %}
# Snapshot
snapshot_identifier = var.snapshot_identifier

View File

@@ -30,6 +30,12 @@ variable "storage_type" {
type = string
}
variable "encrypt_disk" {
description = "Enable disk encryption"
default = "{{ encrypt_disk }}"
type = string
}
variable "instance_class" {
description = "Type of instance: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html"
default = "{{ database_instance_type }}"