containers-roadmap
containers-roadmap copied to clipboard
[ECS] : console escapes backslash when configuring task definition via JSON
Whenever a user utilises the ECS Console to create a new task definition using the 'JSON' representation, the ECS console escapes “\” when entered in values of task definitions. It is no longer possible to enter valid JSON values containing newlines into the ENV (\n) of a task definition via the console because the form fields are only single line text fields which don't support newlines. This has been an issue for many months.
Creating the task definition with new lines (\n) via the SDK or CLI is working (the backslash "\" is not escaped).
Whenever I tried to introduce a new line within the 'Environment' portion, the console escapes the backslash, so as result, it converts a newline (\n) into (\\n) escaping the backslash.
Which service(s) is this request for? This could be Fargate, ECS
This causes a living hell for people using the UI to update services. Is there anyway around this?
Any advise for this issue, or we should create the task definition in another way? My problem is a private key from firebase I’m sending that like a env var to my container any help here ?
Solution
I found this little note in terraform's documentation I just put the triple backslash \\\\n
My task definition now is working.
Having the same problem here. Tried with the triple backslash and it didn't work, unfortunately.
Also having this issue from the console - any advice?
Ah I've found a solution for in aws console editing.
Using the new V2 console, we no longer get double escapes: https://us-east-1.console.aws.amazon.com/ecs/v2/