aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.47k stars 1.16k forks source link

Unable to solve mapping for Timeout property #6975

Open D-Jurado opened 3 months ago

D-Jurado commented 3 months ago

Description

I'm using a mapping function to set Timeout property for my Type: AWS::Serverless::Function, I'm not getting any error running sam build or sam validate but sam local start-lambda is throwing the following error:

Lambda functions containers initialization failed because of Invalid Number for Timeout: OrderedDict([('Fn::FindInMap', ['common', 'LambdaFunction', 'Timeout'])])

Steps to reproduce

This is the portion of my Cloudformation file where I'm using the map to set Timeout property

Mappings:
  common:
    LambdaFunction:
      Timeout: 900

Resources:
  myFunction:
    Type: AWS::Serverless::Function
    Properties:
      Timeout: !FindInMap [common, LambdaFunction, Timeout]

Observed result

Error log

Lambda functions containers initialization failed because of Invalid Number for Timeout: OrderedDict([('Fn::FindInMap', ['common', 'LambdaFunction', 'Timeout'])])

Expected result

Run lambda

Additional environment details

  1. OS: Windows 11
  2. If using the SAM CLI, sam --version: SAM CLI, version 1.115.0
  3. AWS region: us-east-1
moelasmar commented 2 months ago

This issue is related to SAM CLI, I will transfer the issue to the correct repository.

sidhujus commented 2 months ago

Hi @D-Jurado, Thanks for reporting the issue and providing an example. I was able to reproduce this issue. Marking it as a bug so the team can prioritize a fix

D-Jurado commented 2 months ago

Hi @D-Jurado, Thanks for reporting the issue and providing an example. I was able to reproduce this issue. Marking it as a bug so the team can prioritize a fix

Thank you!