Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove kms_key_id for Unencrypted Storage #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource "aws_db_instance" "blank-database" {
port = var.postgresql_port
copy_tags_to_snapshot = var.postgresql_copy_tags_to_snapshot
storage_encrypted = var.postgresql_storage_encrypted
kms_key_id = aws_kms_key.main.arn
vpc_security_group_ids = [aws_security_group.firewall_rule.id]
kms_key_id = var.postgresql_storage_encrypted? aws_kms_key.main.arn: null
vpc_security_group_ids = distinct(concat([aws_security_group.firewall_rule.id],var.extra_security_groups))
final_snapshot_identifier = var.postgresql_name
backup_retention_period = var.postgresql_backup_retention_period
backup_window = var.postgresql_backup_window
Expand Down Expand Up @@ -50,7 +50,7 @@ resource "aws_db_instance" "from-snapshot" {
multi_az = var.postgresql_multi_az
port = var.postgresql_port
storage_encrypted = var.postgresql_storage_encrypted
kms_key_id = aws_kms_key.main.arn
kms_key_id = var.postgresql_storage_encrypted? aws_kms_key.main.arn: null
vpc_security_group_ids = [aws_security_group.firewall_rule.id]
snapshot_identifier = var.postgresql_source_snapshot_identifier
skip_final_snapshot = true
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,9 @@ variable "postgresql_parameters" {
default = {}
description = "The map of DB parameters and their values"
}

variable "extra_security_groups"{
type = list(string)
description = "Extra security groups to add to the RDS instance"
default = []
}