From 9501c4efc31ffd3b43f7eae3d68873619dac8458 Mon Sep 17 00:00:00 2001 From: Sergei Ugdyzhekov Date: Mon, 4 Oct 2021 19:41:48 +0200 Subject: [PATCH] feat: arm64 support --- README.md | 37 ++++++++++++++++++++++++++++++++----- variables.tf | 10 +++++++++- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e829c41..c067a3e 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ Features: * Default ECS task role allows creating a log group. * Default security group for ECS nodes allow inbound connections from configurable list of network CIDRs. * It's possible to specify additional security groups for ECS nodes. -* Latest ECS Optimized AMI. +* Latest ECS Optimized AMI with `amd64` or `arm64` architectures. * Additional EBS disks. +* ASG lifecycle hooks. ## Usage @@ -21,10 +22,13 @@ module "example_ecs_cluster" { source = "github.com/jetbrains-infra/terraform-aws-ecs-cluster?ref=vX.X.X" // see https://github.com/jetbrains-infra/terraform-aws-ecs-cluster/releases cluster_name = "FooBar" spot = true + arm64 = true + instance_types = { "t3a.large" = 1 "t3a.xlarge" = 2 } + target_capacity = 100 // subnets with ALB and bastion host e.g.. @@ -36,10 +40,27 @@ module "example_ecs_cluster" { ebs_disks = { "/dev/sda" = 100 } - subnets_ids = [ + + subnets_ids = [ aws_subnet.private_subnet_1.id, aws_subnet.private_subnet_2.id ] + + lifecycle_hooks = [ + { + name = "Example" + lifecycle_transition = "autoscaling:EC2_INSTANCE_LAUNCHING" + default_result = "CONTINUE" + heartbeat_timeout = 2000 + role_arn = aws_iam_role.example.arn + notification_target_arn = "arn:aws:sqs:us-east-1:444455556666:queue1" + notification_metadata = <