https://pulumi.com logo
#aws
Title
# aws
c

clean-art-60451

03/03/2024, 12:19 AM
Hi - I am trying to move to Pulumi from AWS CDK. I have been trying to automate connecting to S3 Backend from pulumi/pulumi-go docker image. So far wasted 2 full days and unsuccessful. Could not find documentation. Basically, I cannot do a pulumi login to S3 inside pulumi-go docker image - This fails with user not found message. Pls help
m

miniature-musician-31262

03/03/2024, 10:19 PM
Can you share some of the text of the message you’re seeing? Is it from S3, Pulumi, something else? I’ll see if I can repro in the meantime.
c

clean-art-60451

03/03/2024, 11:09 PM
Hi @miniature-musician-31262 - thanks for your response. linux user is missing in pulumi-go docker image and also this is deployed on EKS, Error is from Pulumi, Could not get luser
trying out with linux user now
m

miniature-musician-31262

03/03/2024, 11:12 PM
Ok. Just to confirm, are you using https://hub.docker.com/r/pulumi/pulumi?
c

clean-art-60451

03/03/2024, 11:12 PM
pulumi/pulumi-go docker image
m

miniature-musician-31262

03/03/2024, 11:20 PM
Hm, so S3 login seems to work for me locally with pulumi/pulumi-go when I'm logged in as
root
(in the container) -- this is on a newly downloaded image and new container under Docker for Mac:
Copy code
# Pasted from the README:
$ docker run -it \
    -e PULUMI_ACCESS_TOKEN \
    -e AWS_ACCESS_KEY_ID \
    -e AWS_SECRET_ACCESS_KEY \
    -e AWS_REGION \
    -w /app \
    -v $(pwd):/app \
    --entrypoint bash \
    pulumi/pulumi-go

root@d961dd418acc:/app# pulumi login <s3://cnunciato-pulumi-s3-login-test>
Logged in to d961dd418acc as root (<s3://cnunciato-pulumi-s3-login-test>)

root@d961dd418acc:/app/aws-go# pulumi new aws-go
This command will walk you through creating a new Pulumi project.

Enter a value or leave blank to accept the (default), and press <ENTER>.
Press ^C at any time to quit.

project name (aws-go):
project description (A minimal AWS Go Pulumi program):
Created project 'aws-go'
What's different for you?
c

clean-art-60451

03/03/2024, 11:21 PM
I do not have PULUMI_ACCESS_TOKEN
as I am using S3 backend
m

miniature-musician-31262

03/03/2024, 11:22 PM
Ah, let me see if it's different without that (I just happened to have one on my env)
c

clean-art-60451

03/03/2024, 11:22 PM
ok
m

miniature-musician-31262

03/03/2024, 11:24 PM
So unsetting
PULUMI_ACCESS_TOKEN
and starting a new container, it still works. Lemme try not even passing in that variable with
-e
.
c

clean-art-60451

03/03/2024, 11:24 PM
ok
what other env vars do you have in your container?
m

miniature-musician-31262

03/03/2024, 11:33 PM
Yeah that still works, too:
Copy code
$ docker run -it \
    -w /app \
    -v $(pwd):/app \
    --entrypoint bash \
    pulumi/pulumi-go

root@my-container:/app# pulumi login <s3://cnunciato-pulumi-s3-login-test>
Logged in to ny-container as root (<s3://cnunciato-pulumi-s3-login-test>)

root@my-container:/app# env
HOSTNAME=my-container
AWS_REGION=us-west-2
PWD=/app
HOME=/root
AWS_PAGER=
AWS_SECRET_ACCESS_KEY=[redacted]
TERM=xterm
SHLVL=1
AWS_ACCESS_KEY_ID=[redacted]
PATH=/pulumi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
AWS_SESSION_TOKEN=[redacted]
CGO_ENABLED=0
GOPATH=/go
_=/usr/bin/env
I only have Docker for Mac to test with at the moment, but yeah, seems to be working with that as expected.
c

clean-art-60451

03/03/2024, 11:34 PM
how do you have a root user, offcial pulumi/pulumi-go image has no linux user
I am using official image
m

miniature-musician-31262

03/03/2024, 11:36 PM
Who are you logged in as if not root? How are you logging into the container?
c

clean-art-60451

03/03/2024, 11:37 PM
“i-have-no-name” i think
m

miniature-musician-31262

03/03/2024, 11:42 PM
Oh, so are you getting a message like this?
Copy code
$ docker run -it --user nope [...]

docker: Error response from daemon: unable to find user nope: no matching entries in passwd file.
ERRO[0000] error waiting for container:
c

clean-art-60451

03/03/2024, 11:43 PM
i created a nonroot docker user and gave permission to pulumi/projects folder and set up HOME and PASSPHRASE variables,
this seem to work
m

miniature-musician-31262

03/03/2024, 11:44 PM
Ah great, ok. So you're unblocked then?
c

clean-art-60451

03/03/2024, 11:44 PM
yes
m

miniature-musician-31262

03/03/2024, 11:44 PM
Awesome!
c

clean-art-60451

03/03/2024, 11:45 PM
thank you for your support on the weekend
m

miniature-musician-31262

03/03/2024, 11:45 PM
Best of luck! Absolutely, feel free to reach out as you need.
c

clean-art-60451

03/04/2024, 2:27 AM
👍