You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to reference items generated in the CloudForamtion script its often useful to pass the ARN to a docker container as an environment variable.
However, currently its not possible to directly use the CloudFormation intrinsic functions (e.g. !Ref) within the service definition. E.g.
services:
server:
image: someimageenvironment:
TESTX:
Fn::GetAtt: [ x, y ]
There are often times this could be useful, e.g. accessing the CloudMap object.
Alternatives
A workaround to this is really inconvenient as it relies on using the Resources block to overwrite the majority of the task definition. For example, consider the below excerpt of a simple task definition obtained with docker compose convert. I would need to completely overwrite the whole of the ContainerDefinitions list, just to modify the environment variable defined within it.
I assume allowing intrinsic functions in the service definition would be considered bad as it would prevent it being used outside of ECS. Perhaps the best is to support a way to merge changes into the ContainerDefinitions list. For example:
Context
When trying to reference items generated in the CloudForamtion script its often useful to pass the ARN to a docker container as an environment variable.
However, currently its not possible to directly use the CloudFormation intrinsic functions (e.g.
!Ref
) within the service definition. E.g.There are often times this could be useful, e.g. accessing the CloudMap object.
Alternatives
A workaround to this is really inconvenient as it relies on using the
Resources
block to overwrite the majority of the task definition. For example, consider the below excerpt of a simple task definition obtained withdocker compose convert
. I would need to completely overwrite the whole of theContainerDefinitions
list, just to modify the environment variable defined within it.I assume allowing intrinsic functions in the service definition would be considered bad as it would prevent it being used outside of ECS. Perhaps the best is to support a way to merge changes into the
ContainerDefinitions
list. For example:Currently, the above definition will be non-functional as the
ContainerDefinitions
will be corrupted.Additional context
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: