CircleCI-Public / aws-ecs-orb

An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
https://circleci.com/orbs/registry/orb/circleci/aws-ecs
MIT License
51 stars 80 forks source link

Unexpected argument(s): aws-region, aws-access-key-id, aws-secret-access-key #108

Closed Woitekku closed 4 years ago

Woitekku commented 4 years ago

Orb version

1.2.0

What happened

During update-task-definition, when aws-access-key-id, aws-secret-access-key and aws-region are specified, it throws an error:

Error calling workflow: 'build-and-deploy'
Error calling job: 'update_task_definition'
Error calling command: 'aws-ecs/update-task-definition'
Unexpected argument(s): aws-region, aws-access-key-id, aws-secret-access-key

Expected behavior

Not throwing an error and accept the variables as specified in the documentation.

lokst commented 4 years ago

Hi @WojciechCichy, could you share the part of your config where you are invoking update-task-definition, to help us troubleshoot?

Woitekku commented 4 years ago

Hi @lokst, here it is:

[...]
  update_task_definition:
    executor: python
    resource_class: small
    parameters:
      family:
        type: string
      container_name:
        type: string
    steps:
      - aws-ecs/update-task-definition:
          aws-access-key-id: AWS_ACCESS_KEY_ID
          aws-region: AWS_REGION
          aws-secret-access-key: AWS_SECRET_ACCESS_KEY
          container-image-name-updates: 'container=<< parameters.container_name >>,tag=${CIRCLE_SHA1}'
          family: << parameters.family >>
[...]

As you can see I put there default variable values configured at CircleCi project level. I would except that since ORB allows to provide AWS-defined credentials, I do not need to install aws-cli separately.

Here is the code that works

[...]
update_task_definition:
    executor: python
    resource_class: small
    parameters:
      family:
        type: string
      container_name:
        type: string
    steps:
      - aws-cli/install
      - aws-ecs/update-task-definition:
          container-image-name-updates: 'container=<< parameters.container_name >>,tag=${CIRCLE_SHA1}'
          family: << parameters.family >>
[...]
lokst commented 4 years ago

@WojciechCichy Sorry for the delay in response. It looks like you are invoking the update-task-definition command with parameters (aws-access-key-id, aws-secret-access-key and aws-region) that don't exist. You can check the available parameters for the command on: https://circleci.com/orbs/registry/orb/circleci/aws-ecs