karanpratapsingh / preview-environments

Quickly create temporary preview environments
MIT License
14 stars 4 forks source link

Environment Variables #1

Closed moisesrodriguez closed 2 years ago

moisesrodriguez commented 2 years ago

Hey Karan,

I have not test it yet, but awesome job you've done here. I do have a question that I was not able to figure out while looking at the GitHub action workflow or code, is there a way to insert environment variables to the task definition? My application does need many environment variables to work, just one simple example would be the db credentials.

moisesrodriguez commented 2 years ago

Looking a little more I can see you can do that in the GitHub action with something like:

- name: Render Amazon ECS task definition
   id: render-web-container
   uses: aws-actions/amazon-ecs-render-task-definition@v1
   with:
     task-definition: task-definition.json
     container-name: web
     image: amazon/amazon-ecs-sample-1:latest
     environment-variables: |
        LOG_LEVEL=info
        ENVIRONMENT=prod
karanpratapsingh commented 2 years ago

Thanks @moisesrodriguez, looks great...thanks for sharing this info.