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
Asaduzzaman Himel
@asaduzzaman69
@gojko does Claudia support web socket api getway~?
Ghost
@ghost~58a7c5ded73408ce4f4b2a6b
claudia create --handler lambda.handler --deploy-proxy-api --region us-west-2 --name fileUploader
packaging files
TypeError: Cannot read property 'replace' of undefined
at expectedArchiveName (/Users/srn/.nvm/versions/node/v13.7.0/lib/node_modules/claudia/src/util/expected-archive-name.js:3:28)
at runWithConfig (/Users/srn/.nvm/versions/node/v13.7.0/lib/node_modules/claudia/src/util/pack-project-to-tar.js:10:56)
I keep getting that error when I try to do claudia create, any ideas why?
I tried changing the node versions, but no luck.
Ghost
@ghost~58a7c5ded73408ce4f4b2a6b
My lambda.js file seem ok too.
Aditya Avanth
@AdityaAvanth_twitter

I get the same error as @ghost~58a7c5ded73408ce4f4b2a6b
packaging files
TypeError: Cannot read property 'replace' of undefined
at expectedArchiveName (/Users/admin/.nvm/versions/node/v14.17.0/lib/node_modules/claudia/src/util/expected-archive-name.js:3:28)
at runWithConfig (/Users/admin/.nvm/versions/node/v14.17.0/lib/node_modules/claudia/src/util/pack-project-to-tar.js:10:56)

Can someone pls help me debug this?

Ryan Davis
@RyPoints
When constructing an AWS Lambda function with Claudia, the docs say to do exports.handler = function (event, context) { and then to reference the payload parameters sent to the function using event.parameterName but when I do that and print the parameters to the console, they all say "undefined." Anyone know why?
I'm pretty sure I have used it before like that. I am wondering if there's been changes since the docs were written...maybe event.somenewsubproperty.parameterName or something?
Ah, nevermind, already figured it out. Alamofire changed a bit and I wasn't passing the parameters.
npwoods
@npwoods
I'm trying to use Claudia.js for Lambda@Edge, but my Lambdas end up being wayyy to large. I tried downloading the Lambda package from AWS, and I see claudia inside my node_modules. I've confirmed that in my package.json, Claudia is a devDependency not a dependency. I'm probably doing something stupid
ziedmahdi
@ziedmahdi

Hello,
I wanted to explore callbackWaitsForEmptyEventLoop parameter so I have created a lambda with the below code

var ApiBuilder = require('claudia-api-builder'),
    api = new ApiBuilder();

module.exports = api;

api.any('/test', function (request) {
    request.lambdaContext.callbackWaitsForEmptyEventLoop = true;

    var prefix = request.proxyRequest.queryStringParameters.id;
    console.log('hello: ' + prefix);
    setTimeout(function () {
        console.log('after timeout: ' + prefix);
    }, 5000);

    return new ApiBuilder.ApiResponse('OK ' + prefix, {'X-Version': '202', 'Content-Type': 'text/plain'}, 200);

});

The strange thing is I don't see the 'after timeout' message.

even on other requests
image.png
image.png
ziedmahdi
@ziedmahdi
{
  "devDependencies": {
    "claudia": "^5.13.1"
  },
  "dependencies": {
    "claudia-api-builder": "^4.1.2"
  }
}
ziedmahdi
@ziedmahdi

when I tried with callbackWaitsForEmptyEventLoop=false,

var ApiBuilder = require('claudia-api-builder'),
    api = new ApiBuilder();

module.exports = api;

api.any('/test', function (request) {
    request.lambdaContext.callbackWaitsForEmptyEventLoop = false;

    var prefix = request.proxyRequest.queryStringParameters.id;
    console.log('hello: ' + prefix);
    setTimeout(function () {
        console.log('after timeout: ' + prefix);
    }, 5000);

    return new ApiBuilder.ApiResponse('OK ' + prefix, {'X-Version': '202', 'Content-Type': 'text/plain'}, 200);

});

I got 'after timeout' but only when I sent two request (19 sec between each)

image.png
When I sent a third request (12 minutes later) the 'after timeout' message didn't appear
image.png
ziedmahdi
@ziedmahdi
@harblaith7 the easiest way is to use ApiResponse
return new ApiBuilder.ApiResponse('Request received', {'Content-Type': 'text/plain'}, 200);
Don MacKinnon
@dmackinn
Does anyone have working examples of accepting a multipart/form-data POST request containing binary content such as a png/jpeg? Specifically I'm trying to pass along a form value as well as a image file via a Postman post to an claudia api endpoint but I'm not seeing anything to indicate it's being attached to the request object. I'm using claudia-api-builder not the express wrapper.
Don MacKinnon
@dmackinn
I was able to get it working on lambda with busboy. For anyone who comes across this, I was never able to get it working locally via the claudia-local-api package, it appears multi-part forms are not supported with that currently
Jan Dockx
@jandppw
Does anybody have any idea how to deal with ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:…, which suddenly started happening, after a 150 successful claudia updates by CI? See claudiajs/claudia#226.
Tony BenBrahim
@tbenbrahim
I am thinking of submitting a PR to add support for specifying the architecture during create or update. This is a new feature introduced yesterday (https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)
Fabiano Bonomini
@f.bonomini_gitlab
Hi Everyone! I have a question. When you use the claudia apiBuilder. Claudia create a lamba function for every enpoint?
Don MacKinnon
@dmackinn
@f.bonomini_gitlab it makes one function
David Simpson
@dvdsmpsn_twitter
Hello. Sorry for noob question... Are there any examples of Claudia and existing express apps written as ESM?
Gojko Adzic
@gojko
@/all claudia 5.14.0 is now on NPM, with support for arm/graviton2 architecture deployment and a few long deserved bugfixes. check out https://github.com/claudiajs/claudia/blob/master/RELEASES.md#5140-18-october-2021 for more information
Austin Cooper
@cooperaustinj
Can anyone tell me if there's an answer to this question: claudiajs/claudia#171
Essentially, is there a way to do an authorizationType: 'AWS_IAM' equivalent with --deploy-proxy-api
Austin Cooper
@cooperaustinj
image.png
I see this answer from 2018. I guess that's probably still true.
Kayomarz
@kayomarz
Does anyone know how to cleanup/remove whatever is done by claudia add-s3-event-source. I understand it can be done via the Bucket Event notifications property but how do we do it using claudia? Thanks.
james-s-turner
@james-s-turner
Hey @gojko I have upgraded to 5.14.0 but I'm still seeing claudiajs/claudia#226 as an issue. Should I open a new issue or can 226 be re-opened?