Could not find anything about it online, so I thou...
# general
l
Could not find anything about it online, so I thought of asking here: Assuming I create a resource via Pulumi code and while that code is still running, I found a reason to change an attribute of that resource. Is there any support for such a change? To clarify the need, it can look like this simplified example:
Copy code
const a = new Resource('name', {attributes...});
...more code...
a.attribute = 'another value';
l
No, not inside the same project. Pulumi is not imperative. When your code runs, no resources are created (immediately). Instead, Pulumi builds a state tree of resources and dependencies. Pulumi is declarative. Your Pulumi project declares what you want the resource to look like. So the Pulumi way to do what your example should would be
Copy code
const a = { attributes... };
... more code...
a.attribute = 'another value';
... more code ...
const r = new Resource('name', a);