Use other CloudFormation stack outputs as env variables in my ECS tasks #13370
Labels
containers
Issues related to the non-serverless container based functionality
pending-triage
Issue is pending triage
question
General question
Amplify CLI Version
12.7.1
Question
Hi all!
I've created an API as a serverless container in Fargate using the Amplify CLI. All is good and works. Then I want to set up a DocumentDB for data storage (I need Mongo compatibility, cannot do the default DynamoDB). I've created a custom resource with the stack that creates my cluster, my instances, and a secret in the Secrets Manager with the credentials. The stack outputs are the Cluster endpoint, Cluster port, and Secret ARN.
I would like to inject these 3 values into my Fargate container as environment variables. Here's what I've tried so far:
Is there anything else I can try?
Edit: I've managed to inject the parameters into the stack by adding them to the
backend-config.json
and to theamplify-meta.json
, into thedependsOn
array, like this:Now I have them in the CF stack:
But every time I try to reference them from the container definition:
It gets overriden by the
amplify push
commandThe text was updated successfully, but these errors were encountered: