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

Release 0.10.0 -- add IPv6 option #17

Merged
merged 3 commits into from
Dec 2, 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: 0 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ locals {
app_name_and_env = "${var.app_name}-${local.app_env}"
app_env = var.app_env

db_host = module.rds.address
db_password = random_password.db_root.result

account = data.aws_caller_identity.this.account_id
Expand Down Expand Up @@ -65,7 +64,6 @@ resource "aws_iam_user_policy" "cd" {
Action = [
"ecs:ListTasks",
]
"Effect" : "Allow",
"Condition" : {
"ArnEquals" : {
"ecs:cluster" : "arn:aws:ecs:*:${local.account}:cluster/${module.ecsasg.ecs_cluster_name}"
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ variable "default_cert_domain_name" {
type = string
}

variable "disable_public_ipv4" {
description = "Set to true to remove the public IPv4 addresses from the ALB. Requires enable_ipv6 = true"
type = bool
default = false
}

variable "enable_ipv6" {
description = "Set to true to enable IPV6 in the ALB and VPC"
type = bool
default = false
}

variable "health_check" {
description = "Elastic Load Balancer health check configuration"
type = map(string)
Expand Down
30 changes: 18 additions & 12 deletions vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ module "vpc" {
source = "silinternational/vpc/aws"
version = "~> 1.0"

app_name = var.app_name
app_env = var.app_env
aws_zones = var.aws_zones
app_name = var.app_name
app_env = var.app_env
aws_zones = var.aws_zones
enable_ipv6 = var.enable_ipv6
}

/*
Expand Down Expand Up @@ -91,15 +92,19 @@ data "aws_acm_certificate" "default" {
* Create application load balancer for public access
*/
module "alb" {
source = "github.com/silinternational/terraform-modules//aws/alb?ref=8.13.3"
app_name = var.app_name
app_env = var.app_env
internal = "false"
vpc_id = module.vpc.id
security_groups = [module.vpc.vpc_default_sg_id, module.cloudflare-sg.id]
subnets = module.vpc.public_subnet_ids
certificate_arn = data.aws_acm_certificate.default.arn
tg_name = "default-${var.app_name}-${var.app_env}"
source = "silinternational/alb/aws"
version = "~> 1.1"

app_name = var.app_name
app_env = var.app_env
enable_ipv6 = var.enable_ipv6
disable_public_ipv4 = var.disable_public_ipv4
internal = "false"
vpc_id = module.vpc.id
security_groups = [module.vpc.vpc_default_sg_id, module.cloudflare-sg.id]
subnets = module.vpc.public_subnet_ids
certificate_arn = data.aws_acm_certificate.default.arn
tg_name = "default-${var.app_name}-${var.app_env}"
}

/*
Expand All @@ -121,4 +126,5 @@ module "ecsasg" {
use_amazon_linux2 = true
instance_type = var.instance_type
tags = var.asg_tags
enable_ipv6 = var.enable_ipv6
}