quiet-tomato-48326
11/10/2022, 12:08 AMerror: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions
We’re using an S3 bucket for state, so it shouldn’t need the access token. According to the docs, pulumi “automatically perform a pulumi login
command” when running in a CI service—I think this is what’s failing. However, we’re not using pulumi cloud—we’re using an S3 backend, listed in Pulumi.yaml:
backend:
url: '<s3://pulumi-state.swmdigital.io>'
I’ve tried adding a pulumi login
command to the workflow, but that fails with the same error
pulumi login --cloud-url <s3://pulumi-state.swmdigital.io>
Can anyone see what I’m doing wrong?pulumi stack export | jq -r '.deployment.resources[] | select(.type == "pulumi:providers:azuread") | .urn' | xargs printf -- "--target '%s'\n" | xargs pulumi up --refresh --yes --non-interactive
(I’m trying to automate the workaround for this)
I changed it to use a for loop instead, and suddenly it works as expected:
for URN in $(pulumi stack export | jq -r '.deployment.resources[] | select(.type == "pulumi:providers:azuread") | .urn' ); do
pulumi up --refresh --yes --non-interactive --target "${URN}"
done