Skip to content

Instantly share code, notes, and snippets.

@jcbf
Last active May 8, 2020 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jcbf/85486269f23c6b48921636688dfc44ea to your computer and use it in GitHub Desktop.
Save jcbf/85486269f23c6b48921636688dfc44ea to your computer and use it in GitHub Desktop.
get aws instance name and type
curl https://raw.githubusercontent.com/powdahound/ec2instances.info/master/www/instances.json | jq -r ' .[] | [ .instance_type , .pricing."eu-west-1".linux.ondemand , .pricing."eu-west-1".linux.reserved."yrTerm1Convertible.noUpfront"] | @csv' > prices.csv
head prices.csv
"c5d.xlarge","0.218","0.173"
"m5a.2xlarge","0.384","0.311"
"c5.9xlarge","1.728","1.369"
"m5.24xlarge","5.136","4.147"
"i3en.12xlarge","6","4.721"
"m5d.12xlarge","3.024","2.445"
"c5.large","0.096","0.076"
"c5n.large","0.122","0.097"
"i2.xlarge","0.938","0.532"
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | [ (.Tags[] | select(.Key == "Name").Value ), .InstanceType] | @csv' | sort
"infra:chef-server","t3.medium"
"infra:grafana-server","t3a.medium"
"infra:jenkins-server","t3.medium"
"infra:monitor-server","t3.medium"
"prod:ns21","t3.small"
"prod:ns22","t3.small"
"prod:ns23","t3.small"
"prod:ss1","t3a.micro"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment