@rlyle1179/serverless-aws-batch 1.1.16 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,6 +61,46 @@ function generateCoreTemplate() {
61
61
  newECRObject
62
62
  );
63
63
 
64
+ // Look for the serverless-log-forwarding custom parameters, if found, then forward the logs
65
+ // from our batch jobs to the same ARN...
66
+ const logDestinationArn = _.get(this.serverless.service,"custom.logForwarding.destinationARN" );
67
+ if ( logDestinationArn ) {
68
+ const batchLogGroupTemplate = {
69
+ "BatchLogGroupLambdaPermission": {
70
+ "Type": "AWS::Lambda::Permission",
71
+ "Properties": {
72
+ "FunctionName": logDestinationArn,
73
+ "Action": "lambda:InvokeFunction",
74
+ "Principal": "logs.us-east-1.amazonaws.com"
75
+ }
76
+ },
77
+ "BatchLogGroup": {
78
+ "Type": "AWS::Logs::LogGroup",
79
+ "Properties": {
80
+ "LogGroupName": "/aws/batch/job",
81
+ "RetentionInDays": 7
82
+ }
83
+ },
84
+ "BatchLogGroupSubscriptionFilter": {
85
+ "Type": "AWS::Logs::SubscriptionFilter",
86
+ "Properties": {
87
+ "DestinationArn": logDestinationArn,
88
+ "FilterPattern": "",
89
+ "LogGroupName": "/aws/batch/job"
90
+ },
91
+ "DependsOn": [
92
+ "BatchLogGroupLambdaPermission",
93
+ "BatchLogGroup"
94
+ ]
95
+ }
96
+ }
97
+
98
+ _.merge(
99
+ this.serverless.service.provider.compiledCloudFormationTemplate.Resources,
100
+ batchLogGroupTemplate
101
+ );
102
+ }
103
+
64
104
  // Then write it back out to the file
65
105
  const coreTemplateFileName = this.provider.naming.getCoreTemplateFileName();
66
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {