Skip to content

Commit 22b501f

Browse files
Create variables to manage KMS enablement for RDS and Elasticache (#20)
1 parent fa41ef6 commit 22b501f

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

postgres-variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ variable "postgres_enabled" {
2828
default = false
2929
}
3030

31+
variable "postgres_enable_kms" {
32+
type = bool
33+
description = "Enable KMS encryption"
34+
default = true
35+
}
36+
3137
variable "postgres_engine_version" {
3238
description = "Version for RDS database engine"
3339
type = string

postgres.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module "postgres" {
1616
storage_encrypted = var.postgres_storage_encrypted
1717
subnet_ids = module.network.private_subnet_ids
1818
vpc_id = module.network.vpc.id
19+
enable_kms = var.postgres_enable_kms
1920
}
2021

2122
resource "random_id" "parameter_group" {

redis-variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ variable "redis_enabled" {
44
default = false
55
}
66

7+
variable "redis_enable_kms" {
8+
description = "Enable KMS encryption"
9+
type = bool
10+
default = true
11+
}
12+
713
variable "redis_name" {
814
description = "Name of the ElastiCache instance for Redis"
915
type = string

redis.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module "redis" {
1010
replica_count = var.redis_replica_count
1111
subnet_ids = module.network.private_subnet_ids
1212
vpc_id = module.network.vpc.id
13+
enable_kms = var.redis_enable_kms
1314
}
1415

1516
module "redis_token" {

0 commit comments

Comments
 (0)