AWS CLI greengrass v2 create-deployment using JSON to import lambda not importing lambda artifact
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"
}
]
}
}
}
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
Relevant questions
AWS CLI greengrass v2 create-deployment using JSON to import lambda not importing lambda artifact
Accepted Answerasked 21 days agoWhen to use AWS CLI versus AWS SAM CLI for Lambda function deployment
asked 3 years agoDoes Greengrass V2 support Javascript ES6?
Accepted Answerasked 4 days agoNode.js: module not found using ES import with Lambda layers
Accepted Answerasked 15 days agoHow to trigger Lambdas from outside the GG environment, for testing purpose
Accepted Answerasked a year agocom.aws.greengrass.lambdamanager.StatusTimeoutException mysterious lambda error
asked 3 months agoGreengrass v2 interact with shadows from a nodejs lambda
Accepted Answerasked 20 days agopermission denied if i deploy via management console as a lambda func
asked a year agoPublish to iot core from an imported lambda using greengrassv2
asked a year agoImport Contact Flow via CLI or UI
asked a year ago
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?