Skip to content

Commit

Permalink
feat: added sg description
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jun 12, 2023
1 parent 5a0cf3a commit 9b1ade1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
10 changes: 6 additions & 4 deletions _example/memcached/example.tf
Expand Up @@ -74,9 +74,11 @@ module "memcached" {
####----------------------------------------------------------------------------------
## will create ROUTE-53 for redis which will add the dns of the cluster.
####----------------------------------------------------------------------------------
dns_record_name = "prod"
route53_ttl = "300"
route53_type = "CNAME"
route53_zone_id = "FTOFGXXXXDFDFF"
route53_record_enabled = false
ssm_parameter_endpoint_enabled = false
dns_record_name = "prod"
route53_ttl = "300"
route53_type = "CNAME"
route53_zone_id = "SERFxxxx6XCsY9Lxxxxx"

}
6 changes: 3 additions & 3 deletions _example/redis-cluster/example.tf
Expand Up @@ -75,10 +75,10 @@ module "redis-cluster" {
####----------------------------------------------------------------------------------
## will create ROUTE-53 for redis which will add the dns of the cluster.
####----------------------------------------------------------------------------------
ssm_parameter_endpoint_enabled = true
route53_record_enabled = true
route53_record_enabled = false
ssm_parameter_endpoint_enabled = false
dns_record_name = "prod"
route53_ttl = "300"
route53_type = "CNAME"
route53_zone_id = "Z0xxxx16XCxxxxxxx4"
route53_zone_id = "SERFxxxx6XCsY9Lxxxxx"
}
4 changes: 2 additions & 2 deletions _example/redis/example.tf
Expand Up @@ -91,8 +91,8 @@ module "redis" {
####----------------------------------------------------------------------------------
## will create ROUTE-53 for redis which will add the dns of the cluster.
####----------------------------------------------------------------------------------
route53_record_enabled = true
ssm_parameter_endpoint_enabled = true
route53_record_enabled = false
ssm_parameter_endpoint_enabled = false
dns_record_name = "prod"
route53_ttl = "300"
route53_type = "CNAME"
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Expand Up @@ -42,7 +42,7 @@ data "aws_security_group" "existing" {
resource "aws_security_group_rule" "egress" {
count = (var.enable_security_group == true && length(var.sg_ids) < 1 && var.is_external == false && var.egress_rule == true) ? 1 : 0

description = var.sg_egress_description
description = var.sg_egress_description
type = "egress"
from_port = 0
to_port = 65535
Expand All @@ -54,7 +54,7 @@ resource "aws_security_group_rule" "egress" {
resource "aws_security_group_rule" "egress_ipv6" {
count = (var.enable_security_group == true && length(var.sg_ids) < 1 && var.is_external == false) && var.egress_rule == true ? 1 : 0

description = var.sg_egress_description
description = var.sg_egress_ipv6_description
type = "egress"
from_port = 0
to_port = 65535
Expand All @@ -65,7 +65,7 @@ resource "aws_security_group_rule" "egress_ipv6" {
resource "aws_security_group_rule" "ingress" {
count = length(var.allowed_ip) > 0 == true && length(var.sg_ids) < 1 ? length(compact(var.allowed_ports)) : 0

description = var.sg_egress_description
description = var.sg_ingress_description
type = "ingress"
from_port = element(var.allowed_ports, count.index)
to_port = element(var.allowed_ports, count.index)
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Expand Up @@ -381,6 +381,18 @@ variable "sg_egress_description" {
description = "Description of the egress and ingress rule"
}

variable "sg_egress_ipv6_description" {
type = string
default = "Description of the rule."
description = "Description of the egress_ipv6 rule"
}

variable "sg_ingress_description" {
type = string
default = "Description of the ingress rule use elasticache."
description = "Description of the ingress rule"
}

##---------------------route53------------------------
variable "route53_record_enabled" {
type = bool
Expand Down

0 comments on commit 9b1ade1

Please sign in to comment.