-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulumi refresh uses cached auth info #199
Comments
Yeah it sounds like something similar is happening here. Is your program explicitly passing credentials to the AWS provider? |
In the expired STS token case, no. In the aws:profile case, also no, but IIRC in that case the error was with a manually constructed kubernetes provider - I wasn't passing the AWS creds in manually, but I did see the AWS_PROFILE getting removed from some blob in the k8s provider when I ran pulumi up. I think they could be separate issues |
Interesting. Typically what we've seen in scenarios like this is encrypted credentials ending up in the statefile that then get reused by |
A little more context here, this issue is caused by the fact that There's an open issue to document this for GCP - pulumi/pulumi-gcp#1815 |
@komalali in our case, this is an AWS ECR that's having this issue, and the env doesn't have exported env vars:
Does your comment suggest there's a bug in the pulumi-aws repo as well (in that it's caching the STS token in state?) |
Entries in the Pulumi config get stored in state.
These should be environmental variables. |
Environment variables are not a sufficient solution either, at least not for AWS. |
This problem has deep roots in the programming model, and I want to offer some context for the behavior. There are three kinds of Pulumi operations:
The first operation is distinctly different from the latter two in that it involves running the Pulumi program associated with the stack's project. As it runs, the Pulumi program defines the desired state for resources--including provider resources--using values computed by the program in coordination with the Pulumi engine. When the program creates a provider resource, the inputs for the provider are either sourced from the program itself (i.e. from values provided by the program) or are read out-of-band by the provider plugin. The exact set of configuration that may be sourced from the environment is particular to each provider--for example, the Kubernetes provider uses the ambient For example, consider the following program: import * as aws from "@pulumi/aws";
const usEast1 = new aws.Provider("us-east-1", { region: "us-east-1" });
const defaultRegion = new aws.Provider("default-region"); The Because The clearest/most complete solution here is to run the Pulumi program associated with a stack's project as part of |
Closing this as a duplicate of pulumi/pulumi#4981. We'll use that issue to track further progress on workarounds and solutions for the core problem. |
For anyone looking, here is an example of an environment based on ENV variables:
|
What happened?
When trying to run
pulumi refresh
on a stack using an ESC env, I was getting this error:This was confusing because
esc run <env> -- aws sts get-caller-identity
worked fine. Eventually I tried runningpulumi up
and the error went away, leading me to believe it busted some cache of an auth token.A similar thing happened to me previously, not with expired creds but with changing my AWS configuration. I switched from having a hardcoded
aws:profile
in the config to using an ESC env, and the refresh wouldn't succeed until I ranpulumi up
.Example
I believe this should repro it but haven't tried myself
pulumi up
pulumi refresh
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: