@rlyle1179/serverless-aws-batch 1.1.17 → 1.1.18
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 +11 -0
- package/lib/generateCoreTemplate.js +4 -3
- package/package.json +1 -1
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
|
+
"awslog-group": logGroupName,
|
|
216
|
+
"awslog-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":
|
|
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":
|
|
90
|
+
"LogGroupName": logGroupName
|
|
90
91
|
},
|
|
91
92
|
"DependsOn": [
|
|
92
93
|
"BatchLogGroupLambdaPermission",
|