I am using kepware to collect data and send it to AWS greengrass IoT Core. I deploy my project with serverless and the plugin serverless-plugin-greengrass
. Here a part of my serverless file:
[...]
functions:
opcuaPubSub:
description: Lambda function for get data from kepware.
handler: src.opcua_pub_sub.handler
greengrass:
subscriptions:
- target: cloud
subject: topic/opcua
custom:
output:
file: stack.json
pythonRequirements:
usePipenv: true
greengrass:
autoDeploy: true
groupId: ${env:GROUP_ID}
defaults:
pinned: true
memorySize: 262144
encodingType: json
plugins:
- serverless-python-requirements
- serverless-stack-output
- serverless-pseudo-parameters
- serverless-plugin-greengrass
But I cann't remove the stack with serverless. When I run: serverless remove --stage xxx
I have the following error :
Greengrass: Execute reset for group id xxxxx-xxxx-xxxx-xxxx...
Serverless Error ---------------------------------------
That deployment type is not valid. Please specify one of the following types: {NewDeployment,Redeployment}.
I don't understand because 'serverless' is expecting NewDeployment or Redeployment, but what I would like is to remove the stack. I tried to reset deployement of the greengrass group before run: 'serverless remove...', with the command aws greengrass reset-deployments --group-id $GROUP_ID
but I obtain the same error. If I delete manually the stack in cloudformation console, it's work my group greengrass will be deleted.
(I run serverless remove --stage xxx when I want to change branch in gitlab-ci).
Someone knows why I can not remove this stack with serverless ?