https://pulumi.com logo
Title
c

curved-ice-93356

10/13/2022, 12:51 PM
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

millions-furniture-75402

10/13/2022, 2:25 PM
Have you validated that you can see the stack in https://app.pulumi.com ?
c

curved-ice-93356

10/13/2022, 2:27 PM
yes I have , I can see all the stacks in the web browser
m

millions-furniture-75402

10/13/2022, 2:29 PM
How are you listing stacks locally?
e

echoing-dinner-19531

10/13/2022, 2:29 PM
Have you tried
pulumi stack ls --all
?
m

millions-furniture-75402

10/13/2022, 2:29 PM
Also, you can verify that you're logged in with:
pulumi whoami
c

curved-ice-93356

10/13/2022, 2:30 PM
wow --all worked
I can run the refresh command then?
m

millions-furniture-75402

10/13/2022, 2:30 PM
You have to select the stack that you're trying to refresh
c

curved-ice-93356

10/13/2022, 2:32 PM
ow okay so something like
pulumi stack select <stackname>
pulumi refresh
?
m

millions-furniture-75402

10/13/2022, 2:32 PM
yes
c

curved-ice-93356

10/13/2022, 2:35 PM
getting
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

millions-furniture-75402

10/13/2022, 2:38 PM
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

curved-ice-93356

10/13/2022, 2:40 PM
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