Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
/ terraform-aws-alb Public archive

Terraform module for AWS ALB used internally at Comtravo

License

Notifications You must be signed in to change notification settings

comtravo/terraform-aws-alb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comtravo's Terraform AWS ALB module

Usage:

module "website-alb" {
  source = "github.com/comtravo/terraform-aws-alb?ref=3.0.0"

  environment        = terraform.workspace
  name               = "website"
  internal           = false
  vpc_id             = module.main_vpc.vpc_id
  security_group_ids = [aws_security_group.website-alb.id]
  subnet_ids         = module.main_vpc.public_subnets
  idle_timeout       = 120

  http_listener_port = 80

  https_listener_config = {
    port         = 443
    certificates = [
      data.aws_acm_certificate.comtravoDotCom.arn,
      data.aws_acm_certificate.webDotComtravoDotCom.arn,
      data.aws_acm_certificate.comtravoDotDe.arn
    ],
     number_of_certificates = 3
  }
}

Requirements

Name Version
terraform >= 0.13
aws ~> 3.0

Providers

Name Version
aws ~> 3.0

Modules

No modules.

Resources

Name Type
aws_alb.alb resource
aws_alb_listener.listener_http resource
aws_alb_listener.listener_https resource
aws_alb_listener_certificate.additional_certificates resource
aws_alb_target_group.dummy_http resource
aws_alb_target_group.dummy_https resource

Inputs

Name Description Type Default Required
access_logs https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#access_logs
list(object({
enabled = bool
bucket = string
prefix = string
}))
[] no
enable Enable or Disable module bool true no
enable_deletion_protection Enable or Disable deletion protection bool true no
environment The environment of the ALB. Used for tagging string n/a yes
health_check Healthcheck for default target groups map(string) {} no
http_listener_port HTTP listener port number 80 no
https_listener_config List of maps of HTTPS listenr objects
object({
port = string,
certificates = list(string),
number_of_certificates = number
})
null no
idle_timeout Idle timeout number 60 no
internal Bool flag to indicate whether the ALB is internal or external bool true no
ip_address_type Address type for the ALB. Can be ipv4 or dual string "ipv4" no
name AWS ALB name string n/a yes
security_group_ids List of security groups to be associated with the ALB list(string) n/a yes
subnet_ids List of subnets IDs where the ALB would be serving list(string) n/a yes
timeouts ALB creation timeouts
object({
create = string,
delete = string,
update = string
})
{
"create": "10m",
"delete": "10m",
"update": "10m"
}
no
vpc_id VPC ID where the ALB needs to be provisioned string n/a yes

Outputs

Name Description
arn AWS ALB ARN
aws_alb AWS ALB attributes
aws_alb_listener_http AWS ALB HTTPS listener attributes
aws_alb_listener_https AWS ALB HTTPS listener attributes
default_target_group_http Default HTTP target group arn
default_target_group_https Default HTTPS target group arn
dns_name AWS ALB DNS name
http_listner_arn AWS ALB HTTP listner arn
https_listner_arn AWS ALB HTTP listner arn
id AWS ALB id
zone_id AWS ALB zone id