Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions existing_layers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
27 changes: 27 additions & 0 deletions existing_layers/all_regions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ap-south-2
ap-south-1
eu-south-1
eu-south-2
me-central-1
ca-central-1
eu-central-1
eu-central-2
us-west-1
us-west-2
af-south-1
eu-north-1
eu-west-3
eu-west-2
eu-west-1
ap-northeast-3
ap-northeast-2
me-south-1
ap-northeast-1
sa-east-1
ap-east-1
ap-southeast-1
ap-southeast-2
ap-southeast-3
ap-southeast-4
us-east-1
us-east-2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an automated way to generate this, since we will be adding more in the future. It would be a pain to have to update this one file every time we add a new region.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is done already in this function
https://github.com/DataDog/datadog-lambda-extension/pull/166/files#diff-260f0a0f31567ce6be2509b618b7298adfdb12ae2a72191a93f6b17d4cfb7827R1

I saved the file here since it doesn't happen very often

17 changes: 17 additions & 0 deletions existing_layers/check_existing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
find_all_regions() {
aws-vault exec sso-prod-engineering -- aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName' >all_regions.txt
}

find_layers_from_all_regions() {
while IFS= read -r region; do
aws-vault exec sso-prod-engineering -- aws lambda list-layers --region "$region" | grep LayerVersionArn | cut -d':' -f6- >all_layers_"$region".log
done <all_regions.txt
}

diff_from_useast1() {
for f1 in all_layers_*.log; do
diff --unified=0 "$f1" all_layers_us-east-1.log
done | grep -vE "@@|Datadog-Trace-Forwarder-Python|Node8|metric|Node10|Node12|Python27|Python36|Ruby2-5" >all_diff.log # ignore deprecated layers
}

"$@"