This repository was archived by the owner on Sep 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +479
-83
lines changed Expand file tree Collapse file tree 3 files changed +479
-83
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,6 @@ insert_final_newline = true
88
99[* .{yml,yaml} ]
1010indent_size = 2
11+
12+ [Makefile ]
13+ indent_style = tab
Original file line number Diff line number Diff line change 1+ .PHONY : list-instance-types list-latest-amis
2+
3+ list-instance-types :
4+ @instance_types=$$( \
5+ aws pricing get-attribute-values \
6+ --service-code AmazonEC2 \
7+ --attribute-name instanceType \
8+ --region us-east-1 \
9+ --query ' AttributeValues[].Value' \
10+ --output text \
11+ ); \
12+ for instance_type in $$ instance_types; do \
13+ printf ' - ' \' ' %s' \' ' \n' $$ instance_type; \
14+ done
15+
16+ list-latest-amis :
17+ @for region in $$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text ) ; do \
18+ ami_id=$$( \
19+ aws ec2 describe-images \
20+ --owners amazon \
21+ --filters ' Name=name,Values=amzn2-ami-hvm-*-gp2' \
22+ ' Name=image-type,Values=machine' \
23+ ' Name=virtualization-type,Values=hvm' \
24+ ' Name=architecture,Values=x86_64' \
25+ --region $$ region \
26+ --query ' reverse(sort_by(Images, &CreationDate))[0].ImageId' \
27+ --output text \
28+ ); \
29+ printf ' %s:\n %s: ' \' ' %s' \' ' \n' $$ region ' AmiId' $$ ami_id; \
30+ done
You can’t perform that action at this time.
0 commit comments