Is there a way for pulumi to always do a refresh w...
# getting-started
t
Is there a way for pulumi to always do a refresh when doing an update? It’s not much extra time and avoids issues with drift….
g
Globally, there is not, however, you can set it on a project level in the
Pulumi.yaml
file. https://www.pulumi.com/docs/concepts/projects/project-file/#options-options
c
pulumi up
takes
--refresh
that will perform a refresh before an update. In fact, the
preview
and
destroy
commands also support that flag.
t
Thanks both of you. it works. Apparently it does two refreshes on
up
, one for the plan and one for the update.
Would love a way to avoid the refresh for the plan. That’s a good compromise between speed and safety. It’s no worse than the default of not refreshing … and it’s likely just as fast. Presumably anything it msises will be handled the same as if a change happened while the user was reviewing the plan
c
Are you running this in CI? If so, you might be better off running
refresh
in its own step before you run an
up
. Might be slightly faster that way.
t
Command line from shell.
c
Ah ok. Not a whole lot of options then and running it implicitly is probably better so you are not having to run multiple commands during your dev loop.