Open FergusMcGlynn opened 4 years ago
Hi @FergusMcGlynn , Thank you for reporting. We cut a ticket in our customer oncall list. We will investigate your issue soon.
Hi, are there any updates to this? I tried to add a no-index header which should only apply to our test enviroment, but it seems that the env-vars are not available in the customHttp.yml
Would also like to see this, we would want to return link
headers, and have different URLs for different environments (staging, etc)
Bumping, we have headers that differ between dev and production that we define in customHttp.yml
I also have this requirement.
+1, this is very much needed please!
Environment variables are not interpolated (i.e. their names are treated as literals) in the
customHeaders
section of amplify.yml (at least whenamplify.yml
is hosted in Amplify Console and not in the git repo).For example, if
amplify.yml
contains:then when https://trusted.example.com tries to fetch a file from this app it will be blocked by CORS because the app is sending the header value "${TRUSTED_DOMAIN}" rather than "https://trusted.example.com":
The reason I want to use an environment variable in the
customHeaders
section is because I am setting up this Amplify Console app using Cloudformation, and I do not know the value of $TRUSTED_DOMAIN in advance of Cloudformation running - its value will be specific to a deployment environment, hence wanting to use it as an environment variable. The above example shows the environment variable being set inamplify.yml
to demonstrate the point, but in my case the environment variable will be set by Cloudformation.I can't find any documentation that states where in
amplify.yml
environment variables can be used. I assumed they can be used anywhere in the file but it looks like that's not the case. I notice that they can't be used in theartifacts
section ofamplify.yml
either. This should either be fixed, or the documentation should make it clear where they can and can't be used and why.