使用JSON创建AWS CLI Greengrass v2 component報錯

0

【以下的问题经过翻译处理】 我正在使用AWS CLI将Lambda函数作为组件导入ggv2。 Lambda函数成功导入,但是当我部署到greengrass v2时,出现以下错误:

Error occurred while processing deployment. {deploymentId=********************, serviceName=DeploymentService, currentState=RUNNING}java.util.concurrent.ExecutionException: com.aws.greengrass.componentmanager.exceptions.NoAvailableComponentVersionException: No local or cloud component version satisfies the requirements. Check whether the version constraints conflict and that the component exists in your AWS account with a version that matches the version constraints. If the version constraints conflict, revise deployments to resolve the conflict. Component devmgmt.device.scheduler version constraints: thinggroup/dev-e01 requires =3.0.61. at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

版本已存在,因为已成功导入,但是这个程序包没有传输到Greengrass Core。如果我从AWS管理控制台导入lambda,则可以按预期工作。

以下是我的CLI json输入文件以及我运行的命令。 我错过了什么?

aws greengrassv2 create-component-version --cli-input-json file://lambda-import-worker.json

lambda-import-worker.json文件:

{
  "lambdaFunction": {
    "lambdaArn": "arn:aws:lambda:*******:***************:function:devmgmt-worker:319",
    "componentName": "devmgmt.device.scheduler",
    "componentVersion": "3.0.61",
    "componentPlatforms": [
      {
        "name": "Linux amd64",
        "attributes": { "os": "All", "platform": "All" }
      }
    ],
    "componentDependencies": {
     "aws.greengrass.TokenExchangeService":{
        "versionRequirement": ">=2.0.0 <3.0.0",
        "dependencyType": "HARD"
      },
      "aws.greengrass.LambdaLauncher": {
        "versionRequirement": ">=2.0.0 <3.0.0",
        "dependencyType": "HARD"
      },
      "
profile picture
专家
已提问 5 个月前10 查看次数
1 回答
0

【以下的回答经过翻译处理】 我怀疑这是因为你的componentPlatform部分不正确。用architecture替换platform。或者,由于所有平台默认都受支持,可以完全省略此部分。

"componentPlatforms": [
  {
    "name": "Linux amd64",
    "attributes": { "os": "*", "architecture": "*" }
  }
],

我已开通工单以澄清 documentation,并会看看我们在 Nucleus 上如何改进此错误消息。

谢谢, -joe

profile picture
专家
已回答 5 个月前

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

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

回答问题的准则