Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrampeter committed Dec 10, 2024
1 parent d1d5df7 commit 862d329
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ locals {
use_password_auth = null
use_tls = null
}
) : try(
) : try(
module.redis[0],
{
hostname = null
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ module "redis" {
module "redis_sentinel" {
count = var.enable_redis_sentinel ? 1 : 0
source = "./modules/redis-sentinel"
domain_name = var.domain_name
tfe_instance_sg = module.vm.tfe_instance_sg

domain_name = var.domain_name
tfe_instance_sg = module.vm.tfe_instance_sg

aws_iam_instance_profile = module.service_accounts.iam_instance_profile.name
asg_tags = var.asg_tags
Expand Down
12 changes: 6 additions & 6 deletions modules/redis-sentinel/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

locals {
redis_user_data_template = "${path.module}/script.sh"
redis_leader_user_data = templatefile(local.redis_user_data_template, {
redis_leader_user_data = templatefile(local.redis_user_data_template, {

compose = base64encode(templatefile(local.compose_path, {
redis_sentinel_password = var.redis_sentinel_password
redis_sentinel_password = var.redis_sentinel_password
redis_sentinel_leader_name = var.redis_sentinel_leader_name
redis_sentinel_port = var.redis_sentinel_port
redis_port = var.redis_port
redis_password = var.redis_password
}))})
redis_sentinel_port = var.redis_sentinel_port
redis_port = var.redis_port
redis_password = var.redis_password
})) })
compose_path = "${path.module}/compose.yaml"
tags = concat(
[
Expand Down
36 changes: 18 additions & 18 deletions modules/redis-sentinel/security-group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ resource "aws_security_group" "redis_sentinel_inbound_allow" {
}

resource "aws_security_group_rule" "redis_sentinel_leader" {
security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 6379
to_port = 6379
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 6379
to_port = 6379
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
}

resource "aws_security_group_rule" "redis_sentinel" {
security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 26379
to_port = 26379
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 26379
to_port = 26379
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
}

resource "aws_security_group_rule" "ssh_inbound" {

security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
security_group_id = aws_security_group.redis_sentinel_inbound_allow.id
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = var.network_private_subnet_cidrs
}

resource "aws_security_group_rule" "redis_sentinel_inbound" {
Expand Down
6 changes: 3 additions & 3 deletions modules/redis-sentinel/sentinel.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ resource "aws_autoscaling_group" "redis_sentinel" {
max_size = 1
desired_capacity = 1
vpc_zone_identifier = var.network_subnets_private
target_group_arns = [ aws_lb_target_group.redis_sentinel_tg_6379.arn,
aws_lb_target_group.redis_sentinel_tg_26379.arn
target_group_arns = [aws_lb_target_group.redis_sentinel_tg_6379.arn,
aws_lb_target_group.redis_sentinel_tg_26379.arn
]

# Increases grace period for any AMI that is not the default Ubuntu
# since RHEL has longer startup time
health_check_grace_period = local.health_check_grace_period
Expand Down
14 changes: 7 additions & 7 deletions modules/redis-sentinel/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,41 +91,41 @@ variable "tfe_instance_sg" {
variable "redis_sentinel_port" {
description = "The redis sentinel follower port"
type = number
default = 26379
default = 26379
}

variable "redis_port" {
description = "The redis sentinel follower port"
type = number
default = 6379
default = 6379
}

variable "redis_sentinel_password" {
description = "The password for the redis sentinel"
type = string
default = "hashicorp"
default = "hashicorp"
}

variable "redis_sentinel_leader_name" {
description = "The redis sentinel leader hostname"
type = string
default = "main"
default = "main"
}

variable "redis_password" {
description = "The password for the redis sentinel"
type = string
default = "hashicorp"
default = "hashicorp"
}

variable "redis_use_password_auth" {
description = "A boolean which indicates if password authentication is required by the Redis"
type = bool
default = true
default = true
}

variable "use_tls" {
description = "A boolean which indicates if TLS is required by the Redis"
type = bool
default = false
default = false
}

0 comments on commit 862d329

Please sign in to comment.