When removing an Sql resource, the rollback does not work. It throws an error:
Received response status [FAILED] from custom resource. Message returned: Cannot read properties of undefined (reading 'Rollback
')
Steps to Reproduce
Steps to reproduce the behavior:
Give a role permissions
new Sql(scope, 'some-new-role', {
statement: `ALTER ROLE some_new_role CREATEDB`,
rollback: `ALTER ROLE some_new_role NOCREATEDB`,
// other props in SqlProps
})
Deploy it. Once deployed, comment out the above and deploy again.
Expected Behavior
The rollback SQL should be run correctly.
Actual Behavior
Cannot read properties of undefined (reading 'Rollback') error is thrown by the Custom Resource
Environment
Please complete the following information:
OS: MacOS
aws-cdk-lib version:2.144.0
cdk-rds-sql version 2.4.3
Additional Context
The problem was introduced in #24. A second argument is defined that I do not believe should be there.
src/handler.ts
Bug Report
Description
When removing an
Sql
resource, the rollback does not work. It throws an error:Steps to Reproduce
Steps to reproduce the behavior: Give a role permissions
Deploy it. Once deployed, comment out the above and deploy again.
Expected Behavior
The rollback SQL should be run correctly.
Actual Behavior
Cannot read properties of undefined (reading 'Rollback')
error is thrown by the Custom ResourceEnvironment
Please complete the following information:
aws-cdk-lib
version:2.144.0
cdk-rds-sql
version2.4.3
Additional Context
The problem was introduced in #24. A second argument is defined that I do not believe should be there. src/handler.ts
i.e.
should be
I have verified this is the issue in my own fork of this lib. This change fixes the error above