https://pulumi.com logo
Title
n

numerous-table-61756

07/07/2021, 8:37 AM
Hi there, I am trying to create a StackReference using a different Provider than the "default" one. In python:
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:
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

brave-planet-10645

07/07/2021, 10:03 AM
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

numerous-table-61756

07/07/2021, 10:29 AM
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

brave-planet-10645

07/07/2021, 10:40 AM
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

numerous-table-61756

07/07/2021, 10:47 AM
Ok, too bad. But thanks for this information