Coder Social home page Coder Social logo

“Error: Task definition file does not exist: ” when deploying Docker images to AWS ECS about amazon-ecs-render-task-definition HOT 9 CLOSED

aws-actions avatar aws-actions commented on June 22, 2024
“Error: Task definition file does not exist: ” when deploying Docker images to AWS ECS

from amazon-ecs-render-task-definition.

Comments (9)

chorsnell avatar chorsnell commented on June 22, 2024 27

for anyone else finding this, it turns out task-definition: does not obey working_directory, so the relative path needs to be from the root of your repo

from amazon-ecs-render-task-definition.

RulerOf avatar RulerOf commented on June 22, 2024 4

In my case, I had forgotten to run the checkout step.

from amazon-ecs-render-task-definition.

islamsalah2020 avatar islamsalah2020 commented on June 22, 2024 4

I faced the same issue, then I figured out that I need to download the task definition first then update it with the new container image. that solved the issue and I was able to deploy to ECS.

- name: Download task definition
      run: |
          aws ecs describe-task-definition --task-definition ${{ vars.MY_ECS_TASK_DEFINITION }} \
          --query taskDefinition > task-definition.json
      
 - name: Fill in the new image ID in the Amazon ECS task definition
      id: task-def
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
          task-definition: task-definition.json
          container-name: ${{ vars.MY_CONTAINER_NAME   }}
          image: ${{ steps.build-image.outputs.image }}

from amazon-ecs-render-task-definition.

ShyamPanj avatar ShyamPanj commented on June 22, 2024 2

my task-defintion.json file is directly under repo. How should I specify the path?

from amazon-ecs-render-task-definition.

shubhamnagota avatar shubhamnagota commented on June 22, 2024 1

for anyone else finding this, it turns out task-definition: does not obey working_directory, so the relative path needs to be from the root of your repo

Continuing on @chorsnell answer, I changed task-definition.json to ./server/task-definition.json
you can change server to your-subdirectory-name
Turns out to be working.

      id: task-def
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
          task-definition: ./server/task-definition.json
          container-name: ${{ vars.MY_CONTAINER_NAME   }}
          image: ${{ steps.build-image.outputs.image }}```

from amazon-ecs-render-task-definition.

naveen-marthala avatar naveen-marthala commented on June 22, 2024

I hadn't uploaded the task defintion file to my github repo with the thought that the GitHub will pull it from my AWS account.

from amazon-ecs-render-task-definition.

sandeepinsys avatar sandeepinsys commented on June 22, 2024

my task-defintion.json file is directly under repo. How should I specify the path?

In that case, path should be ./task-defintion.json

from amazon-ecs-render-task-definition.

JohnQ1981 avatar JohnQ1981 commented on June 22, 2024

Please anyone can help, failing at the same step as mentioned above. and i have my
image

image

and my github is https://github.com/JohnQ1981/teachermonsters

env:
AWS_REGION: us-east-2
ECR_REPOSITORY: mfedockertest
ECS_SERVICE: mfedockertest-service
ECS_CLUSTER: mfedockertest-cluster
ECS_TASK_DEFINITION: ./task-definition.json
CONTAINER_NAME: mfedockertest-task-definition
AWS_DEFAULT_REGION: us-east-2
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
Error: Task definition file does not exist: ./task-definition.json

from amazon-ecs-render-task-definition.

tatianafrank avatar tatianafrank commented on June 22, 2024

Please anyone can help, failing at the same step as mentioned above. and i have my image

image

and my github is https://github.com/JohnQ1981/teachermonsters

env: AWS_REGION: us-east-2 ECR_REPOSITORY: mfedockertest ECS_SERVICE: mfedockertest-service ECS_CLUSTER: mfedockertest-cluster ECS_TASK_DEFINITION: ./task-definition.json CONTAINER_NAME: mfedockertest-task-definition AWS_DEFAULT_REGION: us-east-2 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: *** Error: Task definition file does not exist: ./task-definition.json

because your file is .yml but your path says .json

from amazon-ecs-render-task-definition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.