At some point, we may change the Token used by Pulumi in the system environment.

When we change the Token, you will notice that the stack of the current project using the command ‘pulumi stack ls’ is always accessing the old stack.

Causes and solutions

This is because the pulumi gets the Token from the system environment variable the first time it runs.

You won’t get the Token again in subsequent runs, and pulumi caches your Token.

The file name of the cache is called credentials. Json, and if you installed Pulumi manually, this file is just below the path where you installed it.

The contents of the file are shown in the following figure.

You can see that Pulumi’s token information is stored on it.

If you want Pulumi to retrieve the TOKEN data from the environment variable, you just need to manually delete the file.

Jenkins

If you’re using a CI tool like Jenkins.

The file path is: / var/lib/Jenkins /. Pulumi/credentials. Json

You need to delete this file to have the compiler reload the Token.

https://www.ossez.com/t/pulum…