Does CopyFile detect changes in a local file to initiate a replacement on the remote machine?
./make-keys.sh
pulumi stack init repro
pulumi stack select repro
./configure-keys.sh
pulumi up --yes
pulumi stack output observe_stdout # "Hello"
echo "World" > example.txt
pulumi up --yes
# Resources: 7 unchanged?
pulumi stack output observe_stdout # "Hello" ?
It appears that editing the file locally does not trigger a replacement by default.
It is possible to make the example work as expected using triggers
:
triggers=[contents('example.txt')]
Using contents of the file here, but a hash would do also.
But this feels a little surprising and something that needs to be documented in examples to the user.
Consider making file hash a default implicit trigger for CopyFile?
Also, is it possible for replacements to cascade in Pulumi via depends_on, so that Command that depends_on a CopyFile will replace itself once the CopyFile is replaced, or this is convtroversial?