5 Answers
- Newest
- Most votes
- Most comments
0
Difficult to find any issues in the ARN, however it might be malformed YAML file in this case. I can see an extra WHITESPACE in here: "Default: arn:aws:lambda:us-east-1:6666666666666:layer:myLayer:1". Can you try removing that just to rule it out?
answered a year ago
tried it without space as well.
0
That arn is only the default value for the parameter, you're not overriding it are you, e.g. with a space?
0
There you go a full example:
AppLambda:
Type: AWS::Lambda::Function
Properties:
FunctionName: !Sub ${EnvName}-${AWS::Region}-lambda-function-app
Description: !Sub APP API lambda function version ${AppLambdaVersion}
Code:
S3Bucket: !Ref SpecBucketName
S3Key: !Join ['', [ 'templates/lambda/app/', !Ref ContactLambdaVersion , '/zip/', !Ref EnvName , '-' , !Ref AWS::Region , '-', !Ref CommitSha, '-lambda-function-app.zip' ] ]
Handler: index.lambda_handler
Role:
Fn::GetAtt:
- LambdaAppCommonRole
- Arn
Runtime: nodejs12.x
TracingConfig:
Mode: Active
Timeout: 180
Layers:
- !Join [ '', [ 'arn:aws:lambda:', !Ref AWS::Region , ':' , !Ref AWS::AccountId , ':layer:lib-layer:24' ] ]
Environment:
Variables:
APP_VAR: myvalue
Tags:
- Key: Name
Value: !Ref AWS::StackName
- Key: Project
Value: !Ref ProjectName
- Key: Environment
Value: !Ref EnvName
answered a year ago
0
The following works for me with managed AWS layers, e.g.
Layers:
- arn:aws:lambda:eu-north-1:666666666666:layer:AWSSDKPandas-Python311:4
That would suggest it is caused by myLayer being unknown?
answered 3 months ago
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
tried that , didn't work