-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Description
There doesn't seem to be a way to update the environment variables on an already instantiated container in a TaskDefinition. Exposing environment on ContainerDefinition would allow clients to add more environment variables to an already instantiated TaskDefinition/Container
Use Case
My use case is create the taskdef/container, then programmatically choose to give that container access to a dynamically chosen set of queues, buckets, topics, etc. As these are dynamically named, I use environment variables to identify the resources to the code within my container. 'addPropertyOverride' allows me to set the variables once, but it deletes the current contents rather than allowing me to add more.
Proposed Solution
From looking at the code in container-definition.ts, it seems that this would require:
- Creating a public property on ContainerDefinition
- Assigning the environment from the props to the public property in the constructor
- Changing the rendering to use the property rather than the private props property
- Updating tests
It seems too simple to have not been done before - is there a reason things are the way they are that I don't see?
Other information
No response
Acknowledge
- I may be able to implement this feature request
- This feature might incur a breaking change