Skip to content

Commit

Permalink
Merge pull request #221 from nitrictech/feature/aws-clean-down
Browse files Browse the repository at this point in the history
fix: Don't dump results of down command aws
  • Loading branch information
HomelessDinosaur authored Oct 19, 2021
2 parents 3fbd6de + 1f04ea3 commit bdd9f9f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/plugins/aws/src/tasks/down/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ export class Down extends Task<void> {
program: NO_OP,
});

let res;
if (this.destroy) {
res = await pulumiStack.destroy({ onOutput: this.update.bind(this) });
await pulumiStack.destroy({ onOutput: this.update.bind(this) });
} else {
const deployment = (await pulumiStack.exportStack()).deployment as Deployment;
const nonTargets = protectedTargets //Possible to filter the protected targets in the future
Expand All @@ -83,15 +82,9 @@ export class Down extends Task<void> {
.filter((resource) => !resource.urn.match('/nitric:site:S3/g') || !nonTargets.includes(resource.type))
.map((resource) => resource.urn);
if (targets.length > 0) {
res = await pulumiStack.destroy({ onOutput: this.update.bind(this), target: targets });
await pulumiStack.destroy({ onOutput: this.update.bind(this), target: targets });
}
}
if (res.summary && res.summary.resourceChanges) {
const changes = Object.entries(res.summary.resourceChanges)
.map((entry) => entry.join(': '))
.join(', ');
this.update(changes);
}
} catch (e) {
console.log(e);
throw e;
Expand Down

0 comments on commit bdd9f9f

Please sign in to comment.