mirror of
https://github.com/Sea-Haven-Industries/syslog-server.git
synced 2026-09-30 15:53:16 +00:00
Replace the public rsyslog-to-CloudWatch collector with Vector over a prod 10.40 IPsec VGW, Firehose, 90-day S3, Glue, and Athena.
34 lines
920 B
HCL
34 lines
920 B
HCL
resource "aws_instance" "this" {
|
|
ami = var.ami_id
|
|
instance_type = "t4g.small"
|
|
subnet_id = aws_subnet.public.id
|
|
vpc_security_group_ids = [aws_security_group.this.id]
|
|
iam_instance_profile = aws_iam_instance_profile.this.name
|
|
associate_public_ip_address = true
|
|
user_data = local.user_data
|
|
user_data_replace_on_change = true
|
|
|
|
root_block_device {
|
|
volume_size = 20
|
|
volume_type = "gp3"
|
|
encrypted = true
|
|
}
|
|
|
|
metadata_options {
|
|
http_endpoint = "enabled"
|
|
http_tokens = "required"
|
|
}
|
|
|
|
tags = {
|
|
Name = "syslog-server"
|
|
}
|
|
}
|
|
|
|
locals {
|
|
user_data = templatefile("${path.module}/user_data.sh.tftpl", {
|
|
vector_yaml = templatefile("${path.module}/vector.yaml.tftpl", {
|
|
aws_region = var.aws_region
|
|
firehose_stream = aws_kinesis_firehose_delivery_stream.unifi.name
|
|
})
|
|
})
|
|
}
|