Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs: ContainerDefinition.addEnvironment #2559

Closed
eladb opened this issue May 16, 2019 · 6 comments
Closed

ecs: ContainerDefinition.addEnvironment #2559

eladb opened this issue May 16, 2019 · 6 comments
Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@eladb
Copy link
Contributor

eladb commented May 16, 2019

It's very useful to be able to mutate the environment configuration of the container definition, similar to Lambda.

@eladb eladb added the feature-request A feature should be added or improved. label May 16, 2019
@SoManyHs SoManyHs added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label May 17, 2019
@NGL321 NGL321 assigned SoManyHs and piradeepk and unassigned rix0rrr Oct 10, 2019
@bf-sodle
Copy link

+1

@MrArnoldPalmer MrArnoldPalmer added the effort/small Small work item – less than a day of effort label May 4, 2020
@SoManyHs SoManyHs added the good first issue Related to contributions. See CONTRIBUTING.md label May 5, 2020
@allisaurus allisaurus self-assigned this May 5, 2020
@SomayaB SomayaB assigned MrArnoldPalmer and unassigned SoManyHs and piradeepk Oct 21, 2020
@SomayaB SomayaB assigned uttarasridhar and SoManyHs and unassigned allisaurus Nov 3, 2020
@blimmer
Copy link
Contributor

blimmer commented Dec 16, 2020

I was able to hack around this like so, but your mileage may vary:

(service.taskDefinition.defaultContainer as any).props.environment["ENV_VAR_FOO"] = "bar";

@MrArnoldPalmer MrArnoldPalmer removed their assignment Jun 21, 2021
@blimmer
Copy link
Contributor

blimmer commented Feb 16, 2022

Somewhere between CDK v1.122.0 and v1.144.0 my workaround above stopped working. This is what I now have to use instead:

(service.taskDefinition.defaultContainer as any).node.host.environment["ENV_VAR_FOO"] = "bar";

@MrArnoldPalmer
Copy link
Contributor

This was in fact resolved via #17889

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

No branches or pull requests

10 participants