Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 3.53 KB

README.md

File metadata and controls

65 lines (52 loc) · 3.53 KB

AWS Network Load Balancer (NLB) Module

This module creates Network Type of AWS Elastic Load Balancer (ELB) with Security Group attached to it.

Example

# main.tf
module "nlb" {
  source = "git::https://github.com/lpavliuk/Terraform-Modules.git//aws_elb_net"

  name                  = local.codename
  vpc_id                = local.vpc_id
  subnet_ids            = local.subnet_group_subnets_ids
  extra_sg_ids          = [ local.vpc_sg_id ]
  is_private            = false
  enable_cross_zone     = true

  enable_deletion_protection = true
}

Requirements

Name Version
terraform < 2.0.0, >= 1.6.6
aws < 6.0, >= 5.22

Inputs

Name Description Type Default Required
name NLB Name string n/a yes
vpc_id VPC ID the NLB will be created in string n/a yes
subnet_ids Subnet IDs the NLB will be attached to list(string) n/a yes
enable_logging Enables the NLB traffic logging to S3 bucket bool false no
enable_deletion_protection Enables the deletion protection of the NLB bool false no
enable_cross_zone Enables private mode of the NLB (accessible only from VPC) bool false no
is_private Enables private mode of the NLB (accessible only from VPC) bool false no
extra_sg_ids Additional Security Group IDs attached to the NLB except for default Security Group list(string) [] no

Outputs

Name Description
arn NLB ARN
name NLB Name
dns_name NLB DNS Name
zone_id Zone ID the NLB provisioned in
security_group_id Security Group ID of the NLB

Resources

Name Type
aws_lb.this resource
aws_s3_bucket.lb_logs resource
aws_s3_bucket_policy.allow_elb_logging resource
aws_security_group.this resource
aws_elb_service_account.main data source
aws_iam_policy_document.allow_lb_logging data source