aws-actions / amazon-ecs-render-task-definition

Inserts a container image URI into an Amazon ECS task definition JSON file.
MIT License
261 stars 138 forks source link

How to pass environment variable file to the action? #275

Open binjiezhao-alcumus opened 8 months ago

binjiezhao-alcumus commented 8 months ago

We need to pass environment variable file stored in S3 to the render action. See this aws doc: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html

How do we do it?

LiJell commented 4 months ago
"containerDefinitions": [
      ...
   "environmentFiles": [
          {
            "value": "arn:aws:s3:::environment.env",
            "type": "s3"
          }
        ],
      ...
]

like above under containerDefinitions

is this what you mean?

binjiezhao-alcumus commented 4 months ago

Yes exactly. We have an env file for each environment: dev, test etc. Currently this is solved by an extra bash step to replace the file name for env.