Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lambda/serverless function as the resources #576

Open
pkarw opened this issue Apr 19, 2021 · 2 comments
Open

Add Lambda/serverless function as the resources #576

pkarw opened this issue Apr 19, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@pkarw
Copy link
Collaborator

pkarw commented Apr 19, 2021

Is your feature request related to a problem? If yes, please describe the problem.
It would be great to have an abstract resource like lambda for adding custom resources based on AWS. OK, it's kind of wrapper for fetch but it shows how super easily one can extend and call the AskQL with custom-made data sources

Describe the solution you'd like to see.
It could be like lambda helper one can could add as a customResource. I mean something like:

const baseEnvironment = {
  const customResources = [
    'myLambdaCall': awsLambda("myFunctionName", awsOptions) // the first attribute of the returned resource is accepting the lambda payload and it's returning json
  ];
  resources: {...builtInResources, ...customResources },
  // customValues,
};

so then they could use it in the AskQL Script (assuming we already have #575 implemented) like this:

let a =  { exampleObject }
a:myLambdaCall:jsonPath("a:items[0]")
@pkarw pkarw added the enhancement New feature or request label Apr 19, 2021
@czerwinskilukasz1
Copy link
Collaborator

I like it, it would greatly enhance Ask's capabilities, while maintaining the security of the Ask server.

You suggested to hard code a specific lambda function (myLambdaCall defined as calling an AWS lambda function myFunctionName). Correct me if I am wrong, but to me it means that:

  1. the function would need to be accessible by the running server, meaning that the CODE of server would automatically assume access to AWS through a very specific account where myFunctionName is defined
  2. adding other lambda functions, whose one of the main advantages is being ad-hoc functions, would require changes in the source code of the server.

What I suggest instead is to:

  1. provide a mechanism to authenticate server owner's AWS account so that Ask programs can call lambda functions from it and
  2. provide a mechanism to pass AWS credentials, so that AskScript programs can call user's AWS Lambda functions that were set up with AWS authorization.

@pkarw
Copy link
Collaborator Author

pkarw commented May 3, 2021

Cool, it leads us to new FR - implementing secrets. Not sure how exactly it should work - I mean it should be somehow pass-only kind of variables (that you can't get thru query, but could pass to the subsequent resource and function -calls)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants