https://pulumi.com logo
Title
s

swift-agency-29333

04/26/2021, 10:12 AM
Can I set pulumi login path using Automation API? Right now doing it one time through CLI.
f

faint-table-42725

04/26/2021, 4:38 PM
Yes, you can specify the backend as part of your workspace options.
👍 1
s

swift-agency-29333

04/26/2021, 7:59 PM
@faint-table-42725 can we use etcd as a pulumi backend?
b

broad-dog-22463

04/26/2021, 8:00 PM
we have no support at this time for etcd as a backend - our backends are S3 / GCS / Azure / Local and S3 compatible backends
s

swift-agency-29333

04/27/2021, 12:14 PM
@faint-table-42725 @broad-dog-22463 are you talking about pass backend using workdir func of golang? Can you share a code snippet or a link to golang doc that I can use to pass backend path.
s

swift-agency-29333

04/30/2021, 12:30 AM
@faint-table-42725 I tried it. But when I set URL to S3 bucket it gives error “region not provided (something similar)”.
f

faint-table-42725

04/30/2021, 1:06 AM
I would verify that manually running
pulumi login <url>
works for you via the command line
https://www.pulumi.com/docs/intro/concepts/state/#logging-into-the-aws-s3-backend has details on the correct configuration for the S3 backend
If it still doesn’t work, please file an issue with details on how you’re logging in
r

red-match-15116

04/30/2021, 2:29 AM
I tried it. But when I set URL to S3 bucket it gives error “region not provided (something similar)“.
Are you sure that error is from the login? Are you setting your region in your config for your aws program?
s

swift-agency-29333

04/30/2021, 9:20 AM
@red-match-15116 @faint-table-42725 yes I have. My code is very similar to the one in repo. I have defined the region exactly like this but the error is on backend url.
error: could not create stack: An IO error occurred while writing the new snapshot file: blob (key ".pulumi/stacks/dev.json") (code=Unknown): MissingRegion: could not find region configuration
@red-match-15116 @faint-table-42725 how s3 should be created? Like what policies or permissions should be there for s3 to work with pulumi?
@red-match-15116 @faint-table-42725 any suggestions?
r

red-match-15116

05/02/2021, 6:33 PM
I’m not really sure, sorry. Have you followed all of the directions on the page that Lee Zen linked? https://www.pulumi.com/docs/intro/concepts/state/#logging-into-the-aws-s3-backend
You might have to pass the region as an env var on workspace creation. https://github.com/pulumi/automation-api-examples/blob/main/go/inline_secrets_provider/main.go#L104-L107
envvars := auto.EnvVars(map[string]string{
    "PULUMI_CONFIG_PASSPHRASE": "password",
    "AWS_REGION": "us-west-2",
})
s

swift-agency-29333

05/03/2021, 8:40 AM
@red-match-15116 Thanks envvars worked. It turned out usually we pass all config after creating/selecting stack but in this case we have to pass this information before. But that’s strange, it should be mentioned in the docs.
r

red-match-15116

05/03/2021, 4:13 PM
JSYK you don’t always have to send the message to the channel since we’re replying in this thread and I get an alert when you
@
me - it can be distracting for other folks 🙂 Anyway, just to confirm, do you have your
AWS_REGION
env var set globally? Are you able to log in using s3 without the env var if you just use the CLI?
s

swift-agency-29333

05/03/2021, 4:25 PM
@red-match-15116 Okay. Kind of habit to always tick the box in my work slack. I won’t do that from now onwards. No I don’t have anything in env variables. I am setting region and everything using stack.config. So in this case, we have to pass it in env variables. Now S3 backend is working.
r

red-match-15116

05/03/2021, 4:33 PM
Yeah, the difference is that you need the region set specifically for the backend URL to even work which is why it needs to be set on workspace creation rather than on the stack after it exists. Anyway, glad you got it working!
1