Is there any way to check for the presence of an e...
# kubernetes
h
Is there any way to check for the presence of an externally created resource (e.g. CRD such as ServiceMonitor) to conditionally create one?
l
Pulumi doesn't have a concept of "conditionally create". That's not declarative. How would the "does this thing exist" logic be able to tell the difference between a managed and unmanaged resource? You limit "does this thing exist" queries to unmanaged resources only. If you want to manage a resource at any point in the future, then you must simply declare it. If there's any real-life gotchas around that, you should handle those outside of Pulumi code. Manually import the resource and make it managed.