diff --git a/README.md b/README.md index 3f7db4d..a613ac2 100644 --- a/README.md +++ b/README.md @@ -564,6 +564,28 @@ $ cd amazon-ec2-instance-selector/ $ go run cmd/examples/example1.go [c4.large c5.large c5a.large c5ad.large c5d.large c6a.large c6i.large c6id.large c6in.large c7a.large c7i-flex.large c7i.large t2.medium t3.medium t3.small t3a.medium t3a.small] ``` +## Compare 2 instances to find exact differences + +Install and run this once: +``` +chmod a+x scripts/compare.sh + +``` +Next, you can use this script to select any 2 instance types and get a nice comparable UI with the differences highlighted. Comes in very handy to see the difference between new generations of the same instance families or successive instance sizes of the same family in terms of dimentions like EBS volume etc. + +#### Examples: + +``` +scripts/compare.sh c6i.large c5.large +``` +``` +scripts/compare.sh x2iedn.32xlarge x2iedn.24xlarge +``` +See public docs here: https://docs.aws.amazon.com/ec2/latest/instancetypes/ac.html + +Demo Image: +![image](./assets/image%20(14).png) + ## Building For build instructions please consult [BUILD.md](./BUILD.md). diff --git a/assets/image (14).png b/assets/image (14).png new file mode 100644 index 0000000..265bdcb Binary files /dev/null and b/assets/image (14).png differ diff --git a/scripts/compare.sh b/scripts/compare.sh new file mode 100755 index 0000000..cd93cbd --- /dev/null +++ b/scripts/compare.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Loop through all the arguments passed to the script +for arg in "$@" +do +# ec2-instance-selector -r us-west-2 -v --allow-list=$1 > /tmp/$1 2>/dev/null + if [ ! -f "/tmp/$arg" ]; then + # If the file doesn't exist, download + ec2-instance-selector -r us-west-2 -v --allow-list=$arg --price-per-hour-min 0 > /tmp/$arg 2>/dev/null + fi +done + +pushd . + +cd /tmp +vimdiff "$@" + +popd