Skip to content

Instantly share code, notes, and snippets.

@jaxxstorm
Last active August 9, 2023 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaxxstorm/d6ef8d94acaf9f0c702c92a4f84c3c8b to your computer and use it in GitHub Desktop.
Save jaxxstorm/d6ef8d94acaf9f0c702c92a4f84c3c8b to your computer and use it in GitHub Desktop.
StackInfo
import infrastructure_lib.stackinfo as stackinfo
STACK = pulumi.get_stack()
vpc = stackinfo.VpcStackInfo(STACK)
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"orgname/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment