@rlyle1179/serverless-aws-batch 1.1.17 → 1.1.19

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.
package/lib/batchtask.js CHANGED
@@ -206,6 +206,17 @@ function updateContainerProperties(newFunction, functionObject, functionName) {
206
206
  });
207
207
  }
208
208
  );
209
+
210
+ const logGroupName = _.get(this.serverless.service,"custom.awsBatch.logGroupName");
211
+ if ( logGroupName ) {
212
+ newFunction.Properties.ContainerProperties.LogConfiguration = {
213
+ LogDriver: 'awslogs',
214
+ Options: {
215
+ "awslogs-group": logGroupName,
216
+ "awslogs-stream-prefix": "batch"
217
+ }
218
+ }
219
+ }
209
220
  }
210
221
 
211
222
  /**
@@ -63,8 +63,9 @@ function generateCoreTemplate() {
63
63
 
64
64
  // Look for the serverless-log-forwarding custom parameters, if found, then forward the logs
65
65
  // from our batch jobs to the same ARN...
66
+ const logGroupName = _.get(this.serverless.service,"custom.awsBatch.logGroupName");
66
67
  const logDestinationArn = _.get(this.serverless.service,"custom.logForwarding.destinationARN" );
67
- if ( logDestinationArn ) {
68
+ if ( logDestinationArn && logGroupName ) {
68
69
  const batchLogGroupTemplate = {
69
70
  "BatchLogGroupLambdaPermission": {
70
71
  "Type": "AWS::Lambda::Permission",
@@ -77,7 +78,7 @@ function generateCoreTemplate() {
77
78
  "BatchLogGroup": {
78
79
  "Type": "AWS::Logs::LogGroup",
79
80
  "Properties": {
80
- "LogGroupName": "/aws/batch/job",
81
+ "LogGroupName": logGroupName,
81
82
  "RetentionInDays": 7
82
83
  }
83
84
  },
@@ -86,7 +87,7 @@ function generateCoreTemplate() {
86
87
  "Properties": {
87
88
  "DestinationArn": logDestinationArn,
88
89
  "FilterPattern": "",
89
- "LogGroupName": "/aws/batch/job"
90
+ "LogGroupName": logGroupName
90
91
  },
91
92
  "DependsOn": [
92
93
  "BatchLogGroupLambdaPermission",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {