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

most-lighter-95902

12/30/2021, 11:26 PM
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

billowy-army-68599

12/30/2021, 11:54 PM
@most-lighter-95902 what Docker registry are you logged in to?
Copy code
docker info | grep Registry
m

most-lighter-95902

12/30/2021, 11:54 PM
@billowy-army-68599
b

billowy-army-68599

12/30/2021, 11:55 PM
do you have any env vars set?
Copy code
env | grep -i AWS
m

most-lighter-95902

12/30/2021, 11:56 PM
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

billowy-army-68599

12/30/2021, 11:59 PM
m

most-lighter-95902

12/31/2021, 12:00 AM
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

billowy-army-68599

12/31/2021, 12:21 AM
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

most-lighter-95902

12/31/2021, 12:54 AM
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

billowy-army-68599

12/31/2021, 4:05 AM
yes, the stack configuration:
Pulumi.stack.yaml
m

most-lighter-95902

12/31/2021, 5:24 PM
Right I mean other than the yaml files
6 Views