https://pulumi.com logo
#getting-started
Title
# getting-started
t

thankful-planet-44055

08/02/2023, 3:48 AM
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

green-stone-37839

08/02/2023, 3:50 AM
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

clever-sunset-76585

08/02/2023, 4:28 AM
pulumi up
takes
--refresh
that will perform a refresh before an update. In fact, the
preview
and
destroy
commands also support that flag.
t

thankful-planet-44055

08/02/2023, 5:17 AM
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

clever-sunset-76585

08/03/2023, 4:29 AM
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

thankful-planet-44055

08/03/2023, 4:29 AM
Command line from shell.
c

clever-sunset-76585

08/03/2023, 4:33 AM
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.