amazon-ecs-deploy-task-definition icon indicating copy to clipboard operation
amazon-ecs-deploy-task-definition copied to clipboard

Support ECS Service connect

Open guns2410 opened this issue 2 years ago • 7 comments

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

guns2410 avatar Dec 08 '22 11:12 guns2410

how is it going on? any temporary fix? I used cloudmap before Connect existed and without making any changes this error pops up

frannpr avatar Dec 12 '22 11:12 frannpr

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.

javalon avatar Dec 13 '22 12:12 javalon

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.

shinenelson avatar Dec 13 '22 22:12 shinenelson

thank you both @shinenelson @javalon very much! It has helped me to understand and solve the problem 💯

frannpr avatar Dec 15 '22 12:12 frannpr

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.

guns2410 avatar Dec 15 '22 13:12 guns2410

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.

rockey5520 avatar Dec 30 '22 13:12 rockey5520

@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

rockey5520 avatar Jan 02 '23 11:01 rockey5520