Hello, I'm new to pulumi and have recently joined ...
# golang
a
Hello, I'm new to pulumi and have recently joined a team that inherited a golang based pulumi project. I have noticed when I run pulumi up on some of our stacks that I see something similar to,
Copy code
pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:pragmastudios_core::pragma::pulumi:pulumi:Stack::pragma-pragmastudios_core]
             ~ auth0:index/client:Client: (update)
                [id=SCMlz7xZ8whdkZfyo2kamew02xBhXYRj]
                [urn=urn:pulumi:pragmastudios_core::pragma::pragma:Core$pragma:auth0$auth0:index/client:Client::grafana]
                [provider=urn:pulumi:pragmastudios_core::pragma::pulumi:providers:auth0::auth0::86192f53-d588-41f4-bbda-bfab6e65d7ef]
              - crossOriginAuth: true
whereas if I do a pulumi refresh on this same stack it's the opposite,
Copy code
pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:pragmastudios_core::pragma::pulumi:pulumi:Stack::pragma-pragmastudios_core]
            ~ auth0:index/client:Client: (update)
                [id=SCMlz7xZ8whdkZfyo2kamew02xBhXYRj]
                [urn=urn:pulumi:pragmastudios_core::pragma::pragma:Core$pragma:auth0$auth0:index/client:Client::grafana]
                [provider=urn:pulumi:pragmastudios_core::pragma::pulumi:providers:auth0::auth0::86192f53-d588-41f4-bbda-bfab6e65d7ef]
              + crossOriginAuth: true
Is this because some state isn't being saved correctly? Also let me know if I should have posted in a different channel. Our pulumi app is all written in Go so that's why I posted here.
p
I think this is expected behavior when someone makes a manual changes on these resources, so this is kind of how pulumi reacts, you should run pulumi refresh and let pulumi to check the latest status of these resource at provider
a
pulumi refresh
shows the
+ crossOriginAuth: true
and then
pulumi up
shows the
- crossOriginAuth: true
and then
pulumi refresh
shows the
+ crossOriginAuth: true
etc. It happens over and over with no one is doing anything to the stack manually or changing anything. Or you are saying I should always combine
pulumi up
with
refresh
?
p
Actually, I think it's just about how you read,
pulumi refresh
says that someone made this change
+ crossOriginAuth: true
and if you don't add it to your codebase
pulumi up
will say: hey, you have this change configured at your resource however I don't see it in my configuration so I will delete it
- crossOriginAuth: true
I'm kind of new to pulumi as well, read the docs and this is my best guess, but I'm open to any ideas
For the second question, it depends on the change type and resource type, I think this link is going to answer when you need to use refresh, and when not
• Out of Band Changes • Terminating Pulumi Mid-Operation these are the two use case that you will need to use pulumi refresh
a
Thanks! I will take a look at these docs.