Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Aug 01 2016 23:48
    @gojko banned @codepreneur
Are there any examples of using claudia-bot-builder with SAM lambda function. Copying the code example from https://github.com/claudiajs/example-projects/blob/master/slack-delayed-response/bot.js into /src/handlers/index.js file in a SAM application and in the template.yml file setting the Handler to ./src/handlers/index.api did not work.
Julio Sepia
Sorry if this has been asked before, but does claudia-bot-builder support exporting multiple Slack slash commands?
1 reply
Ugur Cem Ozturk
Hey! Are there any ways to delete every created resources? Like deleting a cloudformation stack and its resources? via CLI
2 replies
Vinodh Thiagarajan
When I build API using Claudia is it possible to float the API around with a Swagger page ?
Chris Burke
@VinodhThiagarajan1309 This looks promising but I havent pulled it in and tested - https://github.com/chongzixin/express-swagger-claudia
John Armstrong
When running claudia create, I remember it creating the claudia.json automatically for me. Now it only prints it to the console. Is that the intended behavior?
Hi i am facing Code storage limit exceeded issue while deploying the package. Anyone have idea to sort out this..
Slobodan Stojanović
I guess you need to delete old versions of your function(s).
There are many scripts for that, and you can also use some SAR app (such as this one: https://lumigo.io/blog/a-serverless-application-to-clean-up-old-deployment-packages/)
@stojanovic Thanks let me try this :)
Hey - I just updated a lambda function and ran "claudia set-cloudfront-trigger ..." with the newly created version. This used to run nicely. However I just started getting the message " You cannot update the specified distribution using this API version because it is associated with a cache policy." When I set the version back to an older one it works. Has something changed in AWS? Looking at the "Cache Policy Name:" on my CF distribution shows blank. Any ideas anyone?
Sam Baek
hi everyone. new here. was wondering if anyone had experience tree-shaking their application using claudia? the limitation i am hitting is claudia update seems to basically require node_modules to have all your modules in the lambda zip file, which effectively renders tree-shaking useless
i've been running into issues trying to get webpack to bundle and then upload that bundled file. most of my errors are coming from the validate package step
Slobodan Stojanović
You can skip re-installing node modules by adding the --use-local-dependencies flag. That will use your local dependencies instead of doing the re-install.
Also, if you have tree shaking, you probably use Webpack or something similar. In that case, you don’t want to deploy the source. You want to deploy the build instead. Claudia requires the package.json file and Claudia config. I guess you can copy a package.json file without dependencies and Claudia config file to your build folder before the deployment, and then run the Claudia update command.

InvalidParameterValueException: The runtime parameter of nodejs6.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions.

I am getting this

thats my node version
while calling
claudia create --api-module dist/src/EnjoyLifeServices --name EnjoyLifeServices --config enjoy-life-claudia-web-api.json --region eu-central-1 --version prod --role arn:aws:iam::blabla
Slobodan Stojanović
Hey, the node version for your lambda function is v6.10, please rerun the command with --runtime nodejs12.x
let me try that, can't i change the runtime of my lambda globally?
Slobodan Stojanović
You need to do this once per Lambda function, i.e., when you do it one time for Lambda1, you’ll no longer need to do that for Lambda1 function
i see
bez online i read---
To set up a new functions with the Node 12 runtime, run claudia create without a --runtime option
let me try runtime option meanwhile
it worked
thanks alot ;)
Slobodan Stojanović
Yes, new functions will automatically be set to a new version of node environment, you need to update existing functions manually
You are welcome :)
Michael Bruns
Hey everyone - I'm having a hell of a time keeping things simple. I have an existing node/express API, and I just want to host it on AWS somewhere. I don't want to have to remake my API routes in some other tool. Can anyone recommend a good tutorial?
Slobodan Stojanović
I wrote an article on running the Express app in AWS Lambda sime time ago, but it should still be valid: https://medium.com/free-code-camp/express-js-and-aws-lambda-a-serverless-love-story-7c77ba0eaa35
Has anyone successfully used claudia update with Github actions? We're trying to use github actions to automate deployment of lambdas to AWS but it chokes saying it can't find any 'credentials providers', which I know is an auth issue, but passing env variables doesn't seem to fix it
Hi everyone, I've read the "Managing Lambda Versions" page and have created two environments that I run concurrently using two api-gateway stages (dev and prod) deployed using "claudia create --version dev --name my-service-name ...". My only problem is that both dev and prod logs are merged into the same cloudwatch log group: "my-service-name". Is there any way to split this into two separate log groups e.g. my-service-name: prod and my-service-name:dev
I could be mistaken, but I believe you would need to give them separate names, so that they run as separate instances, rather than as separate versions of the same instance
Just wanted to say, @gojko, @stojanovic, @simalexan Claudia is dope!
How do you specify the HTTP API option when creating an AWS API Gateway using claudia-api-builder?
Slobodan Stojanović
@softwareguy74 you can’t at the moment. The API Builder library supports only API Gateway REST API.
@mbrookes thanks :)
When will the HTTP API option be available? Was loving claudia until I hit that snag. The HTTP API option is very popular and useful
Slobodan Stojanović
@softwareguy74 sorry for delayed reply. There are no plans to add HTTP API at the moment. I love HTTP API, but I use them with AWS SAM and CloudFormation, and it's similar for the other core maintainers. If you want you can try to send a PR for adding HTTP API support. However, it would require modification of both Claudia and Claudia API Builder modules.
@james-s-turner I aggre with Matt, the best way is to give them separate names and separate Claudia config files (you can use the --config claudia-prod.json option to do that).
Ross Coundon

I have a lambda that uses a layer (sharp) that requires specific Linux binaries for lambda.
What's the best way to deploy this using claudiajs?
I'm using TypeScript and during local development I have the sharp library as a devDependency.
When it's running in AWS, it'll resolve

import sharp from 'sharp'

from the layer and when locally, from the devDependency.
But if I try to deploy it fails because it cannot find sharp.
In the docs it talks about using --use-local-dependencies for a similar use case where binaries are needed for a different platform but I can't see how that works with layers where that dependency will never be directly within the lambda's own node_modules

Ross Coundon

I've worked around this by conditionally requiring sharp so claudia doesn't attempt to resolve at deploy time but would be interested to know if there's a better way.
outside of handler

let sharp;

inside handler

      if (!sharp) {
        sharp = require('sharp');
Ross Coundon

I have a process triggered by an HTTP request to API Gateway that can last longer than 30s. It's retrieving a bunch of data, doing some conversions zipping up and returning.
To work around the 30s limit of API Gateway I'm creating a presigned URL for the file which I want to return immediately in the API response.
Then go ahead and actually build the contents of that file.
So I do something like this

  async (request: ApiRequest) => {
    const filename = `some-file-name-${new Date().valueOf()}.zip`;
    const url = await getSignedUrlforCsv(filename);
    searchInventory(request, filename);
    return {

What seems to happen is that the lambda execution is terminated as soon as the return occurs. Is this something to do with the way claudia-api-builder works or is this fundamental to API Gateway? It seems unlikely it's the latter as that would mean tightly coupling API GW and Lambda but I could be wrong.

Slobodan Stojanović

You can’t continue Lambda execution after returning a result to the API Gateway, that’s not Claudia API Builder limitation, it’s the AWS feature. However, you can send a background message using the SNS notification (or SQS, EventBridge, etc.) and continue running in the background.

If you are generating the file, it would be similar to the following:

  1. HTTP request sends the SNS message, and then returns a presigned URL
  2. Frontend pings that S3 URL each second to see if it’s ready
  3. The SNS message triggers another Lambda function that does the logic in the background and saves the result to the S3 file.