CLI to create-component-version in greengrassv2 for a lambda function uses a different format than the component recipe format

0

I'm using the CLI to create a component version as follows: aws greengrassv2 create-component-version --cli-input-json fileb://lambda-function-component.json

The json recipe looks like this:

{
  "lambdaFunction": {
    "lambdaArn": "arn:aws:lambda:ABC:DEF:function:greengrass-v2-middleware:17",
    "componentName": "GHI",
    "componentVersion": "1.0.12",
    "componentDependencies": {
      "aws.greengrass.SecretManager": {
        "versionRequirement": "2.1.7",
        "dependencyType": "HARD"
      },
      "aws.greengrass.ShadowManager": {
        "versionRequirement": "2.3.5",
        "dependencyType": "HARD"
      }
    },
    "componentLambdaParameters": {
      "pinned": true,
      "statusTimeoutInSeconds": 300,
      "timeoutInSeconds": 120,
      "inputPayloadEncodingType": "json",
      "linuxProcessParams": {
        "isolationMode": "NoContainer"
      }
    }
  }
}

The recipe format for CLI is different than the recipe format described in the documentation.

I would like to include things like DefaultConfiguration for my lambda. More precisely I would like to include accessControl details since including it in the deployment is not particularly friendly. Is that possible via CLI? If not, how can I achieve that?

1 Answer
1
Accepted Answer

Hello,

Thank you for your interest in Greengrass. Lambdas are a different type of component than native Greengrass v2 components, they have different feature sets. Lambda does not allow you to set any default component configuration; you must set the configuration in a deployment instead.

I recommend that you use non-lambda components unless you are migrating lambdas from Greengrass V1 to V2. I recommend you use the Greengrass Development Kit to create native components which you can follow here: https://docs.aws.amazon.com/greengrass/v2/developerguide/create-components.html#create-component-gdk-cli.

Cheers,

Michael

AWS
EXPERT
answered 4 months ago
profile pictureAWS
EXPERT
Greg_B
reviewed 4 months ago
  • Thank you for your answer, I am indeed migrating from Greengrass V1 to V2.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions