Skip to content

Commit

Permalink
Enabled encryption on production database. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes authored Apr 18, 2023
1 parent 240634e commit 5cd1525
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions environments/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ module "hosting" {
database_max_capacity = 3
database_min_capacity = 2

# Snapshot created in order to enable encryption at rest.
database_starting_snapshot = "r911-production-encrypt"

environment_variables = {
LAUNCHY_DRY_RUN : true,
BROWSER : "/dev/null",
Expand Down
1 change: 1 addition & 0 deletions modules/data_warehouse/redshift.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "aws_redshiftserverless_namespace" "warehouse" {
resource "aws_redshiftserverless_workgroup" "warehouse" {
namespace_name = aws_redshiftserverless_namespace.warehouse.namespace_name
workgroup_name = "${local.prefix}-warehouse"
base_capacity = var.base_rpu
enhanced_vpc_routing = true
publicly_accessible = false
security_group_ids = [
Expand Down
6 changes: 6 additions & 0 deletions modules/data_warehouse/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
variable "base_rpu" {
type = number
default = 32
description = "The base Redshift processing units (RSU) to assign to the Redshift cluster."
}

variable "data_lake_bucket" {
type = string
description = "Name of the bucket to be used as a data lake."
Expand Down
4 changes: 2 additions & 2 deletions modules/rails_hosting/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ resource "aws_rds_cluster" "db" {
db_subnet_group_name = aws_db_subnet_group.db.name
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = "14.3"
vpc_security_group_ids = [aws_security_group.db_access.id]
skip_final_snapshot = var.skip_db_final_snapshot
final_snapshot_identifier = "${local.prefix}-final-snapshot"
copy_tags_to_snapshot = true
snapshot_identifier = var.database_starting_snapshot

Expand All @@ -32,7 +32,7 @@ resource "aws_rds_cluster" "db" {

lifecycle {
create_before_destroy = true
ignore_changes = [cluster_identifier_prefix, master_password]
ignore_changes = [master_password]
}
}

Expand Down

0 comments on commit 5cd1525

Please sign in to comment.