atlassian/aws-ecs-deploy:1.9.0 does not update ECS task definition/image

Alexandre Alencar October 4, 2023

Hello,

Using atlassian/aws-ecs-deploy:1.9.0 pipe for updating ECS services and noticed a bug/defect on it.

As part of the parameters passed to it, you can provide both the TASK_DEFINITION and/or the IMAGE_NAME variable, however, the image is not used to update the task definition image anywhere.

Function _update_task_definition(..., image = None)_ declares it, but never uses it and _run(...)_ passes it around line ~230 when _update_task_definition_ is called.

Please fix the pipe to properly update the task definition image with IMAGE_NAME if it is passed.

 

AWS_SECRET_ACCESS_KEY and AWS_SECRET_ACCESS_KEY are passed empty due to bug https://jira.atlassian.com/browse/BCLOUD-22913 even tho using OIDC.

YAML

...

pipelines:

  <branch>:

    - step:

         name: Update ECS Service

         oidc: true

         script:

           - export IMAGE_NAME=${REGISTRY}/${BITBUCKET_REPO_SLUG}:${

BITBUCKET_COMMIT}
           - pipe: atlassian/aws-ecs-deploy:1.9.0
              variables:
                 AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
                 AWS_SECRET_ACCESS_KEY: ''
                 AWS_ACCESS_KEY_ID: ''
                 AWS_OIDC_ROLE_ARN: ${AWS_ROLE_ARN}
                 CLUSTER_NAME: ${CLUSTER_NAME}
                 SERVICE_NAME: ${BITBUCKET_REPO_SLUG}
                 IMAGE_NAME: ${IMAGE_NAME}
                 TASK_DEFINITION: ${BITBUCKET_REPO_SLUG}-task-def.json
                 FORCE_NEW_DEPLOYMENT: 'true'
...
Ref

https://bitbucket.org/atlassian/aws-ecs-deploy/src/master/pipe/main.py

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2023

@Alexandre Alencar hi. Thanks for your investigation. In current version of the pipe IMAGE_NAME variable is not supported and not presented in the README. You could see it in the code, but it's always None. We will refactor the logic to prevent misunderstandings.

All required settings (i.e image name) you could declare in the task definition file, check this official AWS example.

 

Regards, Igor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events