awslabs / aws-bootstrap-kit

Apache License 2.0
104 stars 22 forks source link

fix rollback of stack if email validation fail #19

Closed flochaz closed 3 years ago

flochaz commented 3 years ago

Description

When email chosen does is mistyped or does not support address alias, the Email Validation step will fail and the stack will rollback. Currently rollback will fail with the following issue: The following resource(s) failed to delete [EmailValidationEmailValidateResourceXXXXXXX].

This PR fix deletion of EmailValidationEmailValidateResource.

Test

cd source/aws-bootstrap-kit/ && npm run build && npm run js-package  && cd ../../integTests/validateEmailTest && rm -rf node_modules package-lock.json && npm install &&  npm run build && npm run cdk deploy -- --profile dev

...
 ❌  ValidateEmailTestStack failed: Error: The stack named ValidateEmailTestStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE

ROLLBACK_COMPLETE is the state we want to reach in case of email validation failing.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.