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

Enable adding VPN SG explicitly #4

Merged
merged 3 commits into from
Aug 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resource "aws_elasticache_replication_group" "redis" {
port = var.redis_port
parameter_group_name = aws_elasticache_parameter_group.redis_parameter_group.id
subnet_group_name = aws_elasticache_subnet_group.redis_subnet_group.id
security_group_ids = [aws_security_group.redis_security_group.id]
security_group_ids = compact([aws_security_group.redis_security_group.id, var.enable_vpn_sg ? var.vpn_sg_id : ""])
apply_immediately = var.apply_immediately
maintenance_window = var.redis_maintenance_window
snapshot_window = var.redis_snapshot_window
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ variable "allowed_security_groups" {
default = []
}

variable "enable_vpn_sg" {
description = "Specifies whether to explicitly reference VPC SG for the Redis Instance"
type = bool
default = false
}

variable "vpn_sg_id" {
description = "VPC SG id to explicitly reference under Network & Security for the Redis Instance"
type = string
default = ""
}

variable "env" {
description = "env to deploy into, should typically dev/staging/prod"
type = string
Expand Down