https://pulumi.com logo
#general
Title
# general
i

important-umbrella-97862

09/06/2023, 1:15 AM
I've started using CopyFile and had assumed there would be some mechanism to determine whether the file contents had changed since the last deploy (last modified time, content hash, etc.) and if so re-create the resource the next time I run "pulumi up" by re-copying the file, but that doesn't seem to be the case - changing the file contents and re-running "pulumi up" does not trigger the file to get re-copied. Is that the expected behavior? I've been getting around it by manually deleting the resource from the stack's state when a change is needed but it's definitely become a stumbling block while iterating on a deployment.
l

little-cartoon-10569

09/06/2023, 2:17 AM
Have you set the Triggers? You could set it to the hash of the file, would achieve what you want?
Or maybe the lastModifyDate, or whatever your file sdk provides.
m

melodic-tomato-39005

09/06/2023, 5:57 AM
Not a real fix but as a workaround, you might try
pulumi up
with “replace” to tell it to replace your file.
Copy code
--replace stringArray                   Specify a single resource URN to replace. Multiple resources can be specified using --replace urn1 --replace urn2. Wildcards (*, **) are also supported
i

important-umbrella-97862

09/07/2023, 12:22 AM
thank you both for the suggestions, that definitely helps