Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Auto activate "Automatically detect and override connection information" in a Group #7

Open
brettf opened this issue Oct 9, 2017 · 5 comments

Comments

@brettf
Copy link
Contributor

brettf commented Oct 9, 2017

The default behavior of an instantiated group should support auto-discovery of the Greengrass Core.
A command like this works:

aws greengrass create-function-definition-version \
--function-definition-id 4d941bc7-92a1-4f45-8d64-EXAMPLEf76c3 \
--functions '[{"FunctionArn":"arn:aws:lambda:::function:GGIPDetector:1","Id":"1","FunctionConfiguration":{"Pinned":true,"MemorySize":32768,"Timeout":3}}]' \
--region us-west-2

Essentially, use create-function-defintion-version and add arn:aws:lambda:::function:GGIPDetector:1 just like any other Lambda with the function configuration as shown above.

@ShaunEdiger
Copy link

ShaunEdiger commented Jan 26, 2018

Until this bug is fixed, is the command above the recommended workaround?

@brettf
Copy link
Contributor Author

brettf commented Sep 20, 2018

@ShaunEdiger -- yes.

@janborch
Copy link

janborch commented Sep 21, 2018

You can also create the definition and version in one go:

aws greengrass create-function-definition --cli-input-json '{
     "Name": "'"MyGroup_Function_Definition"'",
      "InitialVersion": {
     "Functions": [
    {
      "FunctionArn": "arn:aws:lambda:::function:GGIPDetector:1",
      "FunctionConfiguration": {
        "Environment": {},
        "MemorySize": 32768,
        "Pinned": true,
        "Timeout": 3
      },
      "Id": "'"$(uuidgen)"'""
    }]
    }

}'

@manu51188
Copy link

You can also create the definition and version in one go:

aws greengrass create-function-definition --cli-input-json '{
     "Name": "'"MyGroup_Function_Definition"'",
      "InitialVersion": {
     "Functions": [
    {
      "FunctionArn": "arn:aws:lambda:::function:GGIPDetector:1",
      "FunctionConfiguration": {
        "Environment": {},
        "MemorySize": 32768,
        "Pinned": true,
        "Timeout": 3
      },
      "Id": "'"$(uuidgen)"'""
    }]
    }

}'

I am this function to create lambda function for automatic IP detector in AWS Greengrass group. I need you small help in understanding what exactly is variable "$(uuidgen)" is pointing to ? can I simply reaplce this variable with Group id ?

Something like this : "Id": "'"5c128568-b756-49cf-9e33-0b7e845852bd"'""

Can you please let me know.

@manu51188
Copy link

I am using following command to create greengrass function

aws greengrass create-function-definition --cli-input-json '{

 "Name": "'"MyGroup_Function_Definition"'",
  "InitialVersion": {
 "Functions": [
{
  "FunctionArn": "arn:aws:lambda:::function:GGIPDetector:1",
  "FunctionConfiguration": {
    "Environment": {},
    "MemorySize": 32768,
    "Pinned": true,
    "Timeout": 3
  },
  "Id": "'"4"'"
}]
}

}'

Also, the function "arn:aws:lambda:::function:GGIPDetector:1" is already created in lambda just like
normal function.

But I couldn't able to see the above function added in my GreenGrass Group. What can be the problem ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants