0
votes

I am new to AWS Docker and I want to set an environment variable in task definition of ECS and then I want to read it from C# code from docker container. Firstly, is it possible? if yes, how to achieve it?

Below is my task.json file

{
  "family": "task-logging-poc",
  "containerDefinitions": [
    {
      "image": "XYZ",
      "name": "logging-poc-1",
      "cpu": 1024,
      "memory": 1024,
      "essential": true,
      "mountPoints": [
        {
          "sourceVolume": "log",
          "containerPath": "c:/data"
        }
      ]
    }
  ]
}
1
Have you done any research before posting here? anyway look in to below link might help you docs.aws.amazon.com/AmazonECS/latest/developerguide/…Kinjal Gor
@KinjalGor I, as one have done so much research on the same and I can not find anything. your link simply doesn't answer the question either.Iman

1 Answers

1
votes

like this:

"environment" : [
    { "name" : "string", "value" : "string" },
    { "name" : "string", "value" : "string" }
]

see this