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
{{ message }}
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Feat. Request: Allow environment variables to depend on CF intrinsic functions #1140
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:
Activity