do tools exist to scan your cloud, compare that to...
# general
h
do tools exist to scan your cloud, compare that to your pulumi state, and report any unmanaged resources?
f
Not that I know of, but that would be pretty cool 👀 I'm certain a hacky version could be done, likely wrapping azcli, since it can output in json. If this tool could be taught to modify pulumi state, then we'd have auto-importing, and that would be super cool.
Codegen to reflect the imported stuff would be the next step after that, but codegen sounds hard
h
yeah.... i wouldn't trust codegen for this
i just mean for auditing/alerting, and then people can figure out if it needs to be imported, cleaned up, or excluded
m
I could envision a basic solution that leverages the cloud CLIs to generate a list of ARNs and similarly get the ARNs from pulumi state and diff the collections. You can probably get ChatGPT to stub out the basics for you even.
h
i really don't need help stubbing. if anything, i need help identifying the weird edge cases (like azure virtual disks should not be included unless they're not attached) or designing the exceptions system (eg, allow excluding entire resource groups instead of just specific resource)
m
Sounds like you need policies somewhere. Pulumi offers Policy as Code that can help with that, or cloud native solutions, or OPA and the like.
h
maybe, but shit happens, so a system to identify the weirdness would still be useful
like, azure has like 50 ways to implicitly make additional resources, and then they don't conform to the policies that compliance engines are looking for, and it's a whole thing
m
yikes