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개 답변
1
수락된 답변

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
전문가
답변함 4달 전
profile pictureAWS
전문가
Greg_B
검토됨 4달 전
  • Thank you for your answer, I am indeed migrating from Greengrass V1 to V2.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