Open hounded opened 5 years ago
Thanks @hounded for the input: I have recently arrived to the same idea: we need support for Lambda that already exist. I'm split mind of how exactly:
Option 1: follow the AWS model and separate Lambdas from Lambda definitions. So that greengo.yaml
will have two separate sections: Lambdas
, where lambda functions defined in AWS Lambda, and LambdaDefinitions
, which refer to both Lambdas defined inside greengo, and outside, by name. This is ideologically similar to your proposal just semantically different.
Option 2: keep Lambdas in one section for simplicity (don't expose AWS dirty underwear) but offer to refer existing Lambda by ARN... and may be by name? The absense of handler
will indicate that the function is existing.
Lambdas:
- name: NewLambda
handler: function.handler
package: lambdas/NewLambda
alias: dev
# role: 'arn:aws:iam::000000000000:role/base_lambda_role' # Use an existing role instead of auto-created one
environment:
foo: bar
greengrassConfig:
MemorySize: 128000 # Kb, ask AWS why
Timeout: 10 # Sec
Pinned: True # Set True for long-lived functions
# the rest of AWS IoT function definition goes here
- name: my_existing_lambda # refer already created Lambda by a name
alias: dev
environment:
foo: bar
greengrassConfig:
MemorySize: 128000 # Kb, ask AWS why
Timeout: 10 # Sec
Pinned: True # Set True for long-lived functions
# the rest of AWS IoT function definition goes here
I am leaning towards option 2. Appreciate your input.
PS. I am just back on refactoring greengo
to v2 and want to incorporate ^ ^ into it.
PPS. Help appreciated :)
Hi Dimitri right in the thick of it with deployment of hardware at the moment. So are you going with option 2 ? My coding level isn't probably on par with yours but am happy to make some pull requests. Cheers
Note that this is not added by @QuinnCiccoretti and available in v1; will also be available in v2 when eventually merged.
Hi Dmitri, Loving you work and will be using greengo in our production devices. What do you feel about using existing lambdas, as I deploy and manage all my lambdas with serverless, being able to use existing lambdas would be helpful something like;
This way I could run
greengo create_fn_defn
and I could deploy my existing lambda