sparse-intern-71089
05/19/2022, 8:14 AMvictorious-church-57397
05/19/2022, 10:10 AMrequireOutput
instead of getOutput
victorious-church-57397
05/19/2022, 10:11 AM.apply
on the outputvictorious-church-57397
05/19/2022, 10:11 AMexport const ruleSgId = secgroup.id.apply((id) => id);
ancient-nightfall-54764
05/19/2022, 1:54 PM.apply
in the output, but the error still same.ancient-nightfall-54764
05/19/2022, 2:21 PMclever-sunset-76585
05/19/2022, 2:37 PMinfra
stack is having a problem exporting the output due to secgroup
or subneta
being undefined. It is not clear which one is the issue without seeing more code.ancient-nightfall-54764
05/19/2022, 3:55 PMclever-sunset-76585
05/19/2022, 4:14 PMvpc.ts
won't work because you have the variable in that file guarded by an if-condition that would only be true when this stack is infra
. When you are running as the dev
stack it will be undefined
. So the issue doesn't seem to be because of stack references. It's an issue with line 7 in your index.ts
file at the root of your repo. To make it work you could change it to add an if-condition in index.ts
too to see what the current stack is.
Structuring your app the way you have it now is confusing to be honest. Is there a reason you do not want to have the infra stack as its own Pulumi project? The code is likely to get more complicated with more conditional branches all over the place the way it is right now. Have a look at the examples
repo for comparison of how to have multiple Pulumi projects within the same folder.ancient-nightfall-54764
05/20/2022, 1:39 AMclever-sunset-76585
05/20/2022, 2:33 AMvpc.ts
only runs when your stack name is infra
. So when you run the same code for your dev
stack, the export in that file is never assigned a value even though the vpc does get created in the infra
stack. There is a way to get it to work but honestly I think you'll find it more confusing to work with it over time.ancient-nightfall-54764
05/20/2022, 2:51 AMclever-sunset-76585
05/20/2022, 2:52 AM