sparse-state-34229
03/26/2020, 5:48 PMec2.get_subnet_ids()
in Python SDK? I pass vpc_id=vpc.id
as I do with other resources but get an exception:
Exception: invoke of aws:ec2/getSubnetIds:getSubnetIds failed: "vpc_id": required field is not set ()
ec2.get_subnet_ids(vpc_id=vpc.id)
callvpc.id
is valid and compared the object with its use in other methodsFile "/Users/scott/.pyenv/versions/infra/lib/python3.8/site-packages/pulumi/runtime/invoke.py", line 111, in do_invoke
raise Exception(f"invoke of {tok} failed: {resp.failures[0].reason} ({resp.failures[0].property})")
Exception: invoke of aws:ec2/getSubnetIds:getSubnetIds failed: "vpc_id": required field is not set ()
error: an unhandled error occurred: Program exited with non-zero exit code: 1
VPC ID before ec2.InternetGateway: <pulumi.output.Output object at 0x10e577970>
VPC ID before deriving subnets for ec2.NatGateway: <pulumi.output.Output object at 0x10e577970>
gentle-diamond-70147
03/26/2020, 6:55 PMsparse-state-34229
03/26/2020, 6:57 PMgentle-diamond-70147
03/26/2020, 8:35 PMself.vpc.id
is set or even that self.vpc
is set?
When I try this it works fine for me.sparse-state-34229
03/26/2020, 8:37 PM_manage_natgw
which raises the exception aboveself.vpc
in that file on L38 because self.vpc.id
didn’t workgentle-diamond-70147
03/26/2020, 9:29 PMsparse-state-34229
03/26/2020, 9:31 PMgentle-diamond-70147
03/27/2020, 4:34 AM_manage_subnets
create a list of subnets and set them to self
- in _manage_natgw
use the list of subnets from self
to create the NatGateway
resources
- removed the ec2.get_subnet_ids()
call entirelyself.vpc.id
is an Output (e.g. a "future") and ec2.get_subnet_ids()
expects a "prompt" string. We have an issue somewhere to allow for the get_X()
function calls to accept outputs, but unfortunately they don't currently.get_X()
functions actually query the AWS APIs to get data and if this is the first time you're running a preview
or up
those subnets won't actually exist.sparse-state-34229
03/27/2020, 4:39 AM