I use existing user pool triggers like this.
my_func: handler: handler.my_func events: - cognitoUserPool: pool: testpool trigger: PostAuthentication existing: true ...
However, when I remove one of them and deploy the process fails.
The error messages are
Failed to delete resource. User: arn:aws:sts::****:assumed-role/prjectname-IamRoleCustomResourcesLambdaEx-*****/prjectname-custom-resource-existing-cup is not authorized to perform: lambda:RemovePermission on resource
The version is 1.50.0
Probably some setting of iam is not enough.
Can this be solved by my definition in serverless.yml?
Please kindly advise.