Closed anthony-desmier-axomic closed 1 year ago
If I'm not mistaken, maybe the invalid keys can be dropped here: https://github.com/PrefectHQ/prefect-aws/blob/main/prefect_aws/ecs.py#L900-L918
Would you like to provide a PR to fix this?
If I'm not mistaken, maybe the invalid keys can be dropped here: https://github.com/PrefectHQ/prefect-aws/blob/main/prefect_aws/ecs.py#L900-L918
Would you like to provide a PR to fix this?
Sure, happy to add a PR for this 👍
When running a deployment that uses an ECSTask block the Prefect agent is able to successfully retrieve the associated task definition, however upon registering the task definition using the returned json object a
ParamValidationError
is thrown from the underlying botocore library for the following fields in the task definition json: requiresAttributes, registeredAt, registeredBy.Stack trace from the Prefect 2 agent:
It appears to be an issue on the AWS SDK side where some fields in the response from describe-task-definition are not compatible in a call to register-task-definition (https://github.com/aws/aws-sdk/issues/38, https://github.com/aws/aws-sdk/issues/406). The current workaround appears to be removing these fields when registering the task.
Steps to Reproduce: We are currently defining our ECS task definitions within terraform, however I have manually created a new ECS task from within the ECS GUI. Viewing the Overview for this task in the GUI and clicking on the JSON tab you can see that the requiresAttributes, registeredAt and registeredBy are all defined.
Our ECSTask block is defined with the name of our ECS cluster and we use what AWS call the 'Task definition family' for the 'task_definition_arn' argument which is correctly translated to the full arn.
There doesn't appear to a fix coming from the AWS SDK side, so this might need to be something that is handled on the Prefect side.