How can we get environment variable form buildspecs.yml/cloudformation template in serverless.yml

variables

#1

How can we get the environment variable from buildspecs.yml or code pipeline(cloud formation template) in serverless.yml while codebuild or serverless deployment.
Please suggest.

Thanks,
Dilip