Anyway to retrieve existing security group and subnet ids?

I have an existing VPC with Security Groups and Subnets that I’d like to utilize in a Serverless deploy process for Lambda functions within that VPC. Is there anyway I can retrieve those values and use them programmatically in my Serverless deploy instead of needing to hardcode into the VPC section of the Function?

I don’t think this is easy, but it’s probably possible with a plugin that uses the amazon cli. I had a similar question myself about getting the default VPC arn.