just getting started with pulumi and pulumi cloud ...
# getting-started
i
just getting started with pulumi and pulumi cloud with my new job. Terraform cloud you could login to TF Cloud and do a
terraform plan
and have changes to local code uploaded and run in TFC as a plan. This required a local backend TF file to say "use cloud" as the backend/remote state and of course credentials. I have my Pulumi creds all sorted and can
pulumi stack
to get meta on the stacks in Pulumi cloud. But I'm wonder if there is an equivalent way to use Pulumi cloud state for a
pulumi preview
? I currently get
You do not have permission to perform this operation.
But I have successfully done
pulumi login
and the org name and everything seem correct.
l
...use Pulumi cloud state for a pulumi preview
There is no way to not do this. Your state is in one place only. If it is in the Pulumi service, then the Pulumi service's copy of the state is what will be using during the preview.
You do need to select or specify the correct state. When you're in the correct directory and do a
pulumi stack ls
, does it show an asterisk beside the expected stack? One whose state is stored in the Pulumi service?
i
pulumi stack ls
lists all the different env stacks. I'm actually trying to run
pulumi preview -s sbx
sbx being the stack.
pulumi stack ls
does not show any asterix. This is the line returned for the sbx stack
Copy code
sbx                      3 months ago  4               <https://app.pulumi.com/****/pulumi-aws-infra/sbx>
I guess what I'm really asking, is if the stack state is in Pulumi cloud, I make changes to the code. How can I compare/run this against an existing state.... or do I just have to integration test this in a whole new account or something.
Locally.
l
There's some words in there that can mean various things, so I don't know what question you're asking. I do want to check that you're working with the correct stack though. If you're just getting started, then how can the sbx stack date from 3 months ago? Is it somebody else's?
I'm trying to figure out why the stack is listed as just "sbx" when presumably it's in an organization. If it's in somebody else's personal account, then it's not going to work.
i
Sorry if I'm off on terms and such. This is my first pulumi experience. I obfuscated the org in `https://app.pulumi.com/****/pulumi-aws-infra/sbx`but it does show the proper organization name. We actually have 2 and one of the stacks in this repository, has a config key for the other pulumiOrg so it shows in that org. I did run
pulumi org set-default ***
to my default org name. Maybe this is why the list shows the NAME in
pulumi stack ls
as
sbx
instead of
org/sbx
?
I also have run
pluumi login
and auth'd to my org in Pulumi Cloud.
l
Yes. And that's likely part of the problem. That left column should show the organization name, I think. That said, I've never run
pulumi org set-default
(I predate that feature and never looked into it), so maybe what you've got is right. Let's see what we can find.
Can you try
pulumi stack select myorg/sbx
, replaing myorg with the actual org?
i
just a sec
l
You don't need to specify the project, but you can. You do need to be in the project directory though.
i
OK, that is progress.
ls
I do have a star next to the sbx stack now. Hmmm, this seems a bit like TF workspaces.
l
Orgs are a bit like workspaces, yes.
So can you run
pulumi preview
now? Without the
-s
?
i
Same permissions error, but I think I see the problem now. I assumed when my IT group fixed permissions to Pulumi Cloud, things were "fixed" because I could see all the stacks, env and deployments. I just went into this stack in the UI and tried the "action" menu and everything is greyed out. I'm guessing this is the root issue.
l
Ah, you may have a Business or Enterprise license and you're not in the right Team in the Pulumi app? This is possible.
i
I will check with my team and IT. I'm so very grateful for your help. Most of my team is off for the weekend or would have asked them some of these questions.
l
If you can see yourself listed at
<https://app.pulumi.com/myorg/members>
then I think you have all the permissions required to fix this yourself. If you can't, you'll probably need help from project or org admin.
(Edit that URL by hand 🙂 )
i
I do see myself in
/members
but no option to edit or view. In Teams I can see that I'm not a member in some of the teams I probably should be.
l
That might be important. Unfortunately I'm not able to advise more; all the orgs I'm an admin for are on lower license levels, so I can't see whatever controls might exist to fix this.
i
OK, think this is probably an IT thing, since we use SSO and they manage all that.
Going to hit IT up. Thanks so much again.