From 67453b0027ee1903b134caaf5c364fbf09db7b33 Mon Sep 17 00:00:00 2001 From: Magicloud <1886157+Magicloud@users.noreply.github.com> Date: Fri, 29 Nov 2019 00:44:01 +0800 Subject: [PATCH] New: module/nlb Setup basic aws_lb/aws_lb_listener/aws_lb_target_group resources for TCP forward function. --- examples/nlb-test/main.tf | 77 +++++++++++++++++++++++++++++++++++++++ modules/nlb/README.md | 5 +++ modules/nlb/main.tf | 27 ++++++++++++++ modules/nlb/outputs.tf | 7 ++++ modules/nlb/variables.tf | 30 +++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 examples/nlb-test/main.tf create mode 100644 modules/nlb/README.md create mode 100644 modules/nlb/main.tf create mode 100644 modules/nlb/outputs.tf create mode 100644 modules/nlb/variables.tf diff --git a/examples/nlb-test/main.tf b/examples/nlb-test/main.tf new file mode 100644 index 00000000..a70a7300 --- /dev/null +++ b/examples/nlb-test/main.tf @@ -0,0 +1,77 @@ +provider "aws" { + region = "us-west-2" +} + +data "aws_availability_zones" "azs" { + state = "available" +} + +module "vpc" { + source = "fpco/foundation/aws//modules/vpc-scenario-1" + cidr = "10.0.0.0/16" + public_subnet_cidrs = ["10.0.0.0/24", "10.0.1.0/24", "10.0.2.0/24"] + region = "us-west-2" + azs = data.aws_availability_zones.azs.names + name_prefix = "nlb-poc" +} + +module "ubuntu" { + source = "fpco/foundation/aws//modules/ami-ubuntu" + release = "18.04" +} + +module "asg" { + source = "fpco/foundation/aws//modules/asg" + azs = [] + key_name = "shida-west-2" + subnet_ids = [module.vpc.public_subnet_ids[0], module.vpc.public_subnet_ids[2]] + name_prefix = "nlb-poc" + min_nodes = 2 + ami = module.ubuntu.id + max_nodes = 2 + security_group_ids = [aws_security_group.sg-asg.id] + alb_target_group_arns = module.nlb.target_group_arns + user_data = <