By using AWS re:Post, you agree to the Terms of Use
/AWS CLI greengrass v2 create-deployment using JSON to import lambda not importing lambda artifact/

AWS CLI greengrass v2 create-deployment using JSON to import lambda not importing lambda artifact

0

I am importing lambdas as components for ggv2 using the AWS CLI. The lambdas import successfully but when I deploy to greengrass v2 I get the following error:

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)

The version exists as it was imported successfully but the artifact is not transferred to the Greengrass Core. If I import the lambda from the AWS Management Console then it works as expected.

Here is my CLI json input file and the command I am running. What am I missing?

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

lambda-import-worker.json file:

{
  "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"
      },
      "aws.greengrass.LambdaRuntimes": {
        "versionRequirement": ">=2.0.0 <3.0.0",
        "dependencyType": "SOFT"
      }
    },
    "componentLambdaParameters": {
      "maxQueueSize": 1000,
      "maxInstancesCount": 100,
      "maxIdleTimeInSeconds": 120,
      "timeoutInSeconds": 60,
      "statusTimeoutInSeconds": 60,
      "pinned": true,
      "inputPayloadEncodingType": "json",
      "environmentVariables": {},
      "execArgs": [],
      "linuxProcessParams": {
        "isolationMode": "NoContainer"
      },
      "eventSources": [
        {
          "topic": "device/notice",
          "type": "PUB_SUB"
        },
        {
          "topic": "$aws/things/thingnameManager/shadow/name/ops/update/accepted",
          "type": "IOT_CORE"
        },
        {
          "topic": "dev/device",
          "type": "IOT_CORE"
        }
      ]
    }
  }
}
1 Answers
1
Accepted Answer

I suspect this is failing because your componentPlatform section is incorrect. Replace platform with architecture. Or, since all platforms are supported by default, omit this section entirely.

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

I've opened a ticket to get this clarified in the documentation and will see what we can do about improving this error message in Nucleus.

Thanks, -joe

answered 21 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions