I tried to remove Greengrass version lambda from Greengrass, it complains me with,
We cannot deploy because the group definition is invalid or corrupted for the following reasons: {ErrorSet(errorSet=[ErrorModel(errorCode=REFERENTIAL_INTEGRITY_ERROR, errorMsg=Source arn:aws:lambda:us-east-1:xxx:function:xxx:2 does not exist in group)])}
"Source arn:aws:lambda:us-east-1:xxx:function:xxx:2 does not exist in group"
I understand we need to use ALIAS instead of version, but if that is the case AWS IOT should not allow that.
Updated the code, added the new version and I could not remove the old version.
I had a similar error message when trying to replace a Lambda function. In the end the problem was the subscription referring to that function. Try removing any subscription having source or target as the lambda that causes problems.