-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing !Sub and !If instrinsic functions #528
Comments
@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. |
@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 |
Just a heads up for those interested, |
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. |
Running into this also for Layers. |
How do we get
Here is my Parameters:
SomeTestParam:
Type: String
Default: foobar
...
SomeLambdaFunction:
Type: AWS::Serverless::Function
Properties:
...
Environment:
Variables:
MY_ENV_VAR: !Ref SomeTestParam I am on SAM CLI v0.19.0. |
Also having trouble with !Sub not working with Layers |
Release in v0.21.0. Closing |
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? |
Description:
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.0The text was updated successfully, but these errors were encountered: