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"
}
]
}
}
}
Out of curiosity if I am running greengrass in a container that reports the platform as linux amd64, what should the attribute strings os and architecture be?
linux
andamd64
Source: https://github.com/aws-greengrass/aws-greengrass-nucleus/blob/988385b5b04ffc827aedf577ed27741aaa4b43ea/src/main/java/com/aws/greengrass/config/PlatformResolver.java#L38-L51