Skip to content

benniemosher-dev/terraform-aws-loadbalancer

Repository files navigation

Contributors Forks Stargazers Issues MIT License Workflow

terraform-aws-loadbalancer

⚖️ A TF module for AWS loadbalancers. ⚖

Explore the docs | View Demo | Report Bug | Request Feature

Table of Contents

✅ TODO:

Things to change when first creating a module:

  • In README.md change terraform-module to the name of this module (i.e. terraform-cloudflare-record)
  • In README.md find/replace instances of benniemosher-dev and terraform-module
  • In .github/workflows/ci-terraform.yml delete lines 13-14 enabling cost
  • In README.md delete the TODO section

(back to top)

📜 Usage:

  • To install dependencies needed run:
    brew bundle install
  • To initialize Terraform in this folder:
    task infra:init
  • To update modules and providers in this folder:
    task init -- -upgrade
  • To validate the module in this folder:
    task infra:validate
  • To plan the infrastructure in this folder:
    task infra:plan
  • To plan specific resources of infrastructure in this folder:
    task infra:plan -- -target='cloudflare_record.this'

🆒 Extras:

  • To find all the automation available in this folder:
    task --list-all
  • To estimate the cost of the infrastructure in this folder:
    task infra:cost
  • To update the documentation in this folder:
    task infra:docs
  • To lint the Terraform in this folder:
    task infra:lint
  • To validate security in this folder:
    task infra:sec

(back to top)

📋 Documentation

Built With

Terraform AWS

Requirements

Name Version
terraform ~> 1.3
aws ~> 4.40

Providers

Name Version
aws 4.46.0

Modules

No modules.

Resources

Name Type
aws_alb.this resource
aws_lb_listener.https resource
aws_lb_listener.this resource
aws_lb_target_group.https resource
aws_lb_target_group.this resource
aws_security_group.load-balancer resource
aws_security_group.service resource
aws_security_group_rule.http-ingress resource
aws_security_group_rule.https-ingress resource
aws_security_group_rule.service-ingress resource

Inputs

Name Description Type Default Required
config The config to create the Load Balancer with.
object({
allowed-ingress-cidrs = list(string)
certificate = optional(string, null)
cluster-name = string
load-balancer-type = optional(string, "application")
subnets = list(string)
vpc = string
})
n/a yes

Outputs

Name Description
ecs-security-group The security group ID for the ECS service to use.
load-balancer-dns The Load Balancer DNS name to reach the deployed web app.
load-balancer-target-group The target group for the load balancer.

(back to top)