We are trying to implement the pulumi-stacks featu...
# pulumi-cloud
s
We are trying to implement the pulumi-stacks feature in ESC. We have an environment setup that is attempting to reference a stack that we have in our account. The project/stack is called
base-infra/dev
, and in our ESC document we have a section that looks like this:
Copy code
values:
  stackRefs:
    fn::open::pulumi-stacks:
      stacks:
        baseInfra:
          stack: base-infra/dev
But when we try to Open the document to see the resolved values (assuming this will pull the outputs from that stack) we get the following error:
Copy code
XXXXXXXXXXXX:3:5 - values.stackRefs:
		Error: missing Stack resource
Is there anything else we need to do to allow ESC to access the outputs from that stack, e.g. a permission we need to enable? I am doing this all from a user who has access to both the environment and the stack.
sorry, pasted the wrong error. It is
Error: missing Stack resource
l
Where are you writing
values.stackRefs
? I've just tried this and it's working:
Copy code
values:
  stackRefs:
    fn::open::pulumi-stacks:
      stacks:
        demo:
          stack: opsgenie-system/demo
  pulumiConfig:
    teamId: ${stackRefs.demo.appSupportTeamId}
When I click Open I see this:
Copy code
{
  "pulumiConfig": {
    "teamId": "aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
  },
  "stackRefs": {
    "demo": {
      "appSupportApiKey": "[secret]",
      "appSupportTeamId": "aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
    }
  }
}
s
same place, in the
values.stackRefs
. Although here is the crazy thing. Before I wasn't referencing it in another property, but I added the reference in another property and now it is working. I guess it didn't like the stack reference just sitting out there without being references. Although now when I remove the reference it is still working 🤷
thanks for the help 🙂
l
I don't use
values.
anywhere and it works immediately. I don't think it's needed?