Can someone explain to me a core difference betwee...
# general
m
Can someone explain to me a core difference between pulumi and terraform If I understand correctly
terraform apply
by default refreshes resources. So what's the point of having a state if you refresh all the time, you may ask - because it refreshes only the resources that were picked up by the diff between the configuration (hcl) and the state, so should be fast + refresh only whats needed. On the other hand, pulumi does not refresh by default when running
pulumi up
- and when doing
pulumi up -r
this will refresh all the resources in the state. So effectively this means when Pulumi is using providers such as
pulumi-gcp
, which are based on
terraform-google-cloud
- you see unique to pulumi errors that do not happen in terraform - for example GCP SQL instance resource on terraform has correct diskSize (when auto resize is on) / settingsVersion - while pulumi fails on regular
up
because it does not refresh and the googleapis are not receiving the right values, which is only fixable by running a full refresh on the entire stack. Is this true?
f
I agree with your opinion.
I think when
pulumi up
Command run, pulumi checks the change in .yaml and refreshes the resource only changed in .yaml.
s
Yea, using the --target flag on pulumi refresh can help you specify which resources should be refreshed so you can avoid refreshing the whole stack https://www.pulumi.com/docs/iac/cli/commands/pulumi_refresh/. If you want to avoid overwriting changes to your resources with whatever's in the program, you can also use the ignoreChanges setting to configure which properties should be ignored https://www.pulumi.com/docs/iac/concepts/options/ignorechanges/