This message was deleted.
# general
s
This message was deleted.
l
and I get this error:
l
Pulumi is only declarative. You cannot change things: you can only declare what they must look like. If you want to update a resource, you must define that entire resource. Since you want to continue to manage that resource outside of Pulumi, you cannot use Pulumi to update it. You can update it in a Pulumi program though, using the normal SDK of whatever provider (AWS, Azure, ...) the resource is in.
s
so a dynamic provider would be the only interoperable choice in this case? https://www.pulumi.com/docs/concepts/resources/dynamic-providers/ never understood the
pulumi import
workflow, how would that differ?
l
No. You could manage the resource in Pulumi. Or you could update the resource via its normal SDK. You should almost certainly not try to get Pulumi to update an unmanaged resource.
s
gotcha, I missed the "normal" in your previous comment, and took it to mean "use the sdk in pulumi" if, for whatever reason, the normal sdk was used to update state outside pulumi, would a
pulumi refresh
be helpful here to resolve drift?
l
No. Since you're using the SDK directly, that bit of code is imperative, not declarative. You can use the Pulumi get functions where needed, and they also aren't affected by
pulumi refresh
.
You probably want to put the bit of code that calls the SDK into an apply() so that it happens at the right time, and you probably want to put in some sort of guard so that it doesn't happen if not needed.
👍 1
And if you happen to be using automation-api, you may want to consider putting the code outside of your Pulumi projects entirely, and putting it directly into your automation-api code instead.