Giter Club home page Giter Club logo

terraform-aws-alb's Introduction

GitHub release (latest SemVer)

AWS Application and Network Load Balancer Terraform module

Terraform module which creates Application and/or Network Load Balancer resources in AWS.

These types of resources are supported:

Terraform versions

Terraform 0.12. Pin module version to ~> v2.1. Submit pull-requests to master branch.

Usage

Application Load Balancer

module "alb" {
  source = "umotif-public/alb/aws"
  version = "~> 2.1.0"

  name_prefix = "complete-alb"

  load_balancer_type = "application"

  internal = false
  vpc_id             = "vpc-abasdasd132"
  subnets            = ["subnet-abasdasd132123", "subnet-abasdasd132123132"]

  access_logs = {
    bucket = "alb-logs"
  }

  tags = {
    Project = "Test"
  }
}

Network Load Balancer

module "nlb" {
  source = "umotif-public/alb/aws"
  version = "~> 2.1.0"

  name_prefix = "complete-nlb"

  load_balancer_type = "network"

  vpc_id             = "vpc-abasdasd132"
  subnets            = ["subnet-abasdasd132123", "subnet-abasdasd132123132"]

  access_logs = {
    bucket = "nlb-logs"
  }

  tags = {
    Project = "Test"
  }
}

Examples

Authors

Module managed by Marcin Cuber LinkedIn.

Requirements

Name Version
terraform >= 0.12.6
aws >= 3.40

Providers

Name Version
aws >= 3.40

Modules

No modules.

Resources

Name Type
aws_lb.main resource
aws_lb_listener.frontend_http_to_https_redirect resource
aws_security_group.main resource
aws_security_group_rule.allow_port_443_ingress_for_http_to_https_redirect resource
aws_security_group_rule.allow_port_80_ingress_for_http_to_https_redirect resource
aws_security_group_rule.egress resource

Inputs

Name Description Type Default Required
access_logs An Access Logs block. map(string) {} no
cidr_blocks_redirect List of CIDR ranges to allow at security group level. Defaults to 0.0.0.0/0 list(string)
[
"0.0.0.0/0"
]
no
description The description of the all resources. string "Managed by Terraform" no
enable_cross_zone_load_balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. bool false no
enable_deletion_protection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. bool false no
enable_http2 Indicates whether HTTP/2 is enabled in application load balancers. bool true no
enable_http_to_https_redirect Enable default redirect rule from port 80 to 443. bool false no
idle_timeout (Optional) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. number 60 no
internal Provision an internal load balancer. Defaults to false. bool false no
ip_address_type The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. string "ipv4" no
load_balancer_create_timeout Timeout value when creating the ALB. string "15m" no
load_balancer_delete_timeout Timeout value when deleting the ALB. string "15m" no
load_balancer_type Type of load balancer to provision (network or application). string "application" no
load_balancer_update_timeout Timeout value when updating the ALB. string "15m" no
name_prefix A prefix used for naming resources. string n/a yes
subnet_mapping A list of subnet mapping blocks describing subnets to attach to network load balancer list(map(string)) [] no
subnets A list of subnet IDs to attach to the LB. list(string) n/a yes
tags A map of tags (key-value pairs) passed to resources. map(string) {} no
vpc_id The VPC ID. string n/a yes

Outputs

Name Description
arn The ARN of the load balancer.
arn_suffix The ARN suffix for use with CloudWatch Metrics.
dns_name The DNS name of the load balancer.
name The name of the load balancer.
origin_id First part of the DNS name of the load balancer.
security_group_id The ID of the security group.
zone_id The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).

License

See LICENSE for full details.

Pre-commit hooks

Install dependencies

MacOS

brew install pre-commit terraform-docs tflint

brew tap git-chglog/git-chglog
brew install git-chglog

terraform-aws-alb's People

Contributors

marcincuber avatar ohid25 avatar umotif-olascu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.