sparse-intern-71089
09/19/2023, 3:19 PMbillowy-army-68599
gray-knife-50817
09/19/2023, 3:23 PMbillowy-army-68599
billowy-army-68599
gray-knife-50817
09/19/2023, 3:29 PMStackReference
in multiple places to get the same Output
so my logic was to create a function in the module where it came from, to be reused in multiple places elsewherebillowy-army-68599
class VpcStackInfo(pulumi.StackReference):
vpc_id = pulumi.Output[Any]
private_subnet_ids = pulumi.Output[Any]
public_subnet_ids = pulumi.Output[Any]
cidr_block = pulumi.Output[Any]
def __init__(self, stack_name: str):
super().__init__(f"ignistech/vpc/{stack_name}")
self.vpc_id = self.require_output("vpc_id") # type: ignore
self.private_subnet_ids = self.require_output("private_subnet_ids") # type: ignore
self.public_subnet_ids = self.require_output("public_subnet_ids") # type: ignore
self.cidr_block = self.require_output("cidr_block") # type: ignore
Then reference it like this:
vpc = stackinfo.VpcStackInfo(STACK)
billowy-army-68599
gray-knife-50817
09/19/2023, 4:00 PMgray-knife-50817
09/20/2023, 11:02 AMpreview
is still failing for B
because A
hasn't been up
'd yet I think. But all the changes are going together in the pipeline. Is there something I'm missing for dependency on A
by B
that needs to be declared for the preview
to work?