From b613968da7eaf3328b1d568a121eff9b6e511702 Mon Sep 17 00:00:00 2001 From: Michaela Wheeler Date: Wed, 12 Jan 2022 21:00:42 +1100 Subject: [PATCH] APRS importing of ham balloons --- ham_aprs.tf | 113 ++++++++++++++++++++ ham_ingestion.tf | 166 ++++++++++++++++++++++++++++++ lambda/ham_sqs_to_elk/__init__.py | 35 +++++++ lambda/ham_sqs_to_elk/__main__.py | 15 +++ 4 files changed, 329 insertions(+) create mode 100644 ham_aprs.tf create mode 100644 ham_ingestion.tf create mode 100644 lambda/ham_sqs_to_elk/__init__.py create mode 100644 lambda/ham_sqs_to_elk/__main__.py diff --git a/ham_aprs.tf b/ham_aprs.tf new file mode 100644 index 0000000..178eac8 --- /dev/null +++ b/ham_aprs.tf @@ -0,0 +1,113 @@ + +resource "aws_ecs_task_definition" "aprsgw" { + family = "aprsgw" + runtime_platform { + cpu_architecture = "ARM64" + } + container_definitions = jsonencode( + [ + { + cpu = 0 + "environment": [ + {"name": "AWS_REGION", "value": "us-east-1"}, + {"name": "AWS_DEFAULT_REGION", "value": "us-east-1"}, + {"name": "CALLSIGN", "value": "VK3FUR"}, + {"name": "SNS", "value": aws_sns_topic.ham_telem.arn} + ], + essential = true + image = "143841941773.dkr.ecr.us-east-1.amazonaws.com/aprsgw:latest" + logConfiguration = { + logDriver = "awslogs" + options = { + awslogs-group = "/ecs/aprsgw" + awslogs-region = "us-east-1" + awslogs-stream-prefix = "ecs" + } + } + mountPoints = [] + name = "aprsgw" + portMappings = [ ] + ulimits = [] + volumesFrom = [] + }, + ] + ) + cpu = "256" + execution_role_arn = "arn:aws:iam::143841941773:role/aprsgw" + memory = "512" + network_mode = "awsvpc" + requires_compatibilities = [ + "FARGATE", + ] + tags = {} + task_role_arn = "arn:aws:iam::143841941773:role/aprsgw" +} + +resource "aws_iam_role" "aprsgw" { + name = "aprsgw" + description = "Allows EC2 instances to call AWS services on your behalf." + assume_role_policy = <