-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add method for auto updating rdklib versions
- Loading branch information
1 parent
b6628ed
commit a851312
Showing
3 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
# This file should be updated to contain the latest stable Lambda layer from the rdklib SAM application | ||
# Layers are published to each region, which is why some have more versions than others | ||
|
||
# This file should be updated to contain the latest stable Lambda layer from the rdklib SAM application. | ||
# Layers are published to each region, which is why some have more versions than others. | ||
# This file was automatically generated by update_rdklib_versions.py; check for accuracy before deploying. | ||
rdklib_layer_versions: | ||
ap-southeast-1: "65" | ||
ap-south-1: "5" | ||
us-east-2: "5" | ||
us-east-1: "5" | ||
us-west-1: "4" | ||
us-west-2: "4" | ||
ap-northeast-2: "5" | ||
ap-southeast-2: "5" | ||
ap-northeast-1: "5" | ||
ca-central-1: "5" | ||
eu-central-1: "5" | ||
eu-west-1: "5" | ||
eu-west-2: "4" | ||
eu-west-3: "5" | ||
eu-north-1: "5" | ||
sa-east-1: "5" | ||
ap-northeast-1: 17 | ||
ap-northeast-2: 17 | ||
ap-south-1: 17 | ||
ap-southeast-1: 76 | ||
ap-southeast-2: 15 | ||
ca-central-1: 17 | ||
eu-central-1: 16 | ||
eu-north-1: 16 | ||
eu-west-1: 17 | ||
eu-west-2: 13 | ||
eu-west-3: 17 | ||
sa-east-1: 17 | ||
us-east-1: 18 | ||
us-east-2: 77 | ||
us-west-1: 15 | ||
us-west-2: 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import yaml | ||
import boto3 | ||
|
||
with open("rdk/rdklib_versions.yaml", "r") as f: | ||
# read the file | ||
regions = yaml.safe_load(f) | ||
|
||
version_dict = {"rdklib_layer_versions": {}} | ||
for region in regions["rdklib_layer_versions"]: | ||
lambda_client = boto3.client( | ||
"lambda", | ||
config=boto3.session.Config(region_name=region), | ||
) | ||
latest_version = lambda_client.list_layer_versions(LayerName="rdklib-layer", MaxItems=1)["LayerVersions"][0][ | ||
"Version" | ||
] | ||
version_dict["rdklib_layer_versions"][region] = latest_version | ||
|
||
with open("rdk/rdklib_versions.yaml", "w") as f: | ||
f.write( | ||
""" | ||
# This file should be updated to contain the latest stable Lambda layer from the rdklib SAM application. | ||
# Layers are published to each region, which is why some have more versions than others. | ||
# This file was automatically generated by update_rdklib_versions.py; check for accuracy before deploying. | ||
""" | ||
) | ||
f.write(yaml.dump(version_dict)) |