Skip to content

Commit c83d8ba

Browse files
authored
Merge pull request #158 from SumoLogic/hsharma-nodejs14-eol
Nodejs14 eol
2 parents b3c2816 + efd2295 commit c83d8ba

10 files changed

+121
-29
lines changed

cloudwatchevents/guardduty/cloudwatchevents.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
]
8686
},
8787
"Timeout": 300,
88-
"Runtime": "nodejs14.x"
88+
"Runtime": "nodejs18.x"
8989
}
9090
},
9191
"CloudWatchEventFunctionCloudWatchEventTriggerPermission": {

cloudwatchevents/guardduty/deploy.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
export AWS_PROFILE="prod"
4+
if [ "$AWS_PROFILE" == "prod" ]
5+
then
6+
SAM_S3_BUCKET="appdevstore"
7+
AWS_REGION="us-east-1"
8+
else
9+
SAM_S3_BUCKET="cf-templates-5d0x5unchag-us-east-2"
10+
AWS_REGION="us-east-2"
11+
fi
12+
13+
version="1.0.4"
14+
15+
echo "Creating package.yaml"
16+
sam package --template-file template.yaml --s3-bucket $SAM_S3_BUCKET --output-template-file packaged.yaml --s3-prefix "GuardDuty/v"$version --region $AWS_REGION --profile $AWS_PROFILE
17+
18+
echo "Publishing sumologic-guardduty-events-processor "$version
19+
sam publish --template packaged.yaml --region $AWS_REGION --semantic-version $version
20+
21+
echo "Published sumologic-guardduty-events-processor "$version
22+
# sam deploy --template-file packaged_sumo_app_utils.yaml --stack-name testingsumoapputils --capabilities CAPABILITY_IAM --region $AWS_REGION

cloudwatchevents/guardduty/packaged.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Metadata:
2323
- cloudwatchevents
2424
- guardduty
2525
Name: sumologic-guardduty-events-processor
26-
LicenseUrl: s3://appdevstore/GuardDuty/v1.0.3/6092dd6c323e33634657102f570628e0
27-
ReadmeUrl: s3://appdevstore/GuardDuty/v1.0.3/9d217c45b3ababadef584aee27d4d607
28-
SemanticVersion: 1.0.3
26+
LicenseUrl: s3://appdevstore/GuardDuty/v1.0.4/6092dd6c323e33634657102f570628e0
27+
ReadmeUrl: s3://appdevstore/GuardDuty/v1.0.4/9d217c45b3ababadef584aee27d4d607
28+
SemanticVersion: 1.0.4
2929
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/master/cloudwatchevents/guardduty
3030
SpdxLicenseId: Apache-2.0
3131
Parameters:
@@ -35,9 +35,9 @@ Resources:
3535
CloudWatchEventFunction:
3636
Type: AWS::Serverless::Function
3737
Properties:
38-
CodeUri: s3://appdevstore/GuardDuty/v1.0.3/58c7f17decc811a6e8904a19a9f844a1
38+
CodeUri: s3://appdevstore/GuardDuty/v1.0.4/22b7b226ca9ec3b9dbb28b94c0e5f824
3939
Handler: cloudwatchevents.handler
40-
Runtime: nodejs14.x
40+
Runtime: nodejs18.x
4141
Environment:
4242
Variables:
4343
SUMO_ENDPOINT:
@@ -49,6 +49,8 @@ Resources:
4949
Pattern:
5050
source:
5151
- aws.guardduty
52+
Metadata:
53+
SamResourceId: CloudWatchEventFunction
5254
Outputs:
5355
CloudWatchEventFunction:
5456
Description: CloudWatchEvent Processor Function ARN

cloudwatchevents/guardduty/template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Metadata:
2323
Name: sumologic-guardduty-events-processor
2424
LicenseUrl: ../LICENSE
2525
ReadmeUrl: ./README.md
26-
SemanticVersion: 1.0.3
26+
SemanticVersion: 1.0.4
2727
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/master/cloudwatchevents/guardduty
2828
SpdxLicenseId: Apache-2.0
2929

@@ -38,7 +38,7 @@ Resources:
3838
Properties:
3939
CodeUri: ../src/
4040
Handler: cloudwatchevents.handler
41-
Runtime: nodejs14.x
41+
Runtime: nodejs18.x
4242
Environment:
4343
Variables:
4444
SUMO_ENDPOINT: !Ref SumoEndpointUrl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
export AWS_PROFILE="prod"
4+
if [ "$AWS_PROFILE" == "prod" ]
5+
then
6+
SAM_S3_BUCKET="appdevstore"
7+
AWS_REGION="us-east-1"
8+
else
9+
SAM_S3_BUCKET="cf-templates-5d0x5unchag-us-east-2"
10+
AWS_REGION="us-east-2"
11+
fi
12+
13+
version="1.0.12"
14+
15+
echo "Creating package.yaml"
16+
sam package --template-file template_v2.yaml --s3-bucket $SAM_S3_BUCKET --output-template-file packaged.yaml --s3-prefix "guarddutybenchmark/v"$version --region $AWS_REGION --profile $AWS_PROFILE
17+
18+
echo "Publishing sumologic-guardduty-benchmark "$version
19+
sam publish --template packaged.yaml --region $AWS_REGION --semantic-version $version
20+
21+
echo "Published sumologic-guardduty-benchmark "$version
22+
# sam deploy --template-file packaged_sumo_app_utils.yaml --stack-name testingsumoapputils --capabilities CAPABILITY_IAM --region $AWS_REGION

cloudwatchevents/guarddutybenchmark/packaged.yaml

+15-5
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Metadata:
5353
- benchmark
5454
- guardduty
5555
Name: sumologic-guardduty-benchmark
56-
LicenseUrl: s3://appdevstore/guarddutybenchmark/v1.0.11/6092dd6c323e33634657102f570628e0
57-
ReadmeUrl: s3://appdevstore/guarddutybenchmark/v1.0.11/cab012d7fb7887671b751e6f5c0d2062
58-
SemanticVersion: 1.0.11
56+
LicenseUrl: s3://appdevstore/guarddutybenchmark/v1.0.12/6092dd6c323e33634657102f570628e0
57+
ReadmeUrl: s3://appdevstore/guarddutybenchmark/v1.0.12/cab012d7fb7887671b751e6f5c0d2062
58+
SemanticVersion: 1.0.12
5959
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/master/cloudwatchevents/guarddutybenchmark
6060
SpdxLicenseId: Apache-2.0
6161
Parameters:
@@ -96,7 +96,7 @@ Parameters:
9696
Resources:
9797
CloudWatchEventFunction:
9898
Properties:
99-
CodeUri: s3://appdevstore/guarddutybenchmark/v1.0.11/58c7f17decc811a6e8904a19a9f844a1
99+
CodeUri: s3://appdevstore/guarddutybenchmark/v1.0.12/22b7b226ca9ec3b9dbb28b94c0e5f824
100100
Environment:
101101
Variables:
102102
SUMO_ENDPOINT:
@@ -111,14 +111,18 @@ Resources:
111111
- aws.guardduty
112112
Type: CloudWatchEvent
113113
Handler: cloudwatchevents.handler
114-
Runtime: nodejs14.x
114+
Runtime: nodejs18.x
115115
Type: AWS::Serverless::Function
116+
Metadata:
117+
SamResourceId: CloudWatchEventFunction
116118
SumoAppUtils:
117119
Type: AWS::Serverless::Application
118120
Properties:
119121
Location:
120122
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-app-utils
121123
SemanticVersion: 2.0.6
124+
Metadata:
125+
SamResourceId: SumoAppUtils
122126
SumoHostedCollector:
123127
Type: Custom::Collector
124128
Properties:
@@ -139,6 +143,8 @@ Resources:
139143
Ref: SumoAccessKey
140144
SumoDeployment:
141145
Ref: SumoDeployment
146+
Metadata:
147+
SamResourceId: SumoHostedCollector
142148
SumoHTTPSource:
143149
Type: Custom::HTTPSource
144150
Properties:
@@ -166,6 +172,8 @@ Resources:
166172
Ref: SumoDeployment
167173
DateFormat: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
168174
DateLocatorRegex: .*"updatedAt":"(.*)".*
175+
Metadata:
176+
SamResourceId: SumoHTTPSource
169177
SumoGuardDutyBenchmarkApp:
170178
Type: Custom::App
171179
Properties:
@@ -188,6 +196,8 @@ Resources:
188196
Ref: SumoAccessKey
189197
SumoDeployment:
190198
Ref: SumoDeployment
199+
Metadata:
200+
SamResourceId: SumoGuardDutyBenchmarkApp
191201
Outputs:
192202
CloudWatchEventFunction:
193203
Description: CloudWatchEvent Processor Function ARN

cloudwatchevents/guarddutybenchmark/template_v2.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Metadata:
5656
Name: sumologic-guardduty-benchmark
5757
LicenseUrl: ../LICENSE
5858
ReadmeUrl: ./README.md
59-
SemanticVersion: 1.0.11
59+
SemanticVersion: 1.0.12
6060
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/master/cloudwatchevents/guarddutybenchmark
6161
SpdxLicenseId: Apache-2.0
6262

@@ -110,7 +110,7 @@ Resources:
110110
- aws.guardduty
111111
Type: CloudWatchEvent
112112
Handler: cloudwatchevents.handler
113-
Runtime: nodejs14.x
113+
Runtime: nodejs18.x
114114
Type: AWS::Serverless::Function
115115

116116
SumoAppUtils:

cloudwatchlogs-with-dlq/DLQLambdaCloudFormation.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@
5656
"eu-north-1": {"bucketname": "appdevzipfiles-eu-north-1s"},
5757
"eu-south-1": {"bucketname": "appdevzipfiles-eu-south-1"},
5858
"me-south-1": {"bucketname": "appdevzipfiles-me-south-1s"},
59-
"sa-east-1": {"bucketname": "appdevzipfiles-sa-east-1"}
59+
"sa-east-1": {"bucketname": "appdevzipfiles-sa-east-1"},
60+
"me-central-1": {"bucketname": "appdevzipfiles-me-central-1"},
61+
"eu-central-2": {"bucketname": "appdevzipfiles-eu-central-2ss"},
62+
"ap-northeast-3": {"bucketname": "appdevzipfiles-ap-northeast-3s"},
63+
"ap-southeast-3": {"bucketname": "appdevzipfiles-ap-southeast-3"}
6064
}
6165
},
6266
"Resources": {
@@ -224,7 +228,7 @@
224228
}
225229
},
226230
"Handler": "cloudwatchlogs_lambda.handler",
227-
"Runtime": "nodejs14.x",
231+
"Runtime": "nodejs16.x",
228232
"MemorySize": 128,
229233
"Environment": {
230234
"Variables": {
@@ -286,7 +290,7 @@
286290
]
287291
}
288292
},
289-
"Runtime": "nodejs14.x",
293+
"Runtime": "nodejs16.x",
290294
"MemorySize": 128,
291295
"Environment": {
292296
"Variables": {

cloudwatchlogs-with-dlq/DLQLambdaCloudFormationWithSecuredEndpoint.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@
5656
"eu-north-1": {"bucketname": "appdevzipfiles-eu-north-1s"},
5757
"eu-south-1": {"bucketname": "appdevzipfiles-eu-south-1"},
5858
"me-south-1": {"bucketname": "appdevzipfiles-me-south-1s"},
59-
"sa-east-1": {"bucketname": "appdevzipfiles-sa-east-1"}
59+
"sa-east-1": {"bucketname": "appdevzipfiles-sa-east-1"},
60+
"me-central-1": {"bucketname": "appdevzipfiles-me-central-1"},
61+
"eu-central-2": {"bucketname": "appdevzipfiles-eu-central-2ss"},
62+
"ap-northeast-3": {"bucketname": "appdevzipfiles-ap-northeast-3s"},
63+
"ap-southeast-3": {"bucketname": "appdevzipfiles-ap-southeast-3"}
6064
}
6165
},
6266
"Resources": {
@@ -266,7 +270,7 @@
266270
}
267271
},
268272
"Handler": "cloudwatchlogs_lambda.handler",
269-
"Runtime": "nodejs14.x",
273+
"Runtime": "nodejs16.x",
270274
"MemorySize": 128,
271275
"Environment": {
272276
"Variables": {
@@ -327,7 +331,7 @@
327331
]
328332
}
329333
},
330-
"Runtime": "nodejs14.x",
334+
"Runtime": "nodejs16.x",
331335
"MemorySize": 128,
332336
"Environment": {
333337
"Variables": {

deploy_function.py upload_artifacts.py

+36-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"ap-northeast-1",
1515
"ca-central-1",
1616
# "cn-north-1",
17-
# "ap-northeast-3", #giving errror
17+
"ap-northeast-3",
1818
"eu-central-1",
1919
"eu-west-1",
2020
"eu-west-2",
@@ -24,20 +24,48 @@
2424
"ap-east-1",
2525
"me-south-1",
2626
"eu-south-1",
27-
"af-south-1"
27+
"af-south-1",
28+
"me-central-1",
29+
"eu-central-2",
30+
"ap-southeast-3"
2831
]
2932

30-
31-
def get_bucket_name(bucket_prefix, region):
32-
if region in ("eu-north-1", "me-south-1", "ap-east-1", "af-south-1"):
33-
return '%s-%ss' % (bucket_prefix, region)
34-
return '%s-%s' % (bucket_prefix, region)
33+
region_map = {
34+
"us-east-1" : "appdevzipfiles-us-east-1",
35+
"us-east-2" : "appdevzipfiles-us-east-2",
36+
"us-west-1" : "appdevzipfiles-us-west-1",
37+
"us-west-2" : "appdevzipfiles-us-west-2",
38+
"ap-south-1": "appdevzipfiles-ap-south-1",
39+
"ap-northeast-2":"appdevzipfiles-ap-northeast-2",
40+
"ap-southeast-1":"appdevzipfiles-ap-southeast-1",
41+
"ap-southeast-2":"appdevzipfiles-ap-southeast-2",
42+
"ap-northeast-1":"appdevzipfiles-ap-northeast-1",
43+
"ca-central-1": "appdevzipfiles-ca-central-1",
44+
"eu-central-1":"appdevzipfiles-eu-central-1",
45+
"eu-west-1":"appdevzipfiles-eu-west-1",
46+
"eu-west-2":"appdevzipfiles-eu-west-2",
47+
"eu-west-3":"appdevzipfiles-eu-west-3",
48+
"eu-north-1":"appdevzipfiles-eu-north-1s",
49+
"sa-east-1":"appdevzipfiles-sa-east-1",
50+
"ap-east-1":"appdevzipfiles-ap-east-1s",
51+
"af-south-1":"appdevzipfiles-af-south-1s",
52+
"eu-south-1":"appdevzipfiles-eu-south-1",
53+
"me-south-1":"appdevzipfiles-me-south-1s",
54+
"me-central-1": "appdevzipfiles-me-central-1",
55+
"eu-central-2":"appdevzipfiles-eu-central-2ss",
56+
"ap-northeast-3" :"appdevzipfiles-ap-northeast-3s",
57+
"ap-southeast-3": "appdevzipfiles-ap-southeast-3"
58+
}
59+
60+
61+
def get_bucket_name(region):
62+
return region_map[region]
3563

3664

3765
def upload_code_in_multiple_regions(filepath, bucket_prefix):
3866

3967
for region in regions:
40-
upload_code_in_S3(filepath, get_bucket_name(bucket_prefix, region), region)
68+
upload_code_in_S3(filepath, get_bucket_name(region), region)
4169

4270

4371
def create_buckets(bucket_prefix):

0 commit comments

Comments
 (0)