LoadBalancedFargateService does not expose environment variables
See original GitHub issueWhen using the higher level LoadBalancedFargateService
construct to create a load balanced Fargate service, it’s not possible to configure the container at runtime with environment variables.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
LoadBalancedFargateService does not expose environment ...
Hi @SoManyHs - to start with, i was starting with just trying to set basic environment variables, but suspect customers would also want...
Read more >aws-cdk/aws-ecs-patterns module - AWS Documentation
If you need to encrypt the traffic between the load balancer and the ECS tasks, you can set the targetProtocol to HTTPS ....
Read more >python 3.x - Can't set environment variables for container in ...
It neither deploy s nor synth s. The CF template for the stack in cdk.out/ doesn't contain the env variables. – Raffael. Feb...
Read more >awslabs/aws-cdk - Gitter
I've made a JSON file with each account id, then under that the variables corresponding to the accountid that would change in each,...
Read more >Variables set in task definition are not available to the job with ...
Environment description. Running custom AWS Fargate executor. Used GitLab Runner version. Running with Running with gitlab-runner 14.1.0 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@PaulMaddox the reason the code above doesn’t work is because the
TaskDef
child is not aCfnTaskDefinition
(L1), it’s aFargateTaskDefinition
(L2). Furthermore, sinceContainerDefinition
is not an L1 resource (but rather part of another L1 resource), you can’t really assign it tocontainerDefinitions
.Anyway, here’s a way to achieve this:
Not very elegant, and relies on the fact that the container definition you wish to override is the first in the array, but should work.
Hi @SoManyHs - to start with, i was starting with just trying to set basic environment variables, but suspect customers would also want to use ECS Secrets longer term.
I would expect the API to mirror the way environment variables and secrets are provided in task definitions. For example:
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html