Repository navigation
Closed
Labels
area/lambda-invokearea/local/start-apisam local start-api commandpriority/2-importantstage/waiting-for-releaseFix has been merged to develop and is waiting for a releasetype/featureFeature request
Milestone
Description
Description:
I am using !FindInMap to set an environment variable value and when I run it with sam local start-api the variable is empty.
Steps to reproduce the issue:
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello-world/
Handler: hello-world
Runtime: go1.x
Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
Events:
CatchAll:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: GET
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
S3BUCKETURL: !FindInMap: [URLS, S3Bucket, test]
Mappings:
"URLS" : {
"S3Bucket" : {
"sam_local" : "http://sam_local_url",
"test": "http://test_url",
"prod" : "http://prod_url"
}
}
Observed result:
Empty string as variable value
Expected result:
S3BUCKETURL="http://test_url"
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Ubuntu 18
Output of sam --version:
SAM CLI, version 0.3.0
Reacted by Faisal Aldilaijan, red8888, Guillaume Racine, Mauricio Dominguez, Liam Murray, kelledro, Alberto Ruis, Artur Albov, Eduardo L., Aaron Walker and 1 more
Reacted by kelledro and Eduardo L.
Metadata
Metadata
Assignees
Labels
area/lambda-invokearea/local/start-apisam local start-api commandpriority/2-importantstage/waiting-for-releaseFix has been merged to develop and is waiting for a releasetype/featureFeature request
Activity
jfuss commentedon Jun 18, 2018
We currently do not resolve Intrinsic functions. For Environment Variables, you can use the
--env-varsinstead.Marking this as a feature-request.
walkafwalka commentedon Aug 16, 2019
@jfuss I noticed this was tagged as stage/waiting-for-release, is this feature supposed to be available in one of the branches right now?
jfuss commentedon Aug 26, 2019
@walkafwalka It is in the develop branch.
jfuss commentedon Sep 16, 2019
Release in v0.21.0.
Closing