Skip to content

Instantly share code, notes, and snippets.

@leikahing
Last active August 1, 2017 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leikahing/d69683b751c4b7cb8d8c113a2090c5f0 to your computer and use it in GitHub Desktop.
Save leikahing/d69683b751c4b7cb8d8c113a2090c5f0 to your computer and use it in GitHub Desktop.
Some powershell stuff
{
"formatVersion" : "v1.0",
"disclaimer" : "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/",
"offerCode" : "AmazonEC2",
"version" : "20170721022911",
"publicationDate" : "2017-07-21T02:29:11Z",
"products" : {
"76V3SF2FJC3ZR3GH" : {
"sku" : "76V3SF2FJC3ZR3GH",
"productFamily" : "Compute Instance",
"attributes" : {
"servicecode" : "AmazonEC2",
"location" : "Asia Pacific (Mumbai)",
"locationType" : "AWS Region",
"instanceType" : "d2.4xlarge",
"currentGeneration" : "Yes",
"instanceFamily" : "Storage optimized",
"vcpu" : "16",
"physicalProcessor" : "Intel Xeon E5-2676v3 (Haswell)",
"clockSpeed" : "2.4 GHz",
"memory" : "122 GiB",
"storage" : "12 x 2000 HDD",
"networkPerformance" : "High",
"processorArchitecture" : "64-bit",
"tenancy" : "Host",
"operatingSystem" : "Windows",
"licenseModel" : "License Included",
"usagetype" : "APS3-HostBoxUsage:d2.4xlarge",
"operation" : "RunInstances:0002",
"ecu" : "56",
"enhancedNetworkingSupported" : "Yes",
"preInstalledSw" : "NA",
"processorFeatures" : "Intel AVX; Intel AVX2; Intel Turbo"
}
},
"G2N9F3PVUVK8ZTGP" : {
"sku" : "G2N9F3PVUVK8ZTGP",
"productFamily" : "Compute Instance",
"attributes" : {
"servicecode" : "AmazonEC2",
"location" : "Asia Pacific (Seoul)",
"locationType" : "AWS Region",
"instanceType" : "i2.xlarge",
"currentGeneration" : "Yes",
"instanceFamily" : "Storage optimized",
"vcpu" : "4",
"physicalProcessor" : "Intel Xeon E5-2670 v2 (Ivy Bridge)",
"clockSpeed" : "2.5 GHz",
"memory" : "30.5 GiB",
"storage" : "1 x 800 SSD",
"networkPerformance" : "Moderate",
"processorArchitecture" : "64-bit",
"tenancy" : "Host",
"operatingSystem" : "Windows",
"licenseModel" : "License Included",
"usagetype" : "APN2-HostBoxUsage:i2.xlarge",
"operation" : "RunInstances:0102",
"ecu" : "27",
"enhancedNetworkingSupported" : "Yes",
"preInstalledSw" : "SQL Server Enterprise",
"processorFeatures" : "Intel AVX; Intel Turbo"
}
},
"KZMNEJ8BK92H85RK" : {
"sku" : "KZMNEJ8BK92H85RK",
"productFamily" : "Compute Instance",
"attributes" : {
"servicecode" : "AmazonEC2",
"location" : "Asia Pacific (Mumbai)",
"locationType" : "AWS Region",
"instanceType" : "i2.4xlarge",
"currentGeneration" : "Yes",
"instanceFamily" : "Storage optimized",
"vcpu" : "16",
"physicalProcessor" : "Intel Xeon E5-2670 v2 (Ivy Bridge)",
"clockSpeed" : "2.5 GHz",
"memory" : "122 GiB",
"storage" : "4 x 800 SSD",
"networkPerformance" : "High",
"processorArchitecture" : "64-bit",
"tenancy" : "Shared",
"operatingSystem" : "Windows",
"licenseModel" : "License Included",
"usagetype" : "APS3-BoxUsage:i2.4xlarge",
"operation" : "RunInstances:0202",
"ecu" : "53",
"enhancedNetworkingSupported" : "Yes",
"preInstalledSw" : "SQL Web",
"processorFeatures" : "Intel AVX; Intel Turbo"
}
}
}
}
$js = Get-Content -Raw -Path product.json | ConvertFrom-JSON
foreach ($productType in $js.products) {
$productSkus = $($group | Get-Member -MemberType *Property).Name
foreach ($sku in $productSkus) {
echo $js.products.$($sku).attributes.location
echo $js.products.$($sku).attributes.instanceType
# etc
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment