Skip to content

Commit ad34bcf

Browse files
authored
add: script to quickly fetch and compare layers in diffrent regions (#166)
* add: script to quickly fetch and compare layers in diffrent regions * remove verbose lines
1 parent cfdca5b commit ad34bcf

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

existing_layers/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.log

existing_layers/all_regions.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ap-south-2
2+
ap-south-1
3+
eu-south-1
4+
eu-south-2
5+
me-central-1
6+
ca-central-1
7+
eu-central-1
8+
eu-central-2
9+
us-west-1
10+
us-west-2
11+
af-south-1
12+
eu-north-1
13+
eu-west-3
14+
eu-west-2
15+
eu-west-1
16+
ap-northeast-3
17+
ap-northeast-2
18+
me-south-1
19+
ap-northeast-1
20+
sa-east-1
21+
ap-east-1
22+
ap-southeast-1
23+
ap-southeast-2
24+
ap-southeast-3
25+
ap-southeast-4
26+
us-east-1
27+
us-east-2

existing_layers/check_existing.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
find_all_regions() {
2+
aws-vault exec sso-prod-engineering -- aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName' >all_regions.txt
3+
}
4+
5+
find_layers_from_all_regions() {
6+
while IFS= read -r region; do
7+
aws-vault exec sso-prod-engineering -- aws lambda list-layers --region "$region" | grep LayerVersionArn | cut -d':' -f6- >all_layers_"$region".log
8+
done <all_regions.txt
9+
}
10+
11+
diff_from_useast1() {
12+
for f1 in all_layers_*.log; do
13+
diff --unified=0 "$f1" all_layers_us-east-1.log
14+
done | grep -vE "@@|Datadog-Trace-Forwarder-Python|Node8|metric|Node10|Node12|Python27|Python36|Ruby2-5" >all_diff.log # ignore deprecated layers
15+
}
16+
17+
"$@"

0 commit comments

Comments
 (0)