Reference Existing Cloudformation Stack Outputs

Hi. My company is currently evaluating whether to use Serverless for some of our new AWS application infrastructure. We heavily use Cloudformation (deployed by Ansible), so we would need to be able to cleanly reference the outputs of existing Cloudformation stacks – one immediate example would be for getting the subnet IDs of our existing AWS network infrastructure for use in a lambda function’s VPC Config ( We already have stacks in our various environments that can be reliably referenced by name – e.g., ‘${stage}-common-network’. I’m just trying to figure out whether there is an out-of-the-box way to reference these existing stacks’ outputs within serverless.yml. One possible solution I see is to pull the variables using aws cli and pass them as environment variables to serverless, but I would like a cleaner way if possible.

Would I need to write a custom plugin that accepts the name of the existing stack and the desired output variable as parameters?

Thanks for your help.

Just a bit of additional information here:

We have common per-environment network stacks. From these we make the subnet IDs and VPC ID available as stack outputs. Some of the lambda functions we use require the ability to connect to our internal network and hence require the subnet IDs.

My biggest concern here is that Serverless offer a way to be able to cleanly read outputs from these existing stacks. I can definitely see the making this work via either:

  1. pass the subnet IDs, etc., as environment variables obtained from doing an aws cli command
  2. write a custom serverless plugin that, given a CF stack name, can return the desired outputs.

The 2nd option seems preferable and not too difficult, assuming I can grok building a serverless plugin. My question is: Is there a more obvious / idiomatic way to do this in Serverless that I’m missing?