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
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.
nathanlo9
@nathanlo9
Just discovered Claudia and have begun reading the documentation. Can Claudia Bot Builder be used to create bots using either Amazon Lex or Google Dialogflow? In other words, is a bot built with Claudia portable between the two bot engines?
Kyle Qian
@qianxiaoming
Hi, I get "BadRequestException: Endpoint Configuration type EDGE is not supported in this region: cn-northwest-1" while creating Lambda function. How can I avoid this?
Shahar Solomianik
@shaharsol_twitter
Hi, I want to use nodegit in my lambda function, this requires access to the local file system. Does lambda even has a "local file system" or if it doesn't and I need to attach some other AWS resource (s3?) to mimic the fs, can claudia help with that?
Mario DeSousa
@mdesousa
Hi, I'm using claudia pack with an npm package that is a workspace (npm 7). It looks like dependent workspaces do not get installed... is this a bug? Or maybe a future enhancement? Thanks.
Ross Coundon
@rcoundon

Hi, I want to use nodegit in my lambda function, this requires access to the local file system. Does lambda even has a "local file system" or if it doesn't and I need to attach some other AWS resource (s3?) to mimic the fs, can claudia help with that?

You can access the /tmp folder but you can't rely on anything you write there being available on other runs. There's now EFS support in lambda too but I'm not familiar with it yet.

rluisnpt1
@rluisnpt1

Hi everyone, so I'm facing some problems with claudia bot builder, Does any one know how to fix, what I'm doing wrong ?

'OAuth "Facebook Platform" "invalid_request" "(#100) The parameter subscribed_fields is required.-

Here is my configuration

`
"scripts": {
"create": "claudia create --api-module bot --region eu-west-1 --configure-fb-bot",
"configure-fb": "claudia update --configure-fb-bot",
"deploy": "claudia update"
},
"dependencies": {
"claudia": "^5.12.0",
"claudia-bot-builder": "^4.5.0"
}

`

honkskillet
@honkskillet
Does claudia support Node v14?
Reik Schatz
@reik-wargaming
@honkskillet AWS Lambda does not directly support Node14.x as runtime yet. AWS will probably add that soon.
constantinov
@constantinov
Hi All
I am trying to set up a AWS APi gateway proxy resource, but getting this error
"errorType": "Error",
"errorMessage": "no handler for POST /viber/{proxy+}",
"stack": [
"Error: no handler for POST /viber/{proxy+}",
" at _homogeneousError (/var/runtime/CallbackContext.js:12:12)",
" at postError (/var/runtime/CallbackContext.js:29:54)",
" at done (/var/runtime/CallbackContext.js:56:7)",
" at Object.done (/var/runtime/CallbackContext.js:104:16)",
" at handleError (/var/task/node_modules/claudia-api-builder/src/api-builder.js:348:12)"
May you pease assist with a solution?
I want several Viber Public accounts to be pointed to same bot instance add want an identifier in their webhook
something like viber/323g2s323
Carl Banbury
@cbanbury

Hi, when using the add-scheduled-event, I want to be able to run it to change an existing schedule.

Currently if I run add-scheduled-event twice with two different --cron defintions, it creates two identical targets in the EventBridge, under one rule...

Am I doing something wrong?

jofg123
@jofg123
Hi, Im a beginner and i want to create chatbot in fb then i have problem with this
Hi, Im a beginner and i want to create chatbot in fb then i have problem with this$ claudia create --region us-east-1 --api-module bot --configure-fb-bot
loading package config sts.optInRegionalEndpoint
Error: connect ETIMEDOUT 169.254.169.254:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
message: 'Missing credentials in config',
errno: -110,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.666Z,
originalError: {
message: 'Could not load credentials from any providers',
errno: -110,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.665Z,
originalError: {
message: 'EC2 Metadata roleName request returned error',
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.663Z,
originalError: [Object]
}
}
}
OtterCoder
@OtterCode
So, does anyone have recommendations for doc generation with Claudia?
Kqzz
@Kqzz

Hi, Im a beginner and i want to create chatbot in fb then i have problem with this$ claudia create --region us-east-1 --api-module bot --configure-fb-bot
loading package config sts.optInRegionalEndpoint
Error: connect ETIMEDOUT 169.254.169.254:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
message: 'Missing credentials in config',
errno: -110,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.666Z,
originalError: {
message: 'Could not load credentials from any providers',
errno: -110,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.665Z,
originalError: {
message: 'EC2 Metadata roleName request returned error',
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-02-08T09:23:06.663Z,
originalError: [Object]
}
}
}

I'm actually getting this exact same problem! I could use some help, if anyone has any ideas.

Nicolás Sosa
@nsosacarrion-osma
Hi! I want to propose a very slight change to claudia. I need to deploy a lambda with the new max memory that is 10240, but we need to change that in src/utils/limits.json.
Victor Wiebe
@victorwiebe

Hello there, I am experiencing CORS issues.

Environment is claudiajs deploying to lambda

I can test properly from Postman

CORS issues on Website itself when testing on localhost:3000

Please advise
Victor Wiebe
@victorwiebe
So Basically, on the website doesnt work, on Postman works perfectly
Sethupathy
@Sethupa14919203_twitter
Map your api gateway url to DNS, will sort out the CORS issue
@victorwiebe
lstone
@lstone
Hello, I'm using Claudia.js and Claudia-api-builder to deploy a Lambda function (works great). Currently this function has API Gateway as an event source. I'd like this same Lambda function to be able to alsp listen to SNS events Additionally, I'd like a specific function inside the Lambda codebase to be invoked upon receiving an SNS event. Is there a way to do this w/ Claudia.js in conjunction w/ the api builder?
lstone
@lstone
Follow up - I've sorted this out ^
Elia Contini
@EliaContini

Hi all,

I'm trying to run the Hello World AWS Lambda Function following the steps in the tutorial.

I ran

claudia create --profile claudia --region us-east-1 --handler lambda.handler

but the output I got is this error

validating package      npm dedupe -q --no-package-lock
npm dedupe -q --no-package-lock failed.

and the file claudia.json is not created.

I'm using claudia 5.13.0, Node.js 14.16.0, npm 7.5.6 on Ubuntu 18.04.5 LTS .

Any suggestion?
Thank you

Bruno M.
@brunosmm

Hello,

I have a web-api project with a few endpoint, and would like to include a new lambda which should be trigger via an event scheduler. Can I add a new js file in the project and set a claudia add-scheduled-event or it should be a new project separated from the web-api?