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
Ghost
@ghost~529c6a01ed5ab0b3bf04d228
Hi,
I want to create a nodejs layer, in order to later create multiple functions that require it.
Is there a way to create the layer using claudia ?I have seen the announcement that linking layers is now supported (5.3), but I could not find info on creating the actual layer.
Ross Coundon
@rcoundon
I'm back to trying to get sharp working with Lambda (having failed previously)
I'm following the instructions here to create a layer - https://github.com/lovell/sharp/issues/1702#issuecomment-499331245
But I cannot seem to reference sharp from within my lambda. I'm lazy loading it (have tried from 'sharp' and from '../../opt/node_modules/sharp' but I'm getting MODULE_NOT_FOUND. Anyone have any clues?
Ross Coundon
@rcoundon

I'm back to trying to get sharp working with Lambda (having failed previously)
I'm following the instructions here to create a layer - https://github.com/lovell/sharp/issues/1702#issuecomment-499331245
But I cannot seem to reference sharp from within my lambda. I'm lazy loading it (have tried from 'sharp' and from '../../opt/node_modules/sharp' but I'm getting MODULE_NOT_FOUND. Anyone have any clues?

I've finally done it :-D. If anyone is trying to do similar. I created a layer and installed sharp using npm install --arch=x64 --platform=linux sharp.
I zipped this and added it to AWS as a lambda layer. Then I lazy-loaded sharp in my code using
const sharp = require('/opt/node_modules/sharp');

Ghost
@ghost~5e344057d73408ce4fd854ee
When using the authorizer, I am getting an API_CONFIGURATION_ERROR only on the prod stage. The dev stage works fine.
Weird thing is that when I call an endpoint, only one of the prod URLs work, and everything else doesn't. I'm confused on where to continue.
I have set a dev and prod stage to the authorizer, but I doubt that works because the authorizer itself isn't attached to any API gateway.
Ghost
@ghost~5e344057d73408ce4fd854ee
This is what I get on the CloudWatch logs Execution failed due to configuration error: Invalid permissions on Lambda function
Ghost
@ghost~5e344057d73408ce4fd854ee
I used the set-version command to make the prod stage
There's an error, but I don't know what it means
What I noticed is that the prod stage doesn't link to the API Gateway like the dev stage.
Ghost
@ghost~5e344057d73408ce4fd854ee
@gojko @stojanovic Any ideas on how to fix this issue?
Ghost
@ghost~5e344057d73408ce4fd854ee
Okay so I found the issue, and it seems to be a bug of Claudia? When using the set-version command, it doesn't create a proper permission policy for that stage. So, I created a command for aws command line.
aws lambda add-permission --function-name FUNCTION:STAGE --statement-id web-api-access-STAGE-TIMESTAMP --action lambda:InvokeFunction --principal apigateway.amazonaws.com --source-arn arn:aws:execute-api:REGION:ACCOUNT_ID:API_ID/authorizers/\*
Ghost
@ghost~5e344057d73408ce4fd854ee
Surprisingly, I found out you must run the update command for the prod after running set-version. So I assume it's problem solved.
Gojko Adzic
@gojko
@mrjackyliang set-version is designed to be a very quick alias update, as opposed to uploading new code, function config etc
so you can't set the version to an alias that's never been deployed before; you need to use claudia update at least once for that alias
or claudia create to set it initially
after, that, you can use set-version to reassign a deployed alias
Ghost
@ghost~5e344057d73408ce4fd854ee
So the commands would be claudia create --version dev, then claudia set-version --version prod, and finally claudia update --version prod
Cody Seibert
@codyseibert
when running claudia in a ci/cd pipeline, do you store the claudia.json in s3 and fetch it before you run a deploy? Where are docs on using this in a ci/cd pipeline?
Oguzhan Cakmak
@muratcakmak
Hey folks,
I can't see anywhere if there is an argument to switch yarn instead of npm. I am using yarn workspaces and try to create a lambda function from a project which depends on another local package in monorepo. npm --production fails to recognize local packages so yarn support would be life saver
Gojko Adzic
@gojko
@codyseibert we commit claudia.json to version control
bbehling
@bbehling
Hello. I just posted this issue

claudiajs/claudia#217

