3

I am deploying an R function on Lambda via a provided runtime, however it fails during the build process.

Steps I did:

  1. Setup the R Runtime via Lambda Layers everything is working perfectly (https://github.com/bakdata/aws-lambda-r-runtime)

  2. Created Lambda function in R and added it to the template.yml file:

 RTestFunction:
  Type: AWS::Serverless::Function
  Properties:
    CodeUri: functions/r_test
    Handler: fun.handler
    Runtime: provided
    Layers:
      - !Ref Runtime # ARN String to Runtime Layer
      - !Ref Recommended # ARN String to Recommended Layer
      - !Ref AWSLibs # ARN String to AWSLibs Layer
    Policies:
      - AWSLambdaBasicExecutionRole
      - S3ReadPolicy:
          BucketName: !Ref Bucket
    Timeout: 300
    MemorySize: 256
  1. Executed sam build
  2. I get the following error message:
Building codeuri: functions/r_test runtime: provided metadata: {} functions: ['RTestFunction']

Build Failed
Error: CustomMakeBuilder:Resolver - Path resolution for runtime: provided of binary: make was not successful

Even though I get the error, everything is still working perfectly and the RTestFunction works as intented. But I would prefer to solve the error.

Question:

  • How can I skip the building part, since the layer is already deployed and works. I only want to link the Layers (Runtime, Recommended and AWSLibs) to the RTestFunction by using the corresponding ARNs.

The documentation says that it's optional to use the Metadata tag to build the runtime, but I didn't use the Metadata tag, so why does it still try to build the runtime? https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html

user7055220
  • 73
  • 1
  • 7

0 Answers0