This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
479 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ insert_final_newline = true | |
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab |
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,30 @@ | ||
.PHONY: list-instance-types list-latest-amis | ||
|
||
list-instance-types: | ||
@instance_types=$$( \ | ||
aws pricing get-attribute-values \ | ||
--service-code AmazonEC2 \ | ||
--attribute-name instanceType \ | ||
--region us-east-1 \ | ||
--query 'AttributeValues[].Value' \ | ||
--output text \ | ||
); \ | ||
for instance_type in $$instance_types; do \ | ||
printf ' - '\''%s'\''\n' $$instance_type; \ | ||
done | ||
|
||
list-latest-amis: | ||
@for region in $$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do \ | ||
ami_id=$$( \ | ||
aws ec2 describe-images \ | ||
--owners amazon \ | ||
--filters 'Name=name,Values=amzn2-ami-hvm-*-gp2' \ | ||
'Name=image-type,Values=machine' \ | ||
'Name=virtualization-type,Values=hvm' \ | ||
'Name=architecture,Values=x86_64' \ | ||
--region $$region \ | ||
--query 'reverse(sort_by(Images, &CreationDate))[0].ImageId' \ | ||
--output text \ | ||
); \ | ||
printf '%s:\n %s: '\''%s'\''\n' $$region 'AmiId' $$ami_id; \ | ||
done |
Oops, something went wrong.