When I use the files property in packages.json, claudia is not finding the /var directory. This is the temp directory the package is compiled in. Note, I'm on a mac

Khoi Pham
@osubuu

Hello!

I'm trying to implement URL redirection on a GET endpoint similar to the example here (https://github.com/claudiajs/example-projects/blob/master/web-serving-html/web.js).

The example:

// because the success code is 3xx, the content will be used as the redirect location
api.get('/redirect', function () {
    'use strict';
    return 'https://github.com/claudiajs/claudia';
}, { success: 302 });

My code :

const APIBuilder = require('claudia-api-builder');
const API = new APIBuilder();
API.get('/token', request => myFunction(API, request), {
  success: constants.statusCodes.movedTemporarily,  // this is 307
});

I've tested it on a browser and the page does not get redirected. The redirection URL simply gets outputted onto the page itself. Any idea on what I may be misunderstanding?

Alfred
@alfiepoleon
Hello, firstly, thanks to this awesome tool, I love it!
One question from me, is there a way to save the output of claudia update to a local file?
Thanks
Biktop
@Biktop
Hello! I use Claudia API Builder together with AWS API Gateway and now I decided to switch some API to AWS ALB (due to 30 sec limitation of API Gateway). Is it possible (or it's planning) to support simultaneously API Gateway and ALB? It's mostly the same payload structure and it will be good to have such option.
Dassi Orleando
@dassiorleando

Hello guys, I really enjoy using ClaudiaJS for lambda deployments Thanks for that.

Please, while deploying I see some logs of my App in my terminal, is ClaudiaJS running my handler somehow before pushing it to AWS (at the package validation step)? If yes is it possible to disable this?

aslary
@aslary
Hi, PLEASE tell me how I can debug and run my app locally that uses the Claudia API Builder??
beremizsinistro
@beremizsinistro
Hi, everyone. I'm having a trouble and I dont know where it is. I created a facebook page to use claudia bot. I set a AWS account got the IAM keys. When I did the command claudia create --region us-east-1 --api-module "something" --configure-fb-bot it didnt finish. It appeared a 400 connection code. But the bot actually worked on facebook. The problem is that because the create didn't finish now I can't update it. When I try to run the same command again it shows that somewhere (I dont know where) has a configuration with restriction of running it again (something like repeatable: false)
beremizsinistro
@beremizsinistro
Another question. If I want to undo what I did. I want to remove what claudia create command did. How can I do that?
John Armstrong
@jlarmstrongiv
Hello! Is there an example on how to use Claudiajs with https://nestjs.com/ ?
Alper
@asunar
Hello, we would like to build a slack bot that will call an AWS lambda function. We're only interested in slack as the messaging platform. Is there a way to prune the claudia-bot-builder's dependencies. Claudia-bot-builder is 45mb on my windows machine. We would like to avoid packaging dependencies for other platforms alexa,facebook etc. Is this possible?
Alper
@asunar
I guess looking at node_modules folder size may not be the right way. This says bundle size is 77.9kb. https://bundlephobia.com/result?p=claudia-bot-builder@4.5.0
Alper
@asunar
image.png
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
@jsepia
Sorry if this has been asked before, but does claudia-bot-builder support exporting multiple Slack slash commands?
1 reply
Ugur Cem Ozturk
@ugurcemozturk
Hey! Are there any ways to delete every created resources? Like deleting a cloudformation stack and its resources? via CLI
2 replies
Vinodh Thiagarajan
@VinodhThiagarajan1309
When I build API using Claudia is it possible to float the API around with a Swagger page ?
Chris Burke
@chrisburkejr
@VinodhThiagarajan1309 This looks promising but I havent pulled it in and tested - https://github.com/chongzixin/express-swagger-claudia
John Armstrong
@jlarmstrongiv
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?
Sethupathy
@Sethupa14919203_twitter
Hi i am facing Code storage limit exceeded issue while deploying the package. Anyone have idea to sort out this..
Slobodan Stojanović
@stojanovic
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/)
Sethupathy
@Sethupa14919203_twitter
@stojanovic Thanks let me try this :)
james-s-turner
@james-s-turner
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
@sambaek-rapidai
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ć
@stojanovic
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.
amarpandav
@amarpandav

hello
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