This repository was archived by the owner on Oct 31, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ locals {
2+ logging_port = 514
3+ logging_protocol = " TCP"
4+ }
5+
16# temporary, until we have an image for this
27data "aws_ami" "ubuntu" {
38 most_recent = true
@@ -35,9 +40,37 @@ resource "aws_autoscaling_group" "log_forwarding" {
3540 min_size = 1
3641 desired_capacity = 2
3742
43+ target_group_arns = [" ${ aws_alb_target_group . log_forwarding . arn } " ]
44+
3845 tag {
3946 key = " Component"
4047 value = " log-forwarding"
4148 propagate_at_launch = true
4249 }
4350}
51+
52+ resource "aws_alb" "log_forwarding" {
53+ # TODO make internal?
54+ # internal = true
55+ # https://aws.amazon.com/elasticloadbalancing/details/#compare
56+ load_balancer_type = " network"
57+ # TODO change to private
58+ subnets = [" ${ module . network . public_subnets } " ]
59+ }
60+
61+ resource "aws_alb_target_group" "log_forwarding" {
62+ vpc_id = " ${ module . network . vpc_id } "
63+ port = " ${ local . logging_port } "
64+ protocol = " ${ local . logging_protocol } "
65+ }
66+
67+ resource "aws_alb_listener" "log_forwarding" {
68+ load_balancer_arn = " ${ aws_alb . log_forwarding . arn } "
69+ port = " ${ local . logging_port } "
70+ protocol = " ${ local . logging_protocol } "
71+
72+ default_action {
73+ target_group_arn = " ${ aws_alb_target_group . log_forwarding . arn } "
74+ type = " forward"
75+ }
76+ }
You can’t perform that action at this time.
0 commit comments