amazon-ecs-deploy-task-definition
amazon-ecs-deploy-task-definition copied to clipboard
Support ECS Service connect
Updating the task definition to use Service Connect, I get an error during the deploy process.
* UnexpectedParameter: Unexpected key 'name' found in params.containerDefinitions[0].portMappings[0]
* UnexpectedParameter: Unexpected key 'appProtocol' found in params.containerDefinitions[0].portMappings[0]
With ECS supporting Service connect, name and appProtocol has to be supported in portMappings
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html#registerTaskDefinition-property
how is it going on? any temporary fix? I used cloudmap before Connect existed and without making any changes this error pops up
Hi!
A temporal fix to work with our project consisted in creating a new task version from the AWS Dashboard changing the value of the App protocol (to None) and deleting the Port name (empty).
Be careful when you create a new task version manually. The dashboard form sets a Port name by default when its value is empty, making to fail the Github action again if doesn't delete before.
I hope to help you.
This is a problem only if one uses the AWS Management Console to create new task definition revision. To get around this, one could use the Create new version with JSON option while creating the new revision and edit the task definition JSON by hand. I recognize that this is not as intuitive as filling up a form, but that comes at the cost of all of the GitHub Action workflows depending on the same task definitions failing.
thank you both @shinenelson @javalon very much! It has helped me to understand and solve the problem 💯
When you create a new version from the AWS management console, the tasks are updated correctly. However, with the next deployment, the deployment would fail since the ports are named in the management console and not in the task definition.
I am too facing the same problem and wondering if there is a way to fix using Github action rather than adjusting it manually in the console.
@veglos provided a PR https://github.com/aws/aws-sdk-js/pull/4310 it would be awesome if someone could review and merge this solves the problem of not being able to redeploy service via github actions