0

I am using terraform version Terraform v0.11.13. I am using terraform for AWS cloud, I have some template files which stores environment variables of my application. I am using AWS ECS and created a ECS Task definition and ECS service and referenced task defination environment variables list to an template file (.tpl files).

Now even If I didnt change anything in my template file , Terraform is showing to destroy and recreate ECS task defination and ECS service everytime.

sample scenario:

~ aws_ecs_service.test_app_sidekiq_api
  task_definition: "arn:aws:ecs:ap-southeast-1:xxxxxxxxxxxx:task-definition/test-app-sidekiq-api:84" => "${ aws_ecs_task_definition.test_app_sidekiq_api.arn }"


-/+ aws_ecs_task_definition.test_app_sidekiq_api (new resource required)
      id:    "test-app-sidekiq-api" => <computed> (forces new resource)
      arn: "arn:aws:ecs:ap-southeast-1:xxxxxxxxxxxx:task-definition/test-app-sidekiq-api:84" => <computed>

even when there is no change why its trying to plan from some version to computed ??????

can the indentation in .tpl files can be a problem for this or terraform version, what may be the problem and what could be the probable solution for this issue.

Please help.

Thanks in Advance :)

ydaetskcoR
  • 53,225
  • 8
  • 158
  • 177
Bala krishna
  • 519
  • 1
  • 10
  • 24
  • 1
    Please can you edit the question to include the output of the plan? It's hard to tell what is causing the change without seeing the plan and ideally an [mcve] of your Terraform code that reproduces the plan diff with no changes. I can say that it's not going to be any indentation on your templated task definition though as that is just read in and then serialised into the task definition type before being sent to AWS. – ydaetskcoR Nov 11 '20 at 09:55
  • @ydaetskcoR , edited my question – Bala krishna Nov 12 '20 at 05:12
  • You need to include a fuller context because you've snipped out the relevant parts. Ideally that should also be the plan output against a [mcve] that reproduces the issue that you can include the Terraform code for in the question as well. Without those two things it's pretty much impossible to help answer your question I'm afraid. – ydaetskcoR Nov 12 '20 at 09:35

0 Answers0