Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created May 26, 2020 18:27
Show Gist options
  • Save scionwest/ebd97d7c627db6b2db09df44887547e3 to your computer and use it in GitHub Desktop.
Save scionwest/ebd97d7c627db6b2db09df44887547e3 to your computer and use it in GitHub Desktop.
const CloudFormation = require('yaml-cfn')
// Extract the AWS::Serverless::Function Resources as they
// are the entires we need to compile.
const { Resources } = CloudFormation.yamlParse(fs.readFileSync('template.yml'))
const entries = Object.values(Resources)
.filter(resource => resource.Type == 'AWS::Serverless::Function')
.filter(resource => resource.Properties.Runtime.startsWith('dotnetcore'))
.map(resource => {
const file = resource.Properties.Handler.split('.')[0]
const prefix = resource.Properties.CodeUri.substr(9)
return { lambdaSourceFile: file, deploymentUri: prefix };
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment