https://pulumi.com logo
Title
s

square-laptop-45713

01/22/2023, 5:01 PM
Looking for some clarity on the
pulumi refresh
command as I just ran it and it seemingly removed a resource that was manually added for troubleshooting purposes. From the documentation here it states:
Any such changes are adopted into the current stack.
It’s not clear if this is referring to the “current stack” as just the state held within Pulumi’s state management OR if “current stack” means the actual resources in the Cloud Provider
b

billowy-army-68599

01/22/2023, 5:04 PM
pulumi refresh
will reconcile the state of your code, the state of your cloud provider and the state of your Pulumi state. If you added a resource manually and didn't add it to your code and state, it will indeed be removed
you should import this resource into your state and code before running refresh
s

square-laptop-45713

01/22/2023, 5:06 PM
that should be more clear imho
thanks @billowy-army-68599 is there a command that will simply update the state of my stack within Pulumi only? a one-way sync? The reason I ask is that to handle drift, I’d like to have a one-way sync first and then apply and update via
pulumi up
to get it back inline. This is what I’ve been doing and how I’ve assumed Pulumi was operating.
I came to Pulumi from TF so that’s why I was thinking in that way
b

billowy-army-68599

01/22/2023, 5:09 PM
that's
pulumi import
TF doesn't operate that way either. If you manually add a resource that's not in state it just gets ignored
s

square-laptop-45713

01/22/2023, 5:10 PM
that’s easily confusing - there should be some cross referencing between those 2 commands
b

billowy-army-68599

01/22/2023, 5:10 PM
what's not clear is:
I just ran it and it seemingly removed a resource that was manually added for troubleshooting purposes
what resource was it that got removed?
s

square-laptop-45713

01/22/2023, 5:10 PM
TF refresh only updates it’s own managed state and does not make changes to the infrastructure
the resource is a target group manually added to an ALB since we’re having ingress issues
b

billowy-army-68599

01/22/2023, 5:11 PM
okay I think i misunderstood your initial point, did you add a completely new target group and Pulumi removed that? or did you modify an existing target group?
s

square-laptop-45713

01/22/2023, 5:12 PM
completely new target group
b

billowy-army-68599

01/22/2023, 5:12 PM
okay Pulumi shouldn't have removed that.
Can you check cloudtrail and if that happened, please file a bug
also, do you have the result of the refresh?
s

square-laptop-45713

01/22/2023, 5:14 PM
sure - how do you want me to share the results of refresh?
unfortunately we don’t have CloudTrail enabled 😞
b

billowy-army-68599

01/22/2023, 5:14 PM
you can DM me
s

square-laptop-45713

01/22/2023, 5:15 PM
sent
I’m verifying whether it was a new target group or not. I assumed since that what my teammate did last time when troubleshooting. Part of the confusion is that we’re both troubleshooting and I didn’t know he was online doing anything so I ran the refresh
confirmed it the TG was manually added a new one
b

billowy-army-68599

01/22/2023, 6:22 PM
just to follow up from DMs, the ALB ingress controller is the manager of some Kubernetes ingress objects which is likely the culprit