-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hardcode AMIs for use in the bootstrap machine (#1153)
* With the current latest AL2023 image al2023-ami-2023.6.20241111.0-kernel-6.1-x86_64 npm install hangs indefinately. We are switching back to an older version that works and providing a way to incrementially update to AMIs that we have tested. * Add govcloud images * Update to 2023.6.20241031 source Signed-off-by: Peter Nied <[email protected]>
- Loading branch information
Showing
4 changed files
with
77 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# AMI name to look up | ||
AMI_NAME="al2023-ami-2023.6.20241031.0-kernel-6.1-x86_64" | ||
OWNER="amazon" | ||
|
||
# Get the list of all available AWS regions | ||
REGIONS=$(aws ec2 describe-regions --query "Regions[].RegionName" --output text) | ||
|
||
declare -A amiMap | ||
|
||
echo "Looking up AMI IDs for '$AMI_NAME' owned by '$OWNER' in all regions..." | ||
|
||
for region in $REGIONS; do | ||
echo "Searching in region: $region" | ||
ami_id=$(aws ec2 describe-images \ | ||
--region $region \ | ||
--owners $OWNER \ | ||
--filters "Name=name,Values=$AMI_NAME" \ | ||
--query "Images[0].ImageId" \ | ||
--output text) | ||
|
||
if [ "$ami_id" != "None" ]; then | ||
amiMap[$region]=$ami_id | ||
echo "Found AMI ID: $ami_id in region $region" | ||
else | ||
echo "No AMI found in region $region" | ||
fi | ||
done | ||
|
||
# Generate the AMI map as typescript | ||
echo "" | ||
echo "AMI Map:" | ||
echo "const amiMap = {" | ||
for region in "${!amiMap[@]}"; do | ||
echo " '$region': '${amiMap[$region]}'," | ||
done | ||
echo "};" |
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