Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fixing issue with es6 default export not being well handled post tran…
Browse files Browse the repository at this point in the history
…spilation in lambda
  • Loading branch information
em0ney committed May 7, 2016
1 parent 5acb20b commit bf8671d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var autotag = require('./lib/autotag.js').default;
var autotag = require('./lib/autotag.js');
var sampleData = require('./sample_data.js');

autotag.handler(sampleData, {
Expand Down
38 changes: 18 additions & 20 deletions src/autotag.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import AwsCloudTrailListener from './aws_cloud_trail_listener';

export default {
handler: (cloudtrailEvent, context) => {
const enabledListeners = [
AwsCloudTrailListener.EC2.name,
AwsCloudTrailListener.S3.name,
AwsCloudTrailListener.AUTOSCALE_GROUPS.name,
AwsCloudTrailListener.VPC.name,
AwsCloudTrailListener.SUBNETS.name,
AwsCloudTrailListener.ELB.name,
AwsCloudTrailListener.EBS.name,
AwsCloudTrailListener.INTERNET_GATEWAY.name,
AwsCloudTrailListener.RDS.name,
AwsCloudTrailListener.EMR.name,
AwsCloudTrailListener.DATA_PIPELINE.name
];
export function handler(cloudtrailEvent, context) {
const enabledListeners = [
AwsCloudTrailListener.EC2.name,
AwsCloudTrailListener.S3.name,
AwsCloudTrailListener.AUTOSCALE_GROUPS.name,
AwsCloudTrailListener.VPC.name,
AwsCloudTrailListener.SUBNETS.name,
AwsCloudTrailListener.ELB.name,
AwsCloudTrailListener.EBS.name,
AwsCloudTrailListener.INTERNET_GATEWAY.name,
AwsCloudTrailListener.RDS.name,
AwsCloudTrailListener.EMR.name,
AwsCloudTrailListener.DATA_PIPELINE.name
];

let listener = new AwsCloudTrailListener(cloudtrailEvent, context, enabledListeners);
return listener.execute();
let listener = new AwsCloudTrailListener(cloudtrailEvent, context, enabledListeners);
return listener.execute();

// context.succeed(); // Echo back the first key value
// context.fail('Something went wrong');
}
// context.succeed(); // Echo back the first key value
// context.fail('Something went wrong');
};

0 comments on commit bf8671d

Please sign in to comment.