Skip to content

Commit 2f5f6db

Browse files
committed
Updating security hub layers in new aws regions
1 parent 5cfffd6 commit 2f5f6db

File tree

3 files changed

+51
-17
lines changed

3 files changed

+51
-17
lines changed

cloudwatchlogs-with-dlq/test_cwl_lambda.py

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,26 @@ def _parse_template(self, template):
167167

168168
def upload_code_in_multiple_regions():
169169
regions = [
170-
"us-east-2",
171-
"us-east-1",
172-
"us-west-1",
173-
"us-west-2",
174-
"ap-south-1",
175-
"ap-northeast-2",
176-
"ap-southeast-1",
177-
"ap-southeast-2",
178-
"ap-northeast-1",
179-
"ca-central-1",
180-
# "cn-north-1",
181-
"eu-central-1",
182-
"eu-west-1",
183-
"eu-west-2",
184-
"eu-west-3",
185-
"sa-east-1"
170+
"me-central-1",
171+
"eu-central-2",
172+
"ap-northeast-3",
173+
"ap-southeast-3"
174+
# "us-east-2",
175+
# "us-east-1",
176+
# "us-west-1",
177+
# "us-west-2",
178+
# "ap-south-1",
179+
# "ap-northeast-2",
180+
# "ap-southeast-1",
181+
# "ap-southeast-2",
182+
# "ap-northeast-1",
183+
# "ca-central-1",
184+
# # "cn-north-1",
185+
# "eu-central-1",
186+
# "eu-west-1",
187+
# "eu-west-2",
188+
# "eu-west-3",
189+
# "sa-east-1"
186190
]
187191

188192
# for region in regions:
@@ -191,9 +195,35 @@ def upload_code_in_multiple_regions():
191195
for region in regions:
192196
upload_code_in_S3(region)
193197

198+
region_map = {
199+
"us-east-1" : "appdevzipfiles-us-east-1",
200+
"us-east-2" : "appdevzipfiles-us-east-2",
201+
"us-west-1" : "appdevzipfiles-us-west-1",
202+
"us-west-2" : "appdevzipfiles-us-west-2",
203+
"ap-south-1": "appdevzipfiles-ap-south-1",
204+
"ap-northeast-2":"appdevzipfiles-ap-northeast-2",
205+
"ap-southeast-1":"appdevzipfiles-ap-southeast-1",
206+
"ap-southeast-2":"appdevzipfiles-ap-southeast-2",
207+
"ap-northeast-1":"appdevzipfiles-ap-northeast-1",
208+
"ca-central-1": "appdevzipfiles-ca-central-1",
209+
"eu-central-1":"appdevzipfiles-eu-central-1",
210+
"eu-west-1":"appdevzipfiles-eu-west-1",
211+
"eu-west-2":"appdevzipfiles-eu-west-2",
212+
"eu-west-3":"appdevzipfiles-eu-west-3",
213+
"eu-north-1":"appdevzipfiles-eu-north-1s",
214+
"sa-east-1":"appdevzipfiles-sa-east-1",
215+
"ap-east-1":"appdevzipfiles-ap-east-1s",
216+
"af-south-1":"appdevzipfiles-af-south-1s",
217+
"eu-south-1":"appdevzipfiles-eu-south-1",
218+
"me-south-1":"appdevzipfiles-me-south-1s",
219+
"me-central-1": "appdevzipfiles-me-central-1",
220+
"eu-central-2":"appdevzipfiles-eu-central-2",
221+
"ap-northeast-3" :"appdevzipfiles-ap-northeast-3",
222+
"ap-southeast-3": "appdevzipfiles-ap-southeast-3"
223+
}
194224

195225
def get_bucket_name(region):
196-
return '%s-%s' % (BUCKET_PREFIX, region)
226+
return region_map[region]
197227

198228

199229
def create_bucket(region):

securityhub-org/sumologic-securityhub-collector-awsorg/sam/create_layer.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ fi
1111

1212
declare -a regions=("us-east-2" "us-east-1" "us-west-1" "us-west-2" "ap-south-1" "ap-northeast-2" "ap-southeast-1" "ap-southeast-2" "ap-northeast-1" "ca-central-1" "eu-central-1" "eu-west-1" "eu-west-2" "eu-west-3" "sa-east-1")
1313

14+
# Buckets names that are different from region name (e.g appdevzipfiles-eu-north-1s) - eu-north-1 , ap-east-1, af-south-1, me-south-1
15+
1416
for i in "${regions[@]}"
1517
do
1618
echo "Deploying layer in $i"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
boto3==1.9.60
2+
requests==2.7.0

0 commit comments

Comments
 (0)