Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

939
Views
How you Reference the function ARN of a Function (Lambda) in serverless.yml file?

Considering this lambda function on a serverless.yml file:

functions:
  s3toEc2Lambda:
    handler: s3toec2lambda.S3toEc2Lambda
    name: "${self:service}-s3toEc2Lambda"
    role: S3toEc2LambdaRole

And considering this SNS created on resources section: Does someone knows how to inform the Sns ARN Endpoint from the lambda function s3toEc2Lambda ?

resources:
  Resources:
    WordpressFrontEndSnsS3toEc2:
      Type: AWS::SNS::Topic
      Properties:
        TopicName: "wordpress-front-end-s3-ec2"

    WordpressFrontEndSnsS3toEc2Lambda:
      Type: AWS::SNS::Subscription
      Properties:
        Endpoint: { "Fn::GetAtt": ["s3toEc2Lambda", "Arn" ] }                    <------ HERE    <------
        #Endpoint: ${self:functions.s3toEc2Lambda}                               <------ OR HERE <------
        #Endpoint: { "Fn::GetAtt": ["${self:functions.s3toEc2Lambda}", "Arn" ] } <------ OR HERE <------
        Protocol: lambda
        TopicArn: !Ref 'WordpressFrontEndSnsS3toEc2'

For me always appear a error message like this: "Template error: instance of Fn::GetAtt references undefined resource s3toEc2Lambda"

Thank You !

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

CloudFormation resources created by serverless have known format. For lambda function this is:

{normalizedFunctionName}LambdaFunction

Thus you should be able to reference your function using the following:

"Fn::GetAtt": [ S3toEc2LambdaLambdaFunction, Arn ]

More example about this are here

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!