bulky-match-1583
05/24/2020, 1:14 PMrandom_id = random.RandomString(
resource_name='project-unique-id',
length=8,
lower=True,
upper=False,
special=False,
min_numeric=4
)
is there a way to extract the string value from random_id.result?sparse-state-34229
05/24/2020, 3:56 PMOutput
?bulky-match-1583
05/24/2020, 3:59 PMsparse-state-34229
05/24/2020, 4:05 PMOutput.all()
bulky-match-1583
05/24/2020, 4:08 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")
)
x[0][0]
bulky-match-1583
05/24/2020, 4:12 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
sparse-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 existsparse-state-34229
05/24/2020, 4:23 PMsubnet.self_link
is bool?bulky-match-1583
05/24/2020, 4:24 PMsparse-state-34229
05/24/2020, 4:24 PMNone
bulky-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