Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Commit c3499d4

Browse files
committed
add autoscaling group for log forwarder
1 parent b3d6958 commit c3499d4

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

terraform/mgmt/logging.tf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# temporary, until we have an image for this
2+
data "aws_ami" "ubuntu" {
3+
most_recent = true
4+
5+
filter {
6+
name = "name"
7+
values = ["*ubuntu-xenial-16.04-amd64-server-*"]
8+
}
9+
filter {
10+
name = "virtualization-type"
11+
values = ["hvm"]
12+
}
13+
filter {
14+
name = "root-device-type"
15+
values = ["ebs"]
16+
}
17+
18+
owners = ["099720109477"] # Canonical
19+
}
20+
21+
resource "aws_launch_configuration" "log_forwarding" {
22+
name = "log-forwarding"
23+
image_id = "${data.aws_ami.ubuntu.id}"
24+
instance_type = "t2.micro"
25+
}
26+
27+
resource "aws_autoscaling_group" "log_forwarding" {
28+
availability_zones = ["${data.aws_region.current.name}${var.az}"]
29+
vpc_zone_identifier = ["${module.network.private_subnets}"]
30+
# will likely switch to Launch Template once available
31+
# https://github.com/terraform-providers/terraform-provider-aws/issues/2505
32+
launch_configuration = "${aws_launch_configuration.log_forwarding.name}"
33+
34+
max_size = 3
35+
min_size = 1
36+
desired_capacity = 2
37+
38+
tag {
39+
key = "Component"
40+
value = "log-forwarding"
41+
propagate_at_launch = true
42+
}
43+
}

0 commit comments

Comments
 (0)