-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move pulumi interactions out of top-level example #407
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -24,7 +25,7 @@ | |||
"eslint": "^8.21.0", | |||
"eslint-config-oclif": "^4", | |||
"eslint-config-oclif-typescript": "^1.0.2", | |||
"globby": "^13", | |||
"globby": "^11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was weird. I was getting an error with the ES6 import styles between oclif and globby. Had to downgrade to fix. Known issue with globby.
Error:
(node:84782) [ERR_REQUIRE_ESM] Error Plugin: @theniledev/events-example [ERR_REQUIRE_ESM]: require() of ES Module /Users/sdelamater/work/nile-js/packages/events-example/node_modules/globby/index.js from /Users/sdelamater/work/nile-js/node_modules/@oclif/core/lib/config/plugin.js not supported.
Instead change the require of index.js in /Users/sdelamater/work/nile-js/node_modules/@oclif/core/lib/config/plugin.js to a dynamic import() which is available in all CommonJS modules.
module: @oclif/core@1.13.0
If you're up for it, it would also be great to refactor |
// destroy any stacks that shouldnt exist | ||
for (const id of Object.keys(stacks)) { | ||
if (!instances[id]) { | ||
this.destroyStack(id); | ||
this.deployment.destroyStack(id); | ||
} | ||
} | ||
|
||
// create any stacks that should exist | ||
for (const id of Object.keys(instances)) { | ||
if (!stacks[id]) { | ||
this.createStack(instances[id]); | ||
this.deployment.createStack(instances[id]); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@norwood - I'm seeing some inconsistencies with instances that get created then deleted before running this script. Still debugging synchronization issues.
acc[instance.id] = instance; | ||
} | ||
if (flags.statusCheckOnly) { | ||
console.log({ stacks, instances }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this.debug
is more accurate. Also I think linting doesn't like this? or at least it shouldn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this leaked in from local debugging. I'll remove it.
@scottydawg suggestion: instead of asking "is it more demoable?" (we won't know until we try), why not record yourself demoing this to an imaginary engineer? |
Some basic refactor and renaming things in the events example. This moves most of the pulumi-specific code out into a
PulumiAwsDeployment
object that any curious parties can drill down into, but abstracts it away for those that mostly care about reconciling with Nile. @sriramsub – is that more demo'able?This also starts toward a path that could be a little more cloud-agnostic. (Or one that's not so tightly coupled to Pulumi, at least.)