https://pulumi.com logo
#golang
Title
# golang
r

rich-exabyte-94739

10/07/2020, 5:56 PM
Question: I'm trying to get a StackReference for our
infra
stack in our `api`stack and using the example code is returning an error:
Copy code
slug := fmt.Sprintf("foo/%v/%v", ctx.Project(), "infra")
stackRef, err := pulumi.NewStackReference(ctx, slug, nil)
if err != nil {
	return err
}
Returns the following error:
Copy code
pulumi:pulumi:StackReference (foo/bar/api):
    error: resource 'urn:pulumi:api::bar::pulumi:pulumi:StackReference::foo/bar/api' registered twice (read and read)
Am I missing something here?
Actually, I take that back. I was calling it twice. Problem solved.
3 Views