claudia destroy ignores --profile
See original GitHub issue- Expected behaviour:
I would assume that claudia destroy --profile private
will cleanup all changes introduced by Claudia. This in my case includes removing Lambda function, all installed notification handlers, role and policies.
- What actually happens:
Unfortunately it’s failing, because the --profile
part seems to be ignored on https://github.com/claudiajs/claudia/blob/master/src/commands/destroy.js#L30 level and default
profile is used. Which leads to situation where Lambda is properly removed, but roles and policies remain intact. I believe that there is also no code for notification handler/s removal.
AWS_PROFILE=private claudia destroy
seems to be temporary workaround for that issue.
- Link to a minimal, executable project that demonstrates the problem:
Any project where different AWS profile than default
is in use. I’m trying to use Claudia here: https://github.com/secretescapes/aws-lambda-image/tree/claudia-to-rule-them-all.
- Steps to install the project:
Clone that branch and replace private
profile (in the package.json
) with one that should be used. Be sure that default
profile is invalid or to restrictive to allow Claudia to work properly.
Then just run npm run create
.
- Steps to reproduce the problem:
npm destroy
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
the most likely cause is this line https://github.com/claudiajs/claudia/blob/c3b837d5f4537483e4d7f2e89d29e4ca7751d370/src/util/destroy-role.js#L2 where IAM is initialised during module load instead of when the function is called. I should be able to patch and retest this soon.
this is now on NPM as 2.8.0