This message was deleted.
# yaml
s
This message was deleted.
m
Thank for for the feedback, this is helpful. Regarding stack references, am I doing something incorrect?
Copy code
variables:
  vpcId: ${shared-infrastructure.outputs["vpcId"]}


resources:
  shared-infrastructure:
    type: pulumi:pulumi:StackReference
    properties:
      name: ${sharedInfrastructureStackName}
    
  shared-vpc:
    type: aws:ec2/vpc:Vpc
    get:
      # This fails as a stack reference, but succeeds if I hardcode the VPC ID here
      id: ${vpcId}
I have an existing VPC that was created by another team that rolls out the underlying infrastructure. We insulate our Pulumi stacks with a "shared-infrastructure" layer that's responsible for providing Stack outputs for reference for existing infrastructure, or standing up new infrastructure that's required across that account.
Please keep me posted on the YAML array situation if you need a guinea pig.
👍 1
e
That looks like what I would expect, a quick test you could do use take that yaml and run
pulumi convert --language typescript
and see what TS code it gives you and see if that program works as expected. If it does then it's probably a bug in the yaml runtime.
m
Looks incorrect:
Copy code
const sharedInfrastructure = new pulumi.StackReference("shared-infrastructure", {name: sharedInfrastructureStackName});
const vpcId = sharedInfrastructure.outputs.vpcId;
const sharedVpc = new aws.ec2.Vpc("shared-vpc", {});
e
That does look wrong, can you open an issue at https://github.com/pulumi/pulumi-yaml/issues with those code snippets.
m
Yeah
Also, maybe this is intentional, but when I ran it without the
--out
flag, it overwrote my
Pulumi.yaml
oh, it overwrote more than that...
e
I think the default is to output to the same directory, which does overwrite any Pulumi.yaml already there. Not sure if the sensible thing there is to default to something like --out=./out, require a prompt to say it's ok to overwrite or do like
pulumi new
and require --out to be empty. Worth raising another issue at https://github.com/pulumi/pulumi/issues to point out this UX is not ideal as is though, we can take some ideas of what would be the most preferable behaviour.
m
I would suggest either 1. A warning with prompt to continue, or 2. A default directory