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

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

Open
binjiezhao-alcumus opened this issue Oct 18, 2023 · 3 comments
Open

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

binjiezhao-alcumus opened this issue Oct 18, 2023 · 3 comments

Comments

@binjiezhao-alcumus
Copy link

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
Copy link

LiJell commented Mar 4, 2024

"containerDefinitions": [
      ...
   "environmentFiles": [
          {
            "value": "arn:aws:s3:::environment.env",
            "type": "s3"
          }
        ],
      ...
]

like above under containerDefinitions

is this what you mean?

@binjiezhao-alcumus
Copy link
Author

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.

@ctjhoa
Copy link

ctjhoa commented Oct 27, 2024

If I'm not mistaken, this feature is already implemented but not documented.
a55093e#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R32
From my understanding you can specify each arn like this:

        uses: aws-actions/amazon-ecs-render-task-definition@v1
        with:
          task-definition: ${{ vars.FARGATE_TASK_DEFINITION }}
          container-name: ${{ vars.FARGATE_CONTAINER_NAME }}
          image: ${{ secrets.ECR_IMAGE_NAME }}
          env-files: |
            arn:aws:s3:::s3_bucket_name/envfile1_object_name.env
            arn:aws:s3:::s3_bucket_name/envfile2_object_name.env
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants