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?

已提问 4 个月前161 查看次数
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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容