Hi there, I am trying to create a StackReference u...
# general
n
Hi there, I am trying to create a StackReference using a different Provider than the "default" one. In python:
Copy code
provider = aws.Provider(
            resource_name="foo",
            region="eu-central-1",
            profile="foo"
        )
        stack = pulumi.StackReference(
            name="foo",
            stack_name="foo",
            opts=pulumi.ResourceOptions(provider=provider),
        )
Unfortunately I'm getting an error:
Copy code
pulumi:pulumi:StackReference (foo):
    error: Preview failed: unrecognized resource type (Read): pulumi:pulumi:StackReference
Ideas? Is setting a provider for StackReference a feature in the first place?
b
You can set a provider on the stack reference, but it's a Pulumi thing, not an AWS thing so you wouldn't want an AWS provider in the stack reference.
n
Ok. But how else can I access stack outputs of a stack hosted by another provider than default?
The underlying pulumi database of that provider ist hosted in AWS S3.
b
You can only reference stacks in the same backend that you're in. So for example, if one pulumi program has its backend in S3 and another in the Pulumi console, you won't be able to get stack references in this way
As well as that, if they're not using the default backend they both need to be in the same (in this example) S3 bucket
n
Ok, too bad. But thanks for this information