sticky-bear-14421
05/31/2021, 9:58 AMprivate_subnet_ids = aws.ec2.get_subnet_ids(
vpc_id=vpc.id, # created as the first resource in the stack
tags={"visibility": "private"} # filter by tags for the correct subnets
)
But, this consistently fails with the error message of:
Exception: invoke of aws:ec2/getSubnetIds:getSubnetIds failed: Missing required argument: The argument "vpc_id" is required, but no definition was found. ()
This worked before, while developing the code, as the VPC was created some days ago, but then we deleted the stack, and now everything should be created in a single run. I guess the call to aws.ec2.Vpc() hasn't returned yet with an vpc and its id when the call to get_subnet_ids() is being issued.vpc_id = vpc.id.apply(lambda x: x)
create_transitgateway_attachment(tgw_config_paramenters, vpc_id, tags)
Same errorvpc_id = vpc.id.apply(lambda x: x)
print(vpc id after apply(): ", vpc_id)
create_transit_gateway_attachment(tgw_config_parameters, vpc_id, tags)
Leads to the astonishing output of:
vpc id after apply(): <pulumi.output.Output object at 0x7fa5c8475400>
error: Program failed with an unhandled exception:
error: Traceback (most recent call last):
<snip>
Exception: invoke of aws:ec2/getSubnetIds:getSubnetIds failed: Missing required argument: The argument "vpc_id" is required, but no definition was found. ()
The error still exists ..hallowed-animal-47023
05/31/2021, 11:44 AMsticky-bear-14421
05/31/2021, 11:45 AMhallowed-animal-47023
05/31/2021, 11:46 AMsticky-bear-14421
05/31/2021, 11:48 AMpurple-plumber-90981
06/01/2021, 6:15 AMsticky-bear-14421
06/01/2021, 7:20 AMprivate_networks=[]
and then put these as parameter in my transitgateway() function, but the code base has a second use/intent as an example for new pulumi users in our organisation. So I put the get_subnet_ids() call in this as an example for querying resources from the api with the use of proper tagging.vpc_id = vpc.id.apply(lambda x: x)
create_transitgateway_attachment(tgw_config_paramenters, vpc_id, private_networks, tags)
But other resources inside this function need the vpc.id aswell, so the concurrency problem would remain.purple-plumber-90981
06/01/2021, 7:28 AMsticky-bear-14421
06/01/2021, 7:31 AMpurple-plumber-90981
06/01/2021, 7:32 AMsticky-bear-14421
06/01/2021, 7:35 AM