使用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개 답변
0

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

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

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

谢谢, -joe

profile picture
전문가
답변함 6달 전

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

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

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

관련 콘텐츠