Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2016 23:48
    @gojko banned @codepreneur
amarpandav
@amarpandav
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ć
@stojanovic
Hey, the node version for your lambda function is v6.10, please rerun the command with --runtime nodejs12.x
amarpandav
@amarpandav
let me try that, can't i change the runtime of my lambda globally?
Slobodan Stojanović
@stojanovic
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
amarpandav
@amarpandav
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
yup
it worked
thanks alot ;)
Slobodan Stojanović
@stojanovic
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
@gate5th
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ć
@stojanovic
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
Wes
@wmelton
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
james-s-turner
@james-s-turner
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
Matt
@mbrookes
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
Matt
@mbrookes
Just wanted to say, @gojko, @stojanovic, @simalexan Claudia is dope!
softwareguy74
@softwareguy74
How do you specify the HTTP API option when creating an AWS API Gateway using claudia-api-builder?
Slobodan Stojanović
@stojanovic
@softwareguy74 you can’t at the moment. The API Builder library supports only API Gateway REST API.
@mbrookes thanks :)
softwareguy74
@softwareguy74
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ć
@stojanovic
@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
@rcoundon

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
@rcoundon

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.
i.e.
outside of handler

let sharp;

inside handler

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

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

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

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ć
@stojanovic

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.
@rcoundon
Slobodan Stojanović
@stojanovic
For sharp, this is the problem that Claudia doesn't solve really well, because it's not easy to solve it for all cases. Your solution works fine. In the Lambda function itself, sharp will be available like any other globally available module, so you can install sharp globally and then you should be able to pack your node modules without sharp using Claudia, and everything will still work after you deploy it.
Ross Coundon
@rcoundon

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.

Thanks @stojanovic - that's almost exactly the pattern I went with, except using SQS instead of SNS

  1. The endpoint creates the S3 file and returns a presigned URL, and writes a msg (basically the original request + filename) to an SQS queue
  2. A separate lambda has the SQS queue as a trigger and processes the data, and replaces the S3 file (using same key)
  3. The frontend polls for a file using the presigned URL with content
Idalberto Ricardo
@IdalbertoRC_twitter
Hi guys
I made some modifications in my code
but when I updload the code to AWS
using Claudia
the process is not including those changes
do you know if Claudia have a command to clean cache or something like that
Alvaro Soto
@alsohi24

Hello guys, when run:
claudia update --use-local-dependencies
Happens:
npm ERR! code EEXIST npm ERR! path /private/var/folders/gp/tksqwx0x3w96hnd2p_zczk480000gp/T/tKqD1w/quryappgwaws-1.0.0-HAkaXS/package/node_modules/claudia/node_modules/aws-sdk/node_modules/.bin/uuid

I am following this guide:
Building a Serverless Application in AWS using React and Claudiajs

Gonzalo Leonel Petraglia
@gpetraglia
Hey everyone
I'm trying to come up with a solution to get multiple params
I found that aws promotes the usage of multiValueQueryStringParameters in here https://aws.amazon.com/es/blogs/compute/support-for-multi-value-parameters-in-amazon-api-gateway/
Is there anyway to do this using the same handler locally?
Miguel Quintero
@miqui
hi ...newbie...here can i integrate claudia with MS Teams?
Slobodan Stojanović
@stojanovic
You can use the Claudia API Builder to build your own integration, but you can’t do it using the Claudia Bot Builder.
Loredo Sola
@loredo_sola_twitter
Does Claudia deploy to HTTP API? Does Claudia integrate with firebase auth/JWT?
Slobodan Stojanović
@stojanovic
I want to write a blog post about serverless MS Teams bot using SAM (we use it for https://vacationtracker.io) but I don’t have time to do that right now, it’ll probably be ready in a few weeks
@loredo_sola_twitter no HTTP API integration at the moment. But if you want to add it feel free to send a PR, I can probably help with that.