https://pulumi.com logo
#python
Title
# python
a

astonishing-quill-88807

06/16/2020, 3:37 PM
v6net = IPv6Network(olvpc.ipv6_cidr_block.apply(lambda cidr: f'{cidr}'))
where
olvpc
is the return value of a call to
pulumi_aws.ec2.Vpc
When I try to run
pulumi up
it spouts this traceback:
Copy code
error: Traceback (most recent call last):
      File "/usr/bin/pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
        return future.result()
      File "/home/tmacey/code/mit/ops/infra/ol-infrastructure/.venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 81, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/home/tmacey/code/mit/ops/infra/ol-infrastructure/.venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 34, in run_pulumi_func
        func()
      File "/home/tmacey/code/mit/ops/infra/ol-infrastructure/.venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 81, in <lambda>
        await run_pulumi_func(lambda: Stack(func))
      File "/home/tmacey/code/mit/ops/infra/ol-infrastructure/.venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 114, in __init__
        func()
      File "/usr/bin/pulumi-language-python-exec", line 84, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/usr/lib/python3.8/runpy.py", line 282, in run_path
        return _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "./__main__.py", line 13, in <module>
        data_vpc = OLVPC(data_vpc_config)
      File "/home/tmacey/code/mit/ops/infra/ol-infrastructure/src/ol_infrastructure/components/aws/olvpc.py", line 146, in __init__
        v6net = IPv6Network(olvpc.ipv6_cidr_block.apply(lambda cidr: str(f'{cidr}')))
      File "/usr/lib/python3.8/ipaddress.py", line 2101, in __init__
        self.network_address = IPv6Address(addr)
      File "/usr/lib/python3.8/ipaddress.py", line 1837, in __init__
        self._ip = self._ip_int_from_string(addr_str)
      File "/usr/lib/python3.8/ipaddress.py", line 1574, in _ip_int_from_string
        raise AddressValueError(msg)
    ipaddress.AddressValueError: At least 3 parts expected in '<pulumi.output.Output object at 0x7f353e3c7160>'
s

sparse-state-34229

06/16/2020, 5:11 PM
i’ve found trying to cast outputs as strings to be very futile
try
v6net = olvpc.ipv6_cidr_block.apply(lambda cidr: IPv6Network(cidr))