Create and configure VPC to Jets app


I am trying to create a VPC using shared resources and I also want to set this VPC to all of my lambda functions.
I tried it by setting the VPC in the configuration following this documentation:

The problem is that the subnet ids and the security group ids are dynamic because they are created when I deploy the app. So I cannot specify fixed ids.

How can I put a reference to my subnets and my security groups?

I tried to do this:

security_group_id = Vpc.lookup("LambdaSecurityGroup")
private_subnet_1  = Vpc.lookup("PrivateSubnet1")
private_subnet_2  = Vpc.lookup("PrivateSubnet2")

Jets.application.configure do
  config.function.vpc_config = {
    security_group_ids: [security_group_id],
    subnet_ids: [private_subnet_1, private_subnet_2],

Where Vpc is my shared resource
The problem is that security_group_id, private_subnet_1, and private_subnet_2 variables are nil when I deploy my application.