aws-iot-builder-tools / aws-greengrass-provisioner

Simplifies provisioning Greengrass Cores and building Greengrass Lambda functions
Apache License 2.0
55 stars 15 forks source link

Errors in documentation for existingLambda.conf and existing Lambda env variable #637

Closed ValygarS closed 4 years ago

ValygarS commented 4 years ago

Greetings, noticed these errors while trying to deploy existing Lambda:

  1. In BasicTutorials.md: "Where the conf file existingLambda.conf contains the name of the existing Lambda functions". conf { functions = ["HelloWorldPython1:live","HelloWorldPython2:live"] }"

That is actually not a function name, but ARN. So writing function name there will give an error (that function deployment conf is missing), until you add a wildcard symbol ~ before name, or write full ARN url

  1. For deployment of existing Lambdas: https://github.com/awslabs/aws-greengrass-provisioner/blob/master/docs/ExistingLambdaEnvVar.md

According to docs, have to add env variable to existing Lambda in AWS:

"GGP_FUNCTION_CONF" = 
conf {
    ...
    functionName = "existingLambda1"
   ... 
}

If function name consists of several words connected by dash symbol (-), then deployment will return an error, until you put only the last word from function name.

Example: Existing AWS Lambda name: "test-group-myFunction".

"GGP_FUNCTION_CONF" = 
conf {
    ...
    functionName = "test-group-myFunction"
   ... 
}

Will return error code 400: [ERROR] AwsGreengrassProvisioner: The functions definition is invalid or corrupted. (ErrorDetails: [Invalid environment key name]) (Service: Greengrass, Status Code: 400 ... )

Need to rename to functionName = "myFunction" to deploy successfully

timmattison commented 4 years ago

Looking into this.

timmattison commented 4 years ago

You are correct. I fixed this but please reopen the issue if I missed something. Thanks for the feedback!