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

hundreds-dog-95098

05/21/2020, 4:41 PM
Copy code
from pulumi_aws import ec2

vpcs = ec2.get_vpcs(tags={
   "key": "value",
})
when trying to get all vpc by tags then getting exception. File “/usr/local/bin/pulumi-language-python-exec”, line 85, in <module> loop.run_until_complete(coro) File “/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py”, line 587, in run_until_complete return future.result() File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py”, line 81, in run_in_stack await run_pulumi_func(lambda: Stack(func)) File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py”, line 50, in run_pulumi_func await RPC_MANAGER.rpcs.pop() File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py”, line 34, in run_pulumi_func func() File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py”, line 81, in <lambda> await run_pulumi_func(lambda: Stack(func)) File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py”, line 114, in init func() File “/usr/local/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/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py”, line 280, in run_path run_name, mod_spec, pkg_name).copy() File “/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py”, line 85, in _run_code exec(code, run_globals) File “./__main__.py”, line 15, in <module> tags=tags File “./vpc.py”, line 108, in create_network cidr_block = allocate_new_cidr(base_cidr) File “./utils.py”, line 19, in allocate_new_cidr “project”: “cspaas”, File “/usr/local/lib/python3.7/site-packages/pulumi_aws/ec2/get_vpcs.py”, line 88, in get_vpcs ret = pulumi.runtime.invoke(‘awsec2/getVpcsgetVpcs’, args, opts=opts).value File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/invoke.py”, line 125, in invoke return InvokeResult(_sync_await(asyncio.ensure_future(do_rpc()))) File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/sync_await.py”, line 95, in _sync_await return fut.result() File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/invoke.py”, line 122, in do_rpc raise exn File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/rpc_manager.py”, line 67, in rpc_wrapper result = await rpc File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/invoke.py”, line 106, in do_invoke resp = await asyncio.get_event_loop().run_in_executor(None, do_invoke) File “/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “/usr/local/lib/python3.7/site-packages/pulumi/runtime/invoke.py”, line 104, in do_invoke raise Exception(details) Exception: invocation of awsec2/getVpcsgetVpcs returned an error: invoking awsec2/getVpcsgetVpcs: no matching VPC found