rhythmic-lamp-79430
12/31/2021, 4:37 PMbillowy-army-68599
apply
in order to do so.
I would recommend reading this blog article I wrote: https://www.leebriggs.co.uk/blog/2021/05/09/pulumi-apply.html
You're going to have a lot easier time here if you create your own ipv6 block instead of replying on the output from the VPC, but if you really want to use the output from the VPC, you're going to need an apply
.rhythmic-lamp-79430
12/31/2021, 5:04 PMbillowy-army-68599
rhythmic-lamp-79430
12/31/2021, 5:06 PMbillowy-army-68599
rhythmic-lamp-79430
12/31/2021, 5:08 PMipv6_network = resource_vpc.ipv6_cidr_block
ipv6_subnets_generator = ipv6_network.apply(_get_ipv6_subnets_of)
File "./__main__.py", line 73, in <module>
ipv6_cidr = str(next(ipv6_subnets_generator))
TypeError: 'Output' object is not an iterator
def _get_ipv6_subnets_of(cidr, prefix):
ipv6_network = IPNetwork(cidr.apply(lambda cidr: f"{cidr}"))
cidrs = ipv6_network.subnet(prefix.apply(lambda prefix: int(prefix)))
return cidrs
billowy-army-68599
rhythmic-lamp-79430
12/31/2021, 9:45 PM