Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,005
Community Members
 
Community Events
184
Community Groups

ECS Deploy - task-definitions.json

Hi, 
I keep getting the error "Not able to find task-definition.json in your repository."

Any ideas?

This is my file structure, the task-definitions.json seems to be in the right directory:

Screenshot at Sep 19 09-53-45.png

 

This is my task-definitions.json:

{

"family": "ecs-cvs-behaviour-staging",

"containerDefinitions": [

{

"name": "cvs-behaviour-staging",

"image": "cvs-staging:$BITBUCKET_BUILD_NUMBER",

"portMappings": [

{

"containerPort": 80,

"hostPort": 80,

"protocol": "tcp"

}

],

"essential": true

}

],

"requiresCompatibilities": [

"EC2"

],

"memory": "128"

}



And this is my bitbucket-pipelines.yml:

image: python:3.8.12-alpine3.14

pipelines:

default:

- step:

name: Build Docker Container and Deploy to ECR

services:

- docker

script:

- docker build -t cvs-staging:latest .

- pipe: atlassian/aws-ecr-push-image:1.4.2

variables:

AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID

AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION

IMAGE_NAME: cvs-staging

TAGS: $BITBUCKET_BUILD_NUMBER

- step:

name: Deploy to ECS

script:

- pipe: atlassian/aws-ecs-deploy:1.6.0

variables:

AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID

AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION

CLUSTER_NAME: 'cvs-staging'

SERVICE_NAME: 'cvs-staging-service'

TASK_DEFINITION: 'task-definition.json'

 

1 answer

1 accepted

0 votes
Answer accepted

I am silly, turns out I had a blank space at the start of the task-definition.json file name.
How embarrassing.

Was this example working?
I make it similar and catch the exception.

Failed to update the stack. An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Container.image contains invalid characters.


It seems like task-definition doesn't apply $BITBUCKET_BUILD_NUMBER automatically.
"image": "cvs-staging:$BITBUCKET_BUILD_NUMBER"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events