const cdk = require('@aws-cdk/cdk');
const lambda = require('@aws-cdk/aws-lambda');
const iam = require('@aws-cdk/aws-iam');
const path = require('path');
class MyStack extends cdk.Stack {
constructor (parent, id, props) {
super(parent, id, props);
//
// Create a lambda...
const fn = new lambda.Function(this, 'MyFunction-cdktest', {
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.directory( path.join( __dirname, 'lambda')),
role: iam.RoleName('lambda_basic_execution')
});
}
}
class MyApp extends cdk.App {
constructor (argv) {
super(argv);
new MyStack(this, 'hello-cdk');
}
}
console.log(new MyApp(process.argv).run());