Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use ECS task protection instead of EC2 instance protection for … #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/processing/autoscaling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ resource "aws_ecs_capacity_provider" "worker_lt_gpu_provider" {

auto_scaling_group_provider {
auto_scaling_group_arn = aws_autoscaling_group.worker_lt_asg.arn
managed_termination_protection = "DISABLED"
managed_termination_protection = "ENABLED"

managed_scaling {
status = "ENABLED"
Expand Down
6 changes: 3 additions & 3 deletions modules/processing/ecs_task_roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ resource "aws_iam_role" "processing_worker_role" {

resource "aws_iam_policy" "processing_worker_policy" {
name = "processing-worker-task-policy${var.env}"
description = "Policy for ECS tasks to manage instance protection during Auto Scaling scale-in events and get CloudWatch metrics"
description = "Policy for ECS tasks to manage ecs task protection during Auto Scaling scale-in events and get CloudWatch metrics"

policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"autoscaling:SetInstanceProtection",
"autoscaling:DescribeAutoScalingInstances"
"ecs:GetTaskProtection",
"ecs:UpdateTaskProtection"
]
Resource = "*"
},
Expand Down