Use predefined task definition for ECS deployment

Anuj May 18, 2020

I'm following this doc https://confluence.atlassian.com/bitbucket/deploy-to-amazon-ecs-892623902.html to set up a pipeline to deploy to the ECS cluster.

This doc is using a custom task def JSON file and using the same for the deployment after updating the image name.

Am I required to copy the complete task definition JSON and put that in my repository? My task definition has lots of environment variables in it. I do not want to expose them by putting it in the repository.

Or, the task definition template will update the default task definition and create a new revision. (not overwrite)

How can I use the predefined tasks instead of using the JSON file? Also, where can I find more doc about the pipe. 

atlassian/aws-ecs-deploy

 

2 answers

0 votes
Jason Harrison November 26, 2020

take your task-definition.json, encode it using base64, and copy the base64 into Deployment Variable in your repository.

Then add this step:

echo $TASK_DEFINITION_base64 | base64 -d > task-definition.json

0 votes
Ritesh Mukim July 16, 2020

I too have the same requirement

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events