From 1c0ed47a6c73c8e879d3356def32c162bfc6ba06 Mon Sep 17 00:00:00 2001 From: akmhmgc Date: Thu, 29 Aug 2024 20:29:16 +0900 Subject: [PATCH] skip task definition destroy --- ecs.tf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ecs.tf b/ecs.tf index ecf8b87..a216261 100644 --- a/ecs.tf +++ b/ecs.tf @@ -45,8 +45,14 @@ resource "aws_ecs_task_definition" "nginx_task" { "awslogs-stream-prefix" : "ecs" } } + }, + { + name = "ubuntu" + image = "public.ecr.aws/ubuntu/ubuntu:latest" + command = ["sleep", "8000"] } ]) + skip_destroy = true } resource "aws_security_group" "ecs_http_sg" { @@ -80,6 +86,9 @@ resource "aws_ecs_service" "nginx_service" { container_name = "nginx" container_port = 80 } + lifecycle { + ignore_changes = [task_definition] + } } resource "aws_cloudwatch_log_group" "nginx_task" {