polite-ocean-13631
05/17/2023, 2:36 AMauto.create_or_select_stack(
stack_name=stack_name,
work_dir=work_dir,
opts=auto.LocalWorkspaceOptions(
project_settings=auto.ProjectSettings(
name=pulumi_project_name,
runtime="python",
backend=auto.ProjectBackend(url=f"s3://{PULUMI_STATE_BUCKET}/{pulumi_state_key}?region={AWS_REGION}&awssdk=v2"),
),
),
)
Using the above automation API code, I'm getting the following error:
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:<http://yaml.org|yaml.org>,2002:python/object:pulumi.automation._project_settings.ProjectBackend'
Does anyone know why, and/or what I can do to fix this?rhythmic-branch-12845
05/17/2023, 3:45 AMimport pulumi.automation as auto
(looks like it?):
>>> import pulumi_automation as auto
>>> auto.ProjectBackend # does this give you an error?
If that gives you an error, then we have something to work with. Otherwise, i'd also keep exploring around what's going on with the backend argumentopts: LocalWorkspaceOptions
argumentpolite-ocean-13631
05/17/2023, 1:19 PMauto.ProjectBackend()
without error, with and without providing the url
argument. It only becomes a problem when running stack.up
or stack.preview
rhythmic-branch-12845
05/17/2023, 3:26 PMpolite-ocean-13631
05/17/2023, 3:26 PMrhythmic-branch-12845
05/18/2023, 12:23 AMauto.ProjectBackend
does not give you an error, I'm afraid I'm at my wits' end... If you can provide a small complete program so others can reproduce it, I think that would help others look at it for youpolite-ocean-13631
05/18/2023, 12:25 AMPULUMI_BACKEND_URL
environment variable documented here: https://www.pulumi.com/docs/cli/environment-variables/
Ideally using auto.ProjectBackend
would work, but the env var is good enough for my purposes.