sparse-intern-71089
05/24/2020, 1:14 PMsparse-state-34229
05/24/2020, 3:56 PMsparse-state-34229
05/24/2020, 3:57 PMOutput
?bulky-match-1583
05/24/2020, 3:59 PMsparse-state-34229
05/24/2020, 4:05 PMOutput.all()
sparse-state-34229
05/24/2020, 4:05 PMbulky-match-1583
05/24/2020, 4:08 PMbulky-match-1583
05/24/2020, 4:08 PMbulky-match-1583
05/24/2020, 4:09 PMsparse-state-34229
05/24/2020, 4:11 PMsparse-state-34229
05/24/2020, 4:11 PMreturn Output.all([self.vpc.id]).apply(
lambda x: user_data_tpl.render(
dns_domain=self.vpc.dns_domain,
vpc_cidr=self.vpc.cidr_block,
vpc_id=x[0][0],
vpc_name=self.vpc.name,
).encode("utf-8")
)
sparse-state-34229
05/24/2020, 4:12 PMx[0][0]
bulky-match-1583
05/24/2020, 4:12 PMbulky-match-1583
05/24/2020, 4:14 PMsparse-state-34229
05/24/2020, 4:15 PMbulky-match-1583
05/24/2020, 4:17 PMsparse-state-34229
05/24/2020, 4:17 PMbulky-match-1583
05/24/2020, 4:19 PMsubnet = gcp.compute.get_subnetwork(
name='some-subnet-that-exists',
project=my-proejct-id,
region=gcp_region
)
if subnet exists i can verify with
if subnet.self_link:
return subnet.ip_cidr_range
bulky-match-1583
05/24/2020, 4:20 PMsparse-state-34229
05/24/2020, 4:22 PMbulky-match-1583
05/24/2020, 4:23 PMsubnet = pulumi.Output.all([config.project_id]).apply(
lambda x: gcp.compute.get_subnetwork(
name=f'{x[0][0]}-subnet',
project=x[0][0],
region=config.gcp_region
)
)
if subnet.self_link:
return subnet.ip_cidr_range
if subnet.self_link always true even if it doesn't existbulky-match-1583
05/24/2020, 4:23 PMsparse-state-34229
05/24/2020, 4:23 PMsubnet.self_link
is bool?sparse-state-34229
05/24/2020, 4:24 PMbulky-match-1583
05/24/2020, 4:24 PMbulky-match-1583
05/24/2020, 4:24 PMsparse-state-34229
05/24/2020, 4:24 PMNone
sparse-state-34229
05/24/2020, 4:25 PMbulky-match-1583
05/24/2020, 4:25 PMsparse-state-34229
05/24/2020, 4:25 PMsubnet
?bulky-match-1583
05/24/2020, 4:26 PM