I try to set up AWS ECS task definition of my docker frontend container to an AWS backend url.
In my .env.production:
REACT_APP_HOST=secrets.BACKEND_URL
how should I modify my secrets format or syntax, so that in my ECS task definition when I set container environment variable can be correctly used? key: BACKEND_URL value:xxxxx
Thanks
You need to use Secrets block in ECS task definition, then during run time, ECS will retrieve the secret value and inject as env variable into container.
Some docs if you use with CF, CLI or TF are similar as well
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-secret.html
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With