Referencing Securing Groups and Subnets in other YAML files doesn't seem to work

Specifying the security group and subnet values by referencing a file separate from serverless.yml doesn’t seem to work. Using ${file(config/${opt:stage}-config.yml):Account} works fine, but not with vpc.securityGroupIds or vpc.subnetIds

portion of serverless.yml

name: aws
runtime: python2.7
stage: ${opt:stage}
role: arn:aws:iam::${file(config/${opt:stage}-config.yml):Account}:role/xxxxxxxxxxxxxxxx
- ${file(config/${opt:stage}-config.yml):SecurityGroupId1} #doesn’t work
- sg-xxxxxxx #works
- ${file(config/${opt:stage}-config.yml):SubnetId1} #doesn’t work
- subnet-xxxxxxxx #works

portion of config/prod-config.yml
Account: xxxxxxxxx
ZipPath: .
SecurityGroupId1: sg-xxxxxx
SecurityGroupId2: sg-xxxxxx
SubnetId1: subnet-xxxxxx
SubnetId2: subnet-xxxxxx

I’m an idiot – the ${file(config/${opt:stage}-config.yml):SubnetId1} needs to be surrounded by double quotes.