Hi, I’m working on two projects that use Pulumi an...
# general
m
Hi, I’m working on two projects that use Pulumi and
awsx.ecr.buildAndPushImage
is calling the wrong ECR repo (i.e. the failed push error log shows the wrong aws account ID)
b
@most-lighter-95902 what Docker registry are you logged in to?
Copy code
docker info | grep Registry
m
@billowy-army-68599
b
do you have any env vars set?
Copy code
env | grep -i AWS
m
Yes
AWS_ACCESS_KEY
and
AWS_SECRET_ACCESS_KEY
in
.env
I can confirm that they’re correct
And I’m not quite sure how to set the image explicitly
Are there any examples?
b
m
But when I run
Copy code
const repository = new awsx.ecr.Repository("app")
to create a repo, it’s also in the wrong account
Do you have any idea why it’s grabbing the wrong aws account even when the local .env file has the right aws account credentials (and
aws configure
also has the right account credentials)?
Is this a bug with Pulumi?
b
I would hazard a big guess that it's an issue locally, I've never seen this bug before. Not discounting that it's a bug, but it's very unlikely I'm assuming
aws sts get-caller-identity
from the CLI returns the correct account?
does your stack configuration have any
aws:
variables set?
m
Yes to both:
aws sts get-caller-identity
returns the correct account and I have one
aws:
variable (
aws:region
) set
Is there any way to debug this? I’m just not sure how to go about fixing this
Preferably I’d like to understand why this is happening - I would’ve assumed that Pulumi simply takes my local AWS credentials (from
aws configure
or .env) and uses that to authenticate for aws services like ecr?
Or is it doing something else underneath?
This is interesting - I deleted and created a new project and it works now
Is there anything that gets saved with projects other than the Pulumi.yaml files?
b
yes, the stack configuration:
Pulumi.stack.yaml
m
Right I mean other than the yaml files