You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to issue #490, please add support for !Sub !Ref, and a minimal !If implementation for environment vars in serverless function or in a globals section.
Not having this functionality means copy-paste duplication within a template, maintaining a duplicate template for local execution, copy-paste duplication to specify env vars on the command line, and/or the inability to override default values of environment variables via parameters at runtime.
Bonus points for supporting all variations expressing the fn in Yaml and Json
In 0.3.0 this was refactored and appears only to be supporter in a very limited context (e.g., swagger urls?).
Output of sam --version: 0.4.0
Reacted by Alexey Semenkov, Sascha Bates, Bewhiskered Bard, Stefan Charsley, Matthieu Napoli, Bill, Ferdinand Salis, Fredrik Liljegren, Ben Bernays, kelledro and 6 more
It's a limiter for using layers as the ARN contains the region so can't have the template just load the correct layer by subbing the region. Managed to work around this so far but with layers I don't see a workaround.
Now it's October 2020, sam cli version 1.6.2. Intrinsics like !Sub or !FindInMap don't work in sam local as far as I can see ('Unable to resolve property'). I can't find any other issue regarding this. Does that mean the plans to support this have been dropped?
Reacted by Anderson Reinkordt, Shintaro Anazawa and Arun Ganesan
Activity
jfuss commentedon Jul 5, 2018
This is also related to #450 and #476.
Going to update labels.
charsleysa commentedon Dec 12, 2018
@jfuss is there any progress on this?
It's a limiter for using layers as the ARN contains the region so can't have the template just load the correct layer by subbing the region. Managed to work around this so far but with layers I don't see a workaround.
mnapoli commentedon Jan 10, 2019
@charsleysa exactly! I face the same problem with region and even layer versions (I want to use environment variables for those). Related: aws/serverless-application-model#751
mnapoli commentedon Feb 8, 2019
Just a heads up for those interested,
!Refhas been implemented in #657.jfuss commentedon May 7, 2019
I have (slowly) been working on some Sub support. I have pushed the code to my branch/repo. I have some functional tests that are working but missing:
If anyone is looking for a good way to contribute and need/want sub support, feel free to take what I started as the base.
[-]Missing !Sub !Ref and !If instrinsic functions[/-][+]Missing !Sub and !If instrinsic functions[/+]henrikbjorn commentedon Jul 26, 2019
Running into this also for Layers.
joshpeng commentedon Aug 11, 2019
How do we get
!Refto work? I keep running into this:Here is my
template.yml:I am on SAM CLI v0.19.0.
daveykane commentedon Sep 8, 2019
Also having trouble with !Sub not working with Layers
jfuss commentedon Sep 16, 2019
Release in v0.21.0.
Closing
ulfbrehmer commentedon Oct 23, 2020
Now it's October 2020, sam cli version 1.6.2. Intrinsics like !Sub or !FindInMap don't work in sam local as far as I can see ('Unable to resolve property'). I can't find any other issue regarding this. Does that mean the plans to support this have been dropped?