Created
November 5, 2024 11:56
-
-
Save rantoniuk/f9e6c05cb91ae3cfbb20fcdb38f34e19 to your computer and use it in GitHub Desktop.
Revisions
-
rantoniuk created this gist
Nov 5, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # Fetch EC2 Instance Prices for a region ```sh aws --region us-east-1 pricing get-products --service-code AmazonEC2 --filters \ "Type=TERM_MATCH,Field=capacitystatus,Value=Used" \ "Type=TERM_MATCH,Field=marketoption,Value=OnDemand" \ "Type=TERM_MATCH,Field=currentGeneration,Value=Yes" \ "Type=TERM_MATCH,Field=instanceType,Value=inf1.2xlarge" \ "Type=TERM_MATCH,Field=location,Value=US West (Oregon)" \ "Type=TERM_MATCH,Field=operatingSystem,Value=Linux" \ "Type=TERM_MATCH,Field=marketoption,Value=OnDemand" \ "Type=TERM_MATCH,Field=servicecode,Value=AmazonEC2" \ "Type=TERM_MATCH,Field=tenancy,Value=Shared" \ "Type=TERM_MATCH,Field=operation,Value=RunInstances" \ | jq -rc '.PriceList[]' | jq -c '[ .product.attributes.location, .product.attributes.instanceType, .product.attributes.operatingSystem, .product.attributes.memory, .product.attributes.physicalProcessor, .product.attributes.processorArchitecture, .product.attributes.vcpu, .terms.OnDemand[].priceDimensions[].description]' ["US West (Oregon)","inf1.2xlarge","Linux","16 GiB","Intel Xeon Platinum 8275CL (Cascade Lake)","64-bit","8","$0.362 per On Demand Linux inf1.2xlarge Instance Hour"] ``` In tabular format, add ` | @tsv`