使用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"
      },
      "
1 Antwort
0

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

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

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

谢谢, -joe

profile picture
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen