Hey guys I am tring to refresh a stack that is hos...
# general
c
Hey guys I am tring to refresh a stack that is hosted in pulumi service using my cli. I keep logging in using
pulumi login
and then paste my Access token , but when I list the stacks nothing shows up. Even after doing this is a folder with a Pulumi.yaml file, I can't refresh my remote stack
m
Have you validated that you can see the stack in https://app.pulumi.com ?
c
yes I have , I can see all the stacks in the web browser
m
How are you listing stacks locally?
e
Have you tried
pulumi stack ls --all
?
m
Also, you can verify that you're logged in with:
pulumi whoami
c
wow --all worked
I can run the refresh command then?
m
You have to select the stack that you're trying to refresh
c
ow okay so something like
Copy code
pulumi stack select <stackname>
pulumi refresh
?
m
yes
c
getting
Copy code
C:\Users\User\Documents\repos\white-horse-webiny\lambdas>pulumi refresh
Previewing refresh (xolanimaphumulo/api/staging)

warning: A new version of Pulumi is available. To upgrade from version '3.35.3' to '3.42.0', visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.
error: [400] Bad Request: Cannot update stack "xolanimaphumulo/api/staging" because the project name from Pulumi.yaml ("lambdas") doesn't match the stack's project name of "api".
To rename the stack's project, run 'pulumi stack rename "xolanimaphumulo/lambdas/staging"'.
does this mean locally I need to have the same folders I have in pulumi service inorder to update them?
m
The directories locally are your "projects" (e.g. admin/api/website from your screenshots). The "stack" is "staging". You can have many "stacks" for 1 project. Project configuration is "Pulumi.yaml". Stack configuration is "Pulumi.<stackname>.yaml".
c
ow okay I understand , my problem is that I am trying to refresh a stack that is stored in pulumi not local. So I create a dummy Pulumi.yaml and folder because it kept forcing me to do so
okay I have made progress , I renamed the name to the one of the project in remote
I was able to refresh , Thanks