https://pulumi.com logo
#general
Title
# general
m

most-napkin-55076

11/23/2023, 1:04 PM
Hello there. I'm come across an issue with a specific case of running Pulumi during CI, and I hope anyone could point me in a direction. So, the setting is that I'm trying to run some CI process for a new stack, which is initalized, but not 'upped', on a feature branch. All the IAC and configs/stack-files are all present in the code base. Then I'm running the command
pulumi config get <config-name> --stack ${{ inputs.stack-environment }} --cwd $PROJECT_ROOT
during a pull request workflow on Github, but it returns and error that the stack name wasn't found. If I run the same command locally, also without running
up
first, it properly fetches the config from my stack file. Does anyone knows why this is and possibly
l

little-cartoon-10569

11/23/2023, 8:23 PM
Is it a local stack? If you're not logged into Pulumi then it'll be a local stack; your CI won't have access to it. Maybe you need to set up the Pulumi app key, or run
pulumi login
? When you say "All the stack-files are present in the code base", do you mean the Pulumi.<stackName>.yaml file? That's not the stack file; the stack file will be in the Pulumi app, S3, or something like that.
m

most-napkin-55076

11/24/2023, 1:01 PM
So yea, was referring to the YAML file, the configuration. We provide a pulumi auth key to the pipeline, so it should have access to whatever is present in Pulumi cloud, no?
l

little-cartoon-10569

11/26/2023, 7:29 PM
If it can't find the stack, then the name you're passing to
--stack
doesn't match the name in the Pulumi app. The config files aren't relevant for that error. Maybe there's a missing quote, or a missing org name, or something? You'll have to debug the invocation, Maybe you could put
pulumi stack ls
in your CI pipeline / workflow, just before the command that isn't working, to see what stacks exist. Perhaps the stack exists but isn't available to the user that owns the auth key that the pipeline is using?
m

most-napkin-55076

11/27/2023, 6:55 AM
Alright, so I realised I had indeed missed something. We had planned earlier that we wanted automatic access to new stacks for the CI token, which I thought had been implemented, but it hadn't, so obviously it didn't have access. So yeah, I think for now all is good :D
2 Views