fabfuel / ecs-deploy

Powerful CLI tool to simplify Amazon ECS deployments, rollbacks & scaling
Other
857 stars 148 forks source link

Error: Cannot add secrets for one-off task #233

Closed Relacibo closed 2 months ago

Relacibo commented 2 months ago

When I call ecs run with argument --secrets-env-file container file.env or --secret container ENV_VAR arn, I get the error:

Traceback (most recent call last):
  File "/usr/local/bin/ecs", line 33, in <module>
    sys.exit(load_entry_point('ecs-deploy==1.14.1', 'console_scripts', 'ecs')())
  File "/usr/local/lib/python3.8/site-packages/click-8.1.3-py3.8.egg/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click-8.1.3-py3.8.egg/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click-8.1.3-py3.8.egg/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click-8.1.3-py3.8.egg/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click-8.1.3-py3.8.egg/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ecs_deploy-1.14.1-py3.8.egg/ecs_deploy/cli.py", line 454, in run
    action.run(td, count, 'ECS Deploy', launchtype, subnet, securitygroup, public_ip, platform_version)
  File "/usr/local/lib/python3.8/site-packages/ecs_deploy-1.14.1-py3.8.egg/ecs_deploy/ecs.py", line 1454, in run
    result = self._client.run_task(
  File "/usr/local/lib/python3.8/site-packages/ecs_deploy-1.14.1-py3.8.egg/ecs_deploy/ecs.py", line 175, in run_task
    return self.boto.run_task(
  File "/usr/local/lib/python3.8/site-packages/botocore-1.29.5-py3.8.egg/botocore/client.py", line 495, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.8/site-packages/botocore-1.29.5-py3.8.egg/botocore/client.py", line 873, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/usr/local/lib/python3.8/site-packages/botocore-1.29.5-py3.8.egg/botocore/client.py", line 944, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/usr/local/lib/python3.8/site-packages/botocore-1.29.5-py3.8.egg/botocore/validate.py", line 381, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in overrides.containerOverrides[0]: "secrets", must be one of: name, command, environment, environmentFiles, cpu, memory, memoryReservation, resourceRequirements
fabfuel commented 2 months ago

Hi Reinhard,

looks like your botocore version might be too old. Please try with the current version (1.15.0) of ecs-deploy, which requires botocore>=1.32.6.

It if still doesn't work, feel free to reopen the issue.

Best Fabian

Relacibo commented 2 months ago

Hi Fabian, thank you for the response. It unfortunatly also throws the error in the current version:

Traceback (most recent call last):
  File "/usr/local/bin/ecs", line 33, in <module>
    sys.exit(load_entry_point('ecs-deploy==1.15.0', 'console_scripts', 'ecs')())
  File "/usr/local/lib/python3.10/site-packages/click-8.1.7-py3.10.egg/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click-8.1.7-py3.10.egg/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click-8.1.7-py3.10.egg/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click-8.1.7-py3.10.egg/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click-8.1.7-py3.10.egg/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/ecs_deploy-1.15.0-py3.10.egg/ecs_deploy/cli.py", line 454, in run
    action.run(td, count, 'ECS Deploy', launchtype, subnet, securitygroup, public_ip, platform_version)
  File "/usr/local/lib/python3.10/site-packages/ecs_deploy-1.15.0-py3.10.egg/ecs_deploy/ecs.py", line 1454, in run
    result = self._client.run_task(
  File "/usr/local/lib/python3.10/site-packages/ecs_deploy-1.15.0-py3.10.egg/ecs_deploy/ecs.py", line 175, in run_task
    return self.boto.run_task(
  File "/usr/local/lib/python3.10/site-packages/botocore-1.34.138-py3.10.egg/botocore/client.py", line 565, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.10/site-packages/botocore-1.34.138-py3.10.egg/botocore/client.py", line 974, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/usr/local/lib/python3.10/site-packages/botocore-1.34.138-py3.10.egg/botocore/client.py", line 1048, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/usr/local/lib/python3.10/site-packages/botocore-1.34.138-py3.10.egg/botocore/validate.py", line 381, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in overrides.containerOverrides[0]: "secrets", must be one of: name, command, environment, environmentFiles, cpu, memory, memoryReservation, resourceRequirements
fabfuel commented 2 months ago

Alright, I can reproduce it now. I need to check If ECS at all supports passing secrets on the fly (without updating a task definition).