From 9bd46a51d6574a55fe1a951848fb5b491f3ef88d Mon Sep 17 00:00:00 2001 From: Hoon Oh Date: Fri, 20 Nov 2020 19:23:35 +0900 Subject: [PATCH] feat: major update (#308) - add minimum vCPU, memory, reduceAZ and wide options - cli option names changed - cli output format changed - add region build script - add ec2-info build script - module response format changed BREAKING CHANGE: options & outputs changed --- .azure-pipelines-steps.yml | 27 +- .eslintrc.js | 10 +- .../{ec2-gen.yml => update-constants.yml} | 14 +- .gitignore | 2 + .pnp.js | 150 +- README.md | 123 +- aws-spot-price.code-workspace | 18 + docs/preview.svg | 235 +- package.json | 5 + scripts/generate-ec2-info.ts | 33 + scripts/generate-ec2-types.ts | 2 +- scripts/generate-regions.ts | 110 + scripts/generate-spot-prices-mock-data.ts | 4 +- sonar-project.properties | 1 + src/cli.spec.ts | 57 +- src/cli.ts | 190 +- src/constants/ec2-info.ts | 351 + src/constants/platform.ts | 25 + src/constants/product-description.ts | 25 - src/constants/regions.ts | 55 +- src/lib/core.spec.ts | 196 +- src/lib/core.ts | 297 +- src/lib/ui.spec.ts | 24 +- src/lib/ui.ts | 54 +- src/module.ts | 2 +- test/__snapshots__/cli.spec.ts.snap | 566 +- test/__snapshots__/lib/core.spec.ts.snap | 1943 +++- .../c1-medium.xml | 10 + .../dummy-large.xml | 92 + .../describe-instance-types-mocks/page1.xml | 9697 ++++++++++++++++ .../describe-instance-types-mocks/page2.xml | 9697 ++++++++++++++++ .../describe-instance-types-mocks/page3.xml | 9791 +++++++++++++++++ .../describe-instance-types-mocks/page4.xml | 4074 +++++++ .../t3a-nano.xml | 93 + test/{ => data}/spot-prices-mock.json | 4 +- test/mock-ec2-endpoints.ts | 144 +- tsconfig.build-types.json | 22 + tsconfig.json | 22 +- yarn.lock | 36 +- 39 files changed, 37332 insertions(+), 869 deletions(-) rename .github/workflows/{ec2-gen.yml => update-constants.yml} (69%) create mode 100644 scripts/generate-ec2-info.ts create mode 100644 scripts/generate-regions.ts create mode 100644 src/constants/ec2-info.ts create mode 100644 src/constants/platform.ts delete mode 100644 src/constants/product-description.ts create mode 100644 test/data/describe-instance-types-mocks/c1-medium.xml create mode 100644 test/data/describe-instance-types-mocks/dummy-large.xml create mode 100644 test/data/describe-instance-types-mocks/page1.xml create mode 100644 test/data/describe-instance-types-mocks/page2.xml create mode 100644 test/data/describe-instance-types-mocks/page3.xml create mode 100644 test/data/describe-instance-types-mocks/page4.xml create mode 100644 test/data/describe-instance-types-mocks/t3a-nano.xml rename test/{ => data}/spot-prices-mock.json (99%) create mode 100644 tsconfig.build-types.json diff --git a/.azure-pipelines-steps.yml b/.azure-pipelines-steps.yml index db547932..a41158dc 100644 --- a/.azure-pipelines-steps.yml +++ b/.azure-pipelines-steps.yml @@ -2,7 +2,7 @@ steps: - task: NodeTool@0 inputs: versionSpec: $(node_version) - displayName: "Install Node.js $(node_version)" + displayName: 'Install Node.js $(node_version)' - task: CacheBeta@0 inputs: @@ -11,41 +11,46 @@ steps: displayName: Cache Yarn packages - script: yarn --immutable - displayName: "Install dependencies" + displayName: 'Install dependencies' condition: ne(variables['node_version'], '8.x') - script: yarn build - displayName: "Build" + displayName: 'Build' condition: succeededOrFailed() # Check linting - script: yarn lint - displayName: "Check linting" + displayName: 'Check linting' condition: succeededOrFailed() # Check types - script: yarn types - displayName: "Check types" + displayName: 'Check types' + condition: succeededOrFailed() + + # Build types + - script: yarn build:types + displayName: 'Build types' condition: succeededOrFailed() # Run test:ci - script: yarn test:ci - displayName: "Run tests" + displayName: 'Run tests' condition: succeededOrFailed() # Publish CI test results - task: PublishTestResults@2 - displayName: "Publish test results" + displayName: 'Publish test results' condition: succeededOrFailed() inputs: testRunner: JUnit - testResultsFiles: "junit.xml" - testRunTitle: "CI Tests $(Agent.OS)" + testResultsFiles: 'junit.xml' + testRunTitle: 'CI Tests $(Agent.OS)' # Publish CI test coverage results - task: PublishCodeCoverageResults@1 - displayName: "Publish test coverage results" + displayName: 'Publish test coverage results' condition: succeededOrFailed() inputs: codeCoverageTool: Cobertura - summaryFileLocation: "$(Build.SourcesDirectory)/coverage/cobertura-coverage.xml" + summaryFileLocation: '$(Build.SourcesDirectory)/coverage/cobertura-coverage.xml' diff --git a/.eslintrc.js b/.eslintrc.js index e347c16c..ef3cf4e5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -20,13 +20,21 @@ module.exports = { 'prettier', 'prettier/@typescript-eslint', ], - plugins: ['@typescript-eslint', 'prettier'], + plugins: ['@typescript-eslint', 'prettier', 'unused-imports'], rules: { 'import/no-extraneous-dependencies': 0, 'import/prefer-default-export': 0, 'no-console': 0, 'no-param-reassign': 0, 'prettier/prettier': 'error', + + // eslint-plugin-unused-imports + '@typescript-eslint/no-unused-vars': 'off', + 'unused-imports/no-unused-imports-ts': 'error', + 'unused-imports/no-unused-vars-ts': [ + 'warn', + { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }, + ], }, overrides: [ { diff --git a/.github/workflows/ec2-gen.yml b/.github/workflows/update-constants.yml similarity index 69% rename from .github/workflows/ec2-gen.yml rename to .github/workflows/update-constants.yml index b92b0c3b..f45a2937 100644 --- a/.github/workflows/ec2-gen.yml +++ b/.github/workflows/update-constants.yml @@ -1,4 +1,4 @@ -name: keep ec2 types up to date +name: update constants on: schedule: @@ -14,12 +14,24 @@ jobs: - name: Install dependencies run: yarn --immutable + - name: Generate regions + run: yarn build:regions + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Generate ec2-types run: yarn build:ec2-types env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Generate ec2-info + run: yarn build:ec2-info + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build run: yarn build diff --git a/.gitignore b/.gitignore index c2fc0365..f07ed11a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ dist junit.xml node_modules types +webpack-status.json +coverage diff --git a/.pnp.js b/.pnp.js index 3e2cc764..4c0ae33d 100755 --- a/.pnp.js +++ b/.pnp.js @@ -64,6 +64,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-import", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:2.22.1"], ["eslint-plugin-jest", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:24.1.3"], ["eslint-plugin-prettier", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:3.1.4"], + ["eslint-plugin-unused-imports", "npm:1.0.0"], ["husky", "npm:4.3.0"], ["import-sort-style-module", "npm:6.0.0"], ["jest", "npm:26.6.3"], @@ -2235,7 +2236,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@typescript-eslint/eslint-plugin", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:4.7.0"], ["@types/eslint", null], ["@types/typescript-eslint__parser", null], - ["@typescript-eslint/experimental-utils", "virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:4.7.0"], + ["@typescript-eslint/experimental-utils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:4.7.0"], ["@typescript-eslint/parser", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:4.7.0"], ["@typescript-eslint/scope-manager", "npm:4.7.0"], ["debug", "virtual:88318143fb6d80d1f55c54ae799fe6cfcf29c86ca9b9dae7a485ec5bdb22c3a20f79119854bb9696c57b5a03879e8671e3e9d39fcd8ca2cec3e6655f73233a79#npm:4.1.1"], @@ -2243,7 +2244,33 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["functional-red-black-tree", "npm:1.0.1"], ["regexpp", "npm:3.0.0"], ["semver", "npm:7.3.2"], - ["tsutils", "virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:3.17.1"], + ["tsutils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:3.17.1"], + ["typescript", "patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698"] + ], + "packagePeers": [ + "@types/eslint", + "@types/typescript-eslint__parser", + "@typescript-eslint/parser", + "eslint", + "typescript" + ], + "linkType": "HARD", + }], + ["virtual:ce8b0a24b11942c46d350c6e9ab28c348d7cb98ef3c97be30b086a604a7447b860e18b50a925ea7709926d63a9e5252d4d5c96ff27f6cbcbd159343e1d4c96ec#npm:4.7.0", { + "packageLocation": "./.yarn/$$virtual/@typescript-eslint-eslint-plugin-virtual-58752c3151/0/cache/@typescript-eslint-eslint-plugin-npm-4.7.0-19037dfb47-5be169b674.zip/node_modules/@typescript-eslint/eslint-plugin/", + "packageDependencies": [ + ["@typescript-eslint/eslint-plugin", "virtual:ce8b0a24b11942c46d350c6e9ab28c348d7cb98ef3c97be30b086a604a7447b860e18b50a925ea7709926d63a9e5252d4d5c96ff27f6cbcbd159343e1d4c96ec#npm:4.7.0"], + ["@types/eslint", null], + ["@types/typescript-eslint__parser", null], + ["@typescript-eslint/experimental-utils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:4.7.0"], + ["@typescript-eslint/parser", null], + ["@typescript-eslint/scope-manager", "npm:4.7.0"], + ["debug", "virtual:88318143fb6d80d1f55c54ae799fe6cfcf29c86ca9b9dae7a485ec5bdb22c3a20f79119854bb9696c57b5a03879e8671e3e9d39fcd8ca2cec3e6655f73233a79#npm:4.1.1"], + ["eslint", "npm:7.13.0"], + ["functional-red-black-tree", "npm:1.0.1"], + ["regexpp", "npm:3.0.0"], + ["semver", "npm:7.3.2"], + ["tsutils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:3.17.1"], ["typescript", "patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698"] ], "packagePeers": [ @@ -2257,15 +2284,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }] ]], ["@typescript-eslint/experimental-utils", [ - ["virtual:706a14e2f19a29e07a8464790a1880b4b51a29f85b38717db5842e194a737634473d9033aac26475b645a027a78a2953a446f7e94d2390e5287648fdfcc20aff#npm:4.0.1", { - "packageLocation": "./.yarn/$$virtual/@typescript-eslint-experimental-utils-virtual-6fa2176019/0/cache/@typescript-eslint-experimental-utils-npm-4.0.1-74e1bc0e97-6af430c0d5.zip/node_modules/@typescript-eslint/experimental-utils/", + ["virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:4.7.0", { + "packageLocation": "./.yarn/$$virtual/@typescript-eslint-experimental-utils-virtual-a58cf328d4/0/cache/@typescript-eslint-experimental-utils-npm-4.7.0-0efcf3c97b-a8526c3daf.zip/node_modules/@typescript-eslint/experimental-utils/", "packageDependencies": [ - ["@typescript-eslint/experimental-utils", "virtual:706a14e2f19a29e07a8464790a1880b4b51a29f85b38717db5842e194a737634473d9033aac26475b645a027a78a2953a446f7e94d2390e5287648fdfcc20aff#npm:4.0.1"], + ["@typescript-eslint/experimental-utils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:4.7.0"], ["@types/eslint", null], ["@types/json-schema", "npm:7.0.4"], - ["@typescript-eslint/scope-manager", "npm:4.0.1"], - ["@typescript-eslint/types", "npm:4.0.1"], - ["@typescript-eslint/typescript-estree", "virtual:6fa21760194820df0514250c16b576a3b6c5eef7f2ee78856e29196b67b8a4485cbae6dfad3ca98e72a34281096520e992e879fc72db33d749ae4a587be5a49e#npm:4.0.1"], + ["@typescript-eslint/scope-manager", "npm:4.7.0"], + ["@typescript-eslint/types", "npm:4.7.0"], + ["@typescript-eslint/typescript-estree", "virtual:a58cf328d4993d1c6258bf5a67ae7c3edd004d541f6b347899af10dc308603eeeb0fb95bdcc0236bf5f6ecfa1cb091474c469e1af2901a803e53121436da332b#npm:4.7.0"], ["eslint", "npm:7.13.0"], ["eslint-scope", "npm:5.0.0"], ["eslint-utils", "npm:2.0.0"] @@ -2276,15 +2303,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ], "linkType": "HARD", }], - ["virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:4.7.0", { - "packageLocation": "./.yarn/$$virtual/@typescript-eslint-experimental-utils-virtual-3d59d9a907/0/cache/@typescript-eslint-experimental-utils-npm-4.7.0-0efcf3c97b-a8526c3daf.zip/node_modules/@typescript-eslint/experimental-utils/", + ["virtual:706a14e2f19a29e07a8464790a1880b4b51a29f85b38717db5842e194a737634473d9033aac26475b645a027a78a2953a446f7e94d2390e5287648fdfcc20aff#npm:4.0.1", { + "packageLocation": "./.yarn/$$virtual/@typescript-eslint-experimental-utils-virtual-6fa2176019/0/cache/@typescript-eslint-experimental-utils-npm-4.0.1-74e1bc0e97-6af430c0d5.zip/node_modules/@typescript-eslint/experimental-utils/", "packageDependencies": [ - ["@typescript-eslint/experimental-utils", "virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:4.7.0"], + ["@typescript-eslint/experimental-utils", "virtual:706a14e2f19a29e07a8464790a1880b4b51a29f85b38717db5842e194a737634473d9033aac26475b645a027a78a2953a446f7e94d2390e5287648fdfcc20aff#npm:4.0.1"], ["@types/eslint", null], ["@types/json-schema", "npm:7.0.4"], - ["@typescript-eslint/scope-manager", "npm:4.7.0"], - ["@typescript-eslint/types", "npm:4.7.0"], - ["@typescript-eslint/typescript-estree", "virtual:3d59d9a90788264a79d6bfe3b4fd9cfeace174e708acb2d18870f657de3b3a25b7266541977b980f50b51e73d3b83ee4e703f0ba7dff3828c0fc696295f35580#npm:4.7.0"], + ["@typescript-eslint/scope-manager", "npm:4.0.1"], + ["@typescript-eslint/types", "npm:4.0.1"], + ["@typescript-eslint/typescript-estree", "virtual:6fa21760194820df0514250c16b576a3b6c5eef7f2ee78856e29196b67b8a4485cbae6dfad3ca98e72a34281096520e992e879fc72db33d749ae4a587be5a49e#npm:4.0.1"], ["eslint", "npm:7.13.0"], ["eslint-scope", "npm:5.0.0"], ["eslint-utils", "npm:2.0.0"] @@ -2389,25 +2416,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }] ]], ["@typescript-eslint/typescript-estree", [ - ["virtual:3d59d9a90788264a79d6bfe3b4fd9cfeace174e708acb2d18870f657de3b3a25b7266541977b980f50b51e73d3b83ee4e703f0ba7dff3828c0fc696295f35580#npm:4.7.0", { - "packageLocation": "./.yarn/$$virtual/@typescript-eslint-typescript-estree-virtual-c99062c9ad/0/cache/@typescript-eslint-typescript-estree-npm-4.7.0-615fd5d216-da0564b8df.zip/node_modules/@typescript-eslint/typescript-estree/", - "packageDependencies": [ - ["@typescript-eslint/typescript-estree", "virtual:3d59d9a90788264a79d6bfe3b4fd9cfeace174e708acb2d18870f657de3b3a25b7266541977b980f50b51e73d3b83ee4e703f0ba7dff3828c0fc696295f35580#npm:4.7.0"], - ["@typescript-eslint/types", "npm:4.7.0"], - ["@typescript-eslint/visitor-keys", "npm:4.7.0"], - ["debug", "virtual:88318143fb6d80d1f55c54ae799fe6cfcf29c86ca9b9dae7a485ec5bdb22c3a20f79119854bb9696c57b5a03879e8671e3e9d39fcd8ca2cec3e6655f73233a79#npm:4.1.1"], - ["globby", "npm:11.0.1"], - ["is-glob", "npm:4.0.1"], - ["lodash", "npm:4.17.15"], - ["semver", "npm:7.3.2"], - ["tsutils", "virtual:c99062c9ad858a904a1be2c24507ebda0a13faa4487021d0bbc5fc83f8c5bc5aaf65abb4d94a4313725e4540992809749ba2d7e6456626a58dc74d9893387143#npm:3.17.1"], - ["typescript", null] - ], - "packagePeers": [ - "typescript" - ], - "linkType": "HARD", - }], ["virtual:603ca3ff20b1d4988cca2d3d7314bc535b4229baf7c3fd643ba37fc825d9f98b656fc4d54144b903bb4b15c9c09b853f8cf719afcf13a778601aef23fb76fd08#npm:4.7.0", { "packageLocation": "./.yarn/$$virtual/@typescript-eslint-typescript-estree-virtual-9704e9dfef/0/cache/@typescript-eslint-typescript-estree-npm-4.7.0-615fd5d216-da0564b8df.zip/node_modules/@typescript-eslint/typescript-estree/", "packageDependencies": [ @@ -2419,7 +2427,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["is-glob", "npm:4.0.1"], ["lodash", "npm:4.17.15"], ["semver", "npm:7.3.2"], - ["tsutils", "virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:3.17.1"], + ["tsutils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:3.17.1"], ["typescript", "patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698"] ], "packagePeers": [ @@ -2438,7 +2446,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["is-glob", "npm:4.0.1"], ["lodash", "npm:4.17.15"], ["semver", "npm:7.3.2"], - ["tsutils", "virtual:c99062c9ad858a904a1be2c24507ebda0a13faa4487021d0bbc5fc83f8c5bc5aaf65abb4d94a4313725e4540992809749ba2d7e6456626a58dc74d9893387143#npm:3.17.1"], + ["tsutils", "virtual:c932e64322fafed15845fb1e4ef8971f42cfeef990e319ee52c33c47f315786f9b3762d0b20b09af59e63c3cc876b32d1b93f5d1742e9c92bc7367b317687020#npm:3.17.1"], ["typescript", null] ], "packagePeers": [ @@ -2457,7 +2465,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["is-glob", "npm:4.0.1"], ["lodash", "npm:4.17.15"], ["semver", "npm:7.3.2"], - ["tsutils", "virtual:c99062c9ad858a904a1be2c24507ebda0a13faa4487021d0bbc5fc83f8c5bc5aaf65abb4d94a4313725e4540992809749ba2d7e6456626a58dc74d9893387143#npm:3.17.1"], + ["tsutils", "virtual:c932e64322fafed15845fb1e4ef8971f42cfeef990e319ee52c33c47f315786f9b3762d0b20b09af59e63c3cc876b32d1b93f5d1742e9c92bc7367b317687020#npm:3.17.1"], + ["typescript", null] + ], + "packagePeers": [ + "typescript" + ], + "linkType": "HARD", + }], + ["virtual:a58cf328d4993d1c6258bf5a67ae7c3edd004d541f6b347899af10dc308603eeeb0fb95bdcc0236bf5f6ecfa1cb091474c469e1af2901a803e53121436da332b#npm:4.7.0", { + "packageLocation": "./.yarn/$$virtual/@typescript-eslint-typescript-estree-virtual-c932e64322/0/cache/@typescript-eslint-typescript-estree-npm-4.7.0-615fd5d216-da0564b8df.zip/node_modules/@typescript-eslint/typescript-estree/", + "packageDependencies": [ + ["@typescript-eslint/typescript-estree", "virtual:a58cf328d4993d1c6258bf5a67ae7c3edd004d541f6b347899af10dc308603eeeb0fb95bdcc0236bf5f6ecfa1cb091474c469e1af2901a803e53121436da332b#npm:4.7.0"], + ["@typescript-eslint/types", "npm:4.7.0"], + ["@typescript-eslint/visitor-keys", "npm:4.7.0"], + ["debug", "virtual:88318143fb6d80d1f55c54ae799fe6cfcf29c86ca9b9dae7a485ec5bdb22c3a20f79119854bb9696c57b5a03879e8671e3e9d39fcd8ca2cec3e6655f73233a79#npm:4.1.1"], + ["globby", "npm:11.0.1"], + ["is-glob", "npm:4.0.1"], + ["lodash", "npm:4.17.15"], + ["semver", "npm:7.3.2"], + ["tsutils", "virtual:c932e64322fafed15845fb1e4ef8971f42cfeef990e319ee52c33c47f315786f9b3762d0b20b09af59e63c3cc876b32d1b93f5d1742e9c92bc7367b317687020#npm:3.17.1"], ["typescript", null] ], "packagePeers": [ @@ -3410,6 +3437,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-import", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:2.22.1"], ["eslint-plugin-jest", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:24.1.3"], ["eslint-plugin-prettier", "virtual:4bc879ee8766b5c64a944ba0314247e9ed208a36cde6f3dfba54d4d0d0819032f13bd0f310835cb3c506c634c8bd0ab2b4fed2c45686f55fb51dc017ab534de4#npm:3.1.4"], + ["eslint-plugin-unused-imports", "npm:1.0.0"], ["husky", "npm:4.3.0"], ["import-sort-style-module", "npm:6.0.0"], ["jest", "npm:26.6.3"], @@ -4933,14 +4961,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ]], ["core-js", [ ["npm:2.6.11", { - "packageLocation": "./.yarn/cache/core-js-npm-2.6.11-15178ded27-39ad00b46d.zip/node_modules/core-js/", + "packageLocation": "./.yarn/unplugged/core-js-npm-2.6.11-15178ded27/node_modules/core-js/", "packageDependencies": [ ["core-js", "npm:2.6.11"] ], "linkType": "HARD", }], ["npm:3.6.5", { - "packageLocation": "./.yarn/cache/core-js-npm-3.6.5-5941340066-9283348dd5.zip/node_modules/core-js/", + "packageLocation": "./.yarn/unplugged/core-js-npm-3.6.5-5941340066/node_modules/core-js/", "packageDependencies": [ ["core-js", "npm:3.6.5"] ], @@ -6111,6 +6139,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["eslint-plugin-unused-imports", [ + ["npm:1.0.0", { + "packageLocation": "./.yarn/cache/eslint-plugin-unused-imports-npm-1.0.0-ce8b0a24b1-1363c98502.zip/node_modules/eslint-plugin-unused-imports/", + "packageDependencies": [ + ["eslint-plugin-unused-imports", "npm:1.0.0"], + ["@typescript-eslint/eslint-plugin", "virtual:ce8b0a24b11942c46d350c6e9ab28c348d7cb98ef3c97be30b086a604a7447b860e18b50a925ea7709926d63a9e5252d4d5c96ff27f6cbcbd159343e1d4c96ec#npm:4.7.0"], + ["eslint", "npm:7.13.0"], + ["eslint-rule-composer", "npm:0.3.0"], + ["requireindex", "npm:1.2.0"], + ["typescript", "patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698"] + ], + "linkType": "HARD", + }] + ]], + ["eslint-rule-composer", [ + ["npm:0.3.0", { + "packageLocation": "./.yarn/cache/eslint-rule-composer-npm-0.3.0-0188afafaa-eb96fffa4e.zip/node_modules/eslint-rule-composer/", + "packageDependencies": [ + ["eslint-rule-composer", "npm:0.3.0"] + ], + "linkType": "HARD", + }] + ]], ["eslint-scope", [ ["npm:5.0.0", { "packageLocation": "./.yarn/cache/eslint-scope-npm-5.0.0-16bd164da6-296e85c180.zip/node_modules/eslint-scope/", @@ -7578,7 +7629,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ]], ["husky", [ ["npm:4.3.0", { - "packageLocation": "./.yarn/cache/husky-npm-4.3.0-b6c2d49d0e-c212d9732d.zip/node_modules/husky/", + "packageLocation": "./.yarn/unplugged/husky-npm-4.3.0-b6c2d49d0e/node_modules/husky/", "packageDependencies": [ ["husky", "npm:4.3.0"], ["chalk", "npm:4.0.0"], @@ -13076,6 +13127,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["requireindex", [ + ["npm:1.2.0", { + "packageLocation": "./.yarn/cache/requireindex-npm-1.2.0-483c52ddaf-a6c6c2edd4.zip/node_modules/requireindex/", + "packageDependencies": [ + ["requireindex", "npm:1.2.0"] + ], + "linkType": "HARD", + }] + ]], ["resolve", [ ["patch:resolve@npm%3A1.12.0#builtin::version=1.12.0&hash=3388aa", { "packageLocation": "./.yarn/cache/resolve-patch-9273dccad7-4ca42e21c6.zip/node_modules/resolve/", @@ -14886,10 +14946,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }] ]], ["tsutils", [ - ["virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:3.17.1", { - "packageLocation": "./.yarn/$$virtual/tsutils-virtual-dc674a93f7/0/cache/tsutils-npm-3.17.1-ed6df1e57e-bed8ff7998.zip/node_modules/tsutils/", + ["virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:3.17.1", { + "packageLocation": "./.yarn/$$virtual/tsutils-virtual-531beb322e/0/cache/tsutils-npm-3.17.1-ed6df1e57e-bed8ff7998.zip/node_modules/tsutils/", "packageDependencies": [ - ["tsutils", "virtual:b3871db94f6243d2dc308dc6b758585d68bd123b7a3026323a5bcca6ed4b2c535130c68814d62bca4538a4f5ac517d47104947448664f80664eaf02a67d56be5#npm:3.17.1"], + ["tsutils", "virtual:58752c3151458959f2262c4350b4bd4a7b7622dda6a37cf53d11365c6ed24c00bdf4f96328eecdbe2ca7353b2701949af913f05b298427727bb9baa9284a4fb3#npm:3.17.1"], ["@types/typescript", null], ["tslib", "npm:1.11.0"], ["typescript", "patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698"] @@ -14900,10 +14960,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ], "linkType": "HARD", }], - ["virtual:c99062c9ad858a904a1be2c24507ebda0a13faa4487021d0bbc5fc83f8c5bc5aaf65abb4d94a4313725e4540992809749ba2d7e6456626a58dc74d9893387143#npm:3.17.1", { - "packageLocation": "./.yarn/$$virtual/tsutils-virtual-d7283b7c85/0/cache/tsutils-npm-3.17.1-ed6df1e57e-bed8ff7998.zip/node_modules/tsutils/", + ["virtual:c932e64322fafed15845fb1e4ef8971f42cfeef990e319ee52c33c47f315786f9b3762d0b20b09af59e63c3cc876b32d1b93f5d1742e9c92bc7367b317687020#npm:3.17.1", { + "packageLocation": "./.yarn/$$virtual/tsutils-virtual-db546d7fc0/0/cache/tsutils-npm-3.17.1-ed6df1e57e-bed8ff7998.zip/node_modules/tsutils/", "packageDependencies": [ - ["tsutils", "virtual:c99062c9ad858a904a1be2c24507ebda0a13faa4487021d0bbc5fc83f8c5bc5aaf65abb4d94a4313725e4540992809749ba2d7e6456626a58dc74d9893387143#npm:3.17.1"], + ["tsutils", "virtual:c932e64322fafed15845fb1e4ef8971f42cfeef990e319ee52c33c47f315786f9b3762d0b20b09af59e63c3cc876b32d1b93f5d1742e9c92bc7367b317687020#npm:3.17.1"], ["@types/typescript", null], ["tslib", "npm:1.11.0"], ["typescript", null] diff --git a/README.md b/README.md index f6406018..3b73a14a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Supports CLI and module usage. `aws-spot-run [options]` -If no options are applied, it will fetch all recent pricing data from default regions and show top 20 cheapest instances. +If no options are applied, it will fetch all recent pricing data from default regions and show top 30 cheapest instances. #### Credentials @@ -52,38 +52,80 @@ Start with UI mode. AWS region to fetch data from. Accepts multiple string values. Defaults to all available AWS region which does not require opt-in. +###### _example `-r us-east-1 us-east-2`_ + ##### --family EC2 instance families to filter. Will be translated to `--familyType` and `--size` values. Accepts multiple string values. Choose from: `general`, `compute`, `memory`, `storage`, `acceleratedComputing` +###### _example `-f general compute`_ + ##### --instanceType | -i Type of EC2 instance to filter. Accepts multiple string values. -Enter valid EC2 instance type name. e.g. `-i t3.nano t3a.nano` +Enter valid EC2 instance type name. + +###### _example `-i t3.nano t3a.nano`_ ##### --familyType | -f EC2 Family type (`c4`, `c5`, etc..). Accepts multiple string values. +###### _example `-f c4 c5`_ + ##### --size | -s EC2 size (`large`, `xlarge`, etc..). Accepts multiple string values. -##### --priceMax | -p +###### _example `-s large xlarge`_ + +##### --minVCPU | --mc + +Minimum vCPU count + +###### _Default: 1_ + +##### --minMemoryGiB | --mm + +Minimum memory size in GiB + +###### _Default: 0.5_ + +##### --priceLimit | --pl -Maximum price. +Maximum price limit. -##### --productDescription | -d +###### _Default: 100_ -Instance product description to filter. Accepts multiple string values. +##### --platforms | -p + +Instance platforms types to filter. Accepts multiple string values. You can use `linux` or `windows` (all in lowercase) as wildcard. +###### _Default: "Linux/UNIX" "Linux/UNIX (Amazon VPC)"_ + +###### _example `-p windows "Red Hat Enterprise Linux"`_ + ##### --limit | -l Limits list of price information items to be returned. +###### _Default: 30_ + +##### --reduceAZ | --raz + +Reduce results with cheapest Availability Zone within Region + +###### _Default: true_ + +##### --wide | -w + +Output results with detail (vCPU, memory, etc) + +###### _Default: false_ + ##### --json | -j Outputs in JSON format. This option will silence any progress output. @@ -118,9 +160,11 @@ import { getGlobalSpotPrices } from 'aws-spot-price'; (async () => { const results = await getGlobalSpotPrices({ regions: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2'], - familyTypes: ['c3', 'c4', 'c5'], - sizes: ['large', 'medium', 'xlarge'], + familyTypes: ['c5', 'c5a', 'c5ad', 'c5d', 'c5n', 'c6g', 'c6gd'], + minMemoryGiB: 4, + minVCPU: 2, limit: 5, + reduceAZ: true, }); console.log(JSON.stringify(results, null, 2)); })(); @@ -128,42 +172,51 @@ import { getGlobalSpotPrices } from 'aws-spot-price'; #### Results -```json -[ +```json[ { - "AvailabilityZone": "us-east-2a", - "InstanceType": "c4.large", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.018100", - "Timestamp": "2019-11-05T03:07:19.000Z" + "availabilityZone": "us-east-2c", + "instanceType": "c5.large", + "platform": "Linux/UNIX", + "spotPrice": 0.019, + "timestamp": "2020-11-19T15:18:07.000Z", + "vCpu": 2, + "memoryGiB": 4 }, { - "AvailabilityZone": "us-east-2c", - "InstanceType": "c4.large", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.018100", - "Timestamp": "2019-11-05T03:07:19.000Z" + "availabilityZone": "us-east-2c", + "instanceType": "c5a.large", + "platform": "Linux/UNIX", + "spotPrice": 0.019, + "timestamp": "2020-11-19T22:04:26.000Z", + "vCpu": 2, + "memoryGiB": 4 }, { - "AvailabilityZone": "us-east-2a", - "InstanceType": "c5.large", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.019000", - "Timestamp": "2019-11-04T14:51:42.000Z" + "availabilityZone": "us-east-2a", + "instanceType": "c5d.large", + "platform": "Linux/UNIX", + "spotPrice": 0.019, + "timestamp": "2020-11-19T05:58:45.000Z", + "vCpu": 2, + "memoryGiB": 4 }, { - "AvailabilityZone": "us-east-2c", - "InstanceType": "c5.large", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.019000", - "Timestamp": "2019-11-04T14:51:42.000Z" + "availabilityZone": "us-east-2a", + "instanceType": "c5n.large", + "platform": "Linux/UNIX", + "spotPrice": 0.019, + "timestamp": "2020-11-20T02:27:24.000Z", + "vCpu": 2, + "memoryGiB": 5.25 }, { - "AvailabilityZone": "us-east-2b", - "InstanceType": "c5.large", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.019300", - "Timestamp": "2019-11-04T14:51:42.000Z" + "availabilityZone": "us-east-2b", + "instanceType": "c6g.large", + "platform": "Linux/UNIX", + "spotPrice": 0.02, + "timestamp": "2020-11-19T13:41:03.000Z", + "vCpu": 2, + "memoryGiB": 4 } ] ``` diff --git a/aws-spot-price.code-workspace b/aws-spot-price.code-workspace index ea333260..6b300e26 100644 --- a/aws-spot-price.code-workspace +++ b/aws-spot-price.code-workspace @@ -11,6 +11,7 @@ "prettier.prettierPath": ".yarn/sdks/prettier/index.js", // editor + "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "editor.rulers": [100], "editor.tabSize": 2, "editor.formatOnSave": true, @@ -24,6 +25,23 @@ }, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/**": true, + "**/.hg/store/**": true, + ".pnp.js": true + }, + + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/*.code-search": true, + ".yarn": true, + ".pnp.js": true, + "yarn.lock": true } }, diff --git a/docs/preview.svg b/docs/preview.svg index 9da181ee..4a1951b5 100644 --- a/docs/preview.svg +++ b/docs/preview.svg @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/package.json b/package.json index 23dfd2eb..9543ac7b 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,12 @@ "scripts": { "prepublishOnly": "yarn clean && yarn build && yarn types", "clean": "rm -rf dist && rm -rf types && rm -rf coverage", + "build:ec2-info": "ts-node -T scripts/generate-ec2-info.ts", "build:ec2-types": "ts-node -T scripts/generate-ec2-types.ts", + "build:regions": "ts-node -T scripts/generate-regions.ts", + "build:types": "tsc -p tsconfig.build-types.json", "build": "webpack", + "build:analyze": "yarn build --profile --json > webpack-status.json && yarn dlx webpack-bundle-analyzer webpack-status.json", "changelog": "conventional-changelog -i CHANGELOG.md -s -p angular", "test": "jest --runInBand --verbose", "test:coverage": "yarn test --coverage", @@ -132,6 +136,7 @@ "eslint-plugin-import": "2.22.1", "eslint-plugin-jest": "24.1.3", "eslint-plugin-prettier": "3.1.4", + "eslint-plugin-unused-imports": "^1.0.0", "husky": "4.3.0", "import-sort-style-module": "6.0.0", "jest": "26.6.3", diff --git a/scripts/generate-ec2-info.ts b/scripts/generate-ec2-info.ts new file mode 100644 index 00000000..20cc97c4 --- /dev/null +++ b/scripts/generate-ec2-info.ts @@ -0,0 +1,33 @@ +import { writeFileSync } from 'fs'; +import { resolve } from 'path'; + +import prettier from 'prettier'; +import { defaultRegions } from '../src/constants/regions'; + +import { getEc2Info } from '../src/lib/core'; + +(async () => { + const res = ( + await Promise.all(defaultRegions.map(async region => getEc2Info({ region, log: true }))) + ).reduce((rtn, cur) => { + return { ...rtn, ...cur }; + }, {} as { vCpu?: number; memoryGiB?: number }); + const sorted = Object.fromEntries(Object.entries(res).sort(([a], [b]) => -(a < b))); + console.log(`found ${Object.keys(sorted).length} instance types`); + + let output = + `import { InstanceType } from 'aws-sdk/clients/ec2';\n\n` + + `export type Ec2InstanceInfo = { vCpu?: number; memoryGiB?: number };\n\n`; + output += `export const ec2Info: Record = ${JSON.stringify( + sorted, + )};`; + output = prettier.format(output, { + printWidth: 100, + trailingComma: 'all', + singleQuote: true, + parser: 'typescript', + }); + + const targetPath = resolve(__dirname, '../src/constants/ec2-info.ts'); + writeFileSync(targetPath, output); +})(); diff --git a/scripts/generate-ec2-types.ts b/scripts/generate-ec2-types.ts index f9e917e4..3b5efb9a 100644 --- a/scripts/generate-ec2-types.ts +++ b/scripts/generate-ec2-types.ts @@ -99,7 +99,7 @@ const getEc2Types = async (): Promise => { process.exit(1); } const allInstances = prices.reduce((list, cur) => { - if (cur.InstanceType && !list.includes(cur.InstanceType)) list.push(cur.InstanceType); + if (cur.instanceType && !list.includes(cur.instanceType)) list.push(cur.instanceType); return list; }, [] as string[]); diff --git a/scripts/generate-regions.ts b/scripts/generate-regions.ts new file mode 100644 index 00000000..65a8813c --- /dev/null +++ b/scripts/generate-regions.ts @@ -0,0 +1,110 @@ +import { writeFileSync } from 'fs'; +import { resolve } from 'path'; + +import prettier from 'prettier'; + +import EC2 from 'aws-sdk/clients/ec2'; + +// https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/ +// https://a0.awsstatic.com/plc/js/1.0.104/plc/plc-setup.js // find convertRegion -> regionMap +const knownRegionNames: Record = { + 'Africa (Cape Town)': 'af-south-1', + 'Asia Pacific (Hong Kong)': 'ap-east-1', + 'Asia Pacific (Mumbai)': 'ap-south-1', + 'Asia Pacific (Osaka-Local)': 'ap-northeast-3', + 'Asia Pacific (Seoul)': 'ap-northeast-2', + 'Asia Pacific (Singapore)': 'ap-southeast-1', + 'Asia Pacific (Sydney)': 'ap-southeast-2', + 'Asia Pacific (Tokyo)': 'ap-northeast-1', + 'AWS GovCloud (US)': 'us-gov-west-1', + 'AWS GovCloud (US-West)': 'us-gov-west-1', + 'AWS GovCloud (US) East': 'us-gov-east-1', + 'AWS GovCloud (US-East)': 'us-gov-east-1', + 'Canada (Central)': 'ca-central-1', + 'China (Beijing)': 'cn-north-1', + 'China (Ningxia)': 'cn-northwest-1', + // 'EU (Frankfurt)': 'eu-central-1', + 'Europe (Frankfurt)': 'eu-central-1', + // 'EU (Ireland)': 'eu-west-1', + 'Europe (Ireland)': 'eu-west-1', + // 'EU (London)': 'eu-west-2', + 'Europe (London)': 'eu-west-2', + // 'EU (Milan)': 'eu-south-1', + 'Europe (Milan)': 'eu-south-1', + // 'EU (Paris)': 'eu-west-3', + 'Europe (Paris)': 'eu-west-3', + // 'EU (Stockholm)': 'eu-north-1', + 'Europe (Stockholm)': 'eu-north-1', + 'Middle East (Bahrain)': 'me-south-1', + 'South America (Sao Paulo)': 'sa-east-1', + 'US East (Ohio)': 'us-east-2', + 'US East (N. Virginia)': 'us-east-1', + 'US East (Verizon) - Atlanta': 'us-east-1-wl1-atl1', + 'US East (Verizon) - Boston': 'us-east-1-wl1', + 'US East (Verizon) - Dallas': 'us-east-1-wl1-dfw1', + 'US East (Verizon) - Miami': 'us-east-1-wl1-mia1', + 'US East (Verizon) - New York': 'us-east-1-wl1-nyc1', + 'US East (Verizon) - Washington DC': 'us-east-1-wl1-was1', + 'US West (N. California)': 'us-west-1', + 'US West (Oregon)': 'us-west-2', + 'US West (Los Angeles)': 'us-west-2-lax-1', + 'US West (Verizon) - Denver': 'us-west-2-wl1-den1', + 'US West (Verizon) - Las Vegas': 'us-west-2-wl1-las1', + 'US West (Verizon) - San Francisco Bay Area': 'us-west-2-wl1', + 'US West (Verizon) - Seattle': 'us-west-2-wl1-sea1', + Any: 'plc2-any', + All: 'plc2-any', + '': 'plc2-any', +}; + +if (require.main && require.main.filename === module.filename) { + (async (): Promise => { + const ec2 = new EC2({ region: 'us-east-1' }); + const regions = + (await ec2.describeRegions({ AllRegions: true }).promise()).Regions?.sort( + // order @ https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/ + (a, b) => { + if (a.RegionName?.startsWith('us-') && !b.RegionName?.startsWith('us-')) return -1; + return -((a.RegionName || '') < (b.RegionName || '')); + }, + ) || []; + let output = ''; + + output += `export const allRegions = [ + ${regions.map(r => `'${r.RegionName}',`).join('')} + ] as const;\n\n`; + + output += `export type Region = typeof allRegions[number];\n\n`; + + output += `export const defaultRegions: Region[] = [ + ${regions + .map(r => { + if (r.OptInStatus?.endsWith('not-required')) return `'${r.RegionName}',\n`; + return `// '${r.RegionName}', // requires opt-in\n`; + }) + .join('')} + ];\n\n`; + + output += `export const regionNames: Record = { + ${regions + .map(r => { + const name = Object.entries(knownRegionNames).find( + ([, region]) => region === r.RegionName, + )?.[0]; + if (name) return `'${r.RegionName}': '${name}',\n`; + return `'${r.RegionName}': 'UNKNOWN', // ! TODO: UPDATE UNKNOWN REGION NAME\n`; + }) + .join('')} + };\n\n`; + + output = prettier.format(output, { + printWidth: 100, + trailingComma: 'all', + singleQuote: true, + parser: 'typescript', + }); + + const targetPath = resolve(__dirname, '../src/constants/regions.ts'); + writeFileSync(targetPath, output); + })(); +} diff --git a/scripts/generate-spot-prices-mock-data.ts b/scripts/generate-spot-prices-mock-data.ts index 6a0ca9ab..b532c996 100644 --- a/scripts/generate-spot-prices-mock-data.ts +++ b/scripts/generate-spot-prices-mock-data.ts @@ -79,10 +79,10 @@ const { argv } = yargs() return val1.InstanceType === val2.InstanceType; }); const uniqueFamily = uniqWith(allPrices, (val1: EC2.SpotPrice, val2: EC2.SpotPrice) => { - return val1.InstanceType.split('.').shift() === val2.InstanceType.split('.').shift(); + return val1.InstanceType?.split('.').shift() === val2.InstanceType?.split('.').shift(); }); const uniqueSize = uniqWith(allPrices, (val1: EC2.SpotPrice, val2: EC2.SpotPrice) => { - return val1.InstanceType.split('.').pop() === val2.InstanceType.split('.').pop(); + return val1.InstanceType?.split('.').pop() === val2.InstanceType?.split('.').pop(); }); console.log('uniqueType total:', uniqueType.length); console.log('uniqueProductDescription total:', uniqueProductDescription.length); diff --git a/sonar-project.properties b/sonar-project.properties index 70177138..b57f7e96 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,3 +7,4 @@ sonar.sources=src sonar.exclusions=src/**/*.spec.ts sonar.test.inclusions=src/**/*.spec.ts sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.cpd.exclusions=src/constants/*.ts \ No newline at end of file diff --git a/src/cli.spec.ts b/src/cli.spec.ts index 0d3e548c..36d05159 100644 --- a/src/cli.spec.ts +++ b/src/cli.spec.ts @@ -4,12 +4,13 @@ import { resolve } from 'path'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import { mockAwsCredentials, mockAwsCredentialsClear } from '../test/mock-credential-endpoints'; +import { consoleMockCallJoin } from '../test/utils'; +import { main } from './cli'; +import { ec2Info, Ec2InstanceInfo } from './constants/ec2-info'; import { mockDefaultRegionEndpoints, mockDefaultRegionEndpointsClear, } from '../test/mock-ec2-endpoints'; -import { consoleMockCallJoin } from '../test/utils'; -import { main } from './cli'; describe('cli', () => { describe('test by import', () => { @@ -41,6 +42,16 @@ describe('cli', () => { expect(consoleMockCallJoin()).toMatchSnapshot(); }); + it('should return expected values with wide option', async () => { + await main(['-w']); + expect(consoleMockCallJoin()).toMatchSnapshot(); + }); + + it('should return expected values if no matching records found', async () => { + await main(['-f', 'c5', '-s', 'metal', '--pl', '0.0001']); + expect(consoleMockCallJoin()).toMatchSnapshot(); + }); + it('should return expected values with user options', async () => { await main([ '-r', @@ -49,42 +60,44 @@ describe('cli', () => { '10', '-l', '11', - '-d', + '-p', 'Linux/UNIX (Amazon VPC)', '-i', 'c5.large', 'c4.xlarge', - '-p', + '--pl', '0.05', + '--raz', + 'false', ]); expect(consoleMockCallJoin()).toMatchSnapshot(); }); - it('should return expected values with wildcard product descriptions', async () => { - await main(['-r', 'us-east-1', '-l', '10', '-d', 'linux']); - await main(['-r', 'us-east-1', '-l', '10', '-d', 'windows']); + it('should return expected values with wildcard platforms', async () => { + await main(['-r', 'us-east-1', '-l', '10', '-p', 'linux', '--raz', 'false']); + await main(['-r', 'us-east-1', '-l', '10', '-p', 'windows', '--raz', 'false']); expect(consoleMockCallJoin()).toMatchSnapshot(); }); it('should return expected values with instance family types and sizes', async () => { - await main(['-f', 'c5', '-s', 'large']); + await main(['-f', 'c5', '-s', 'large', '--raz', 'false', '-l', '20', '-p', 'linux']); expect(consoleMockCallJoin()).toMatchSnapshot(); }); it('should handle instance family option', async () => { - await main(['--family', 'compute']); + await main(['--family', 'compute', '--raz', 'false', '-l', '20', '-p', 'linux']); expect(consoleMockCallJoin()).toMatchSnapshot(); }); it('should handle JSON output option', async () => { - await main(['--json', '-r', 'us-east-1', '-l', '10']); + await main(['--json', '-r', 'us-east-1', '-l', '10', '--raz', 'false', '-p', 'linux']); const results = consoleMockCallJoin(); const resultsObject = JSON.parse(results); expect(results).toMatchSnapshot(); expect(Object.keys(resultsObject).length).toEqual(10); Object.keys(resultsObject).forEach(key => { expect( - (resultsObject[key].AvailabilityZone as string).startsWith('us-east-1'), + (resultsObject[key].availabilityZone as string).startsWith('us-east-1'), ).toBeTruthy(); }); }); @@ -111,6 +124,24 @@ describe('cli', () => { expect(consoleMockCallJoin()).toContain('`secretAccessKey` missing.'); }); + describe('should handle no ec2 info found', () => { + let c1MediumInfo: Ec2InstanceInfo | undefined; + + beforeAll(async () => { + c1MediumInfo = ec2Info['c1.medium']; + delete ec2Info['c1.medium']; + }); + + afterAll(() => { + if (c1MediumInfo) ec2Info['c1.medium'] = c1MediumInfo; + }); + + it('should return expected values', async () => { + await main(['--family', 'compute', '--raz', 'false', '-l', '20', '-p', 'linux', '-w']); + expect(consoleMockCallJoin()).toMatchSnapshot(); + }); + }); + describe('ui mode', () => { beforeAll(() => { process.env.UI_INJECT = JSON.stringify([ @@ -119,8 +150,12 @@ describe('cli', () => { ['c4', 'r5', 'f1'], ['nano', 'micro', 'small', 'medium', 'large'], ['Linux/UNIX', 'SUSE Linux'], + undefined, + undefined, 0.5, 10, + false, + false, ]); }); diff --git a/src/cli.ts b/src/cli.ts index 17c088ef..d62d3639 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,7 +1,7 @@ import { sep } from 'path'; import ora from 'ora'; -import { table } from 'table'; +import { table, TableColumns } from 'table'; import yargs from 'yargs/yargs'; import { ui } from './lib/ui'; @@ -12,11 +12,11 @@ import { InstanceFamilyType, InstanceSize, InstanceType, - ProductDescription, - ProductDescriptionWildcards, + Platform, + PlatformsWildcards, Region, allInstances, - allProductDescriptions, + allPlatforms, allRegions, awsCredentialsCheck, defaults, @@ -24,9 +24,9 @@ import { getGlobalSpotPrices, instanceFamily, instanceFamilyTypes, - instanceOfProductDescription, + instanceOfPlatforms, instanceSizes, - productDescriptionWildcards, + platformWildcards, regionNames, } from './module'; @@ -37,7 +37,7 @@ import { export const main = (argvInput?: string[]): Promise => new Promise((res, rej): void => { const y = yargs() - .scriptName('spot-price') + .scriptName('aws-spot-price') .command( '$0', 'get current AWS spot instance prices', @@ -81,21 +81,31 @@ export const main = (argvInput?: string[]): Promise => choices: instanceSizes, string: true, }, - priceMax: { - alias: 'p', - describe: 'Maximum price', + minVCPU: { + alias: 'mc', + describe: 'Minimum VCPU count', + type: 'number', + default: defaults.minVCPU, + }, + minMemoryGiB: { + alias: 'mm', + describe: 'Minimum memory (GiB)', + type: 'number', + default: defaults.minMemoryGiB, + }, + priceLimit: { + alias: 'pl', + describe: 'Maximum price limit', type: 'number', + default: defaults.priceLimit, }, - productDescription: { - alias: 'd', - describe: - 'Product descriptions. Choose `windows` or `linux` (all lowercase) as wildcard.', + platforms: { + alias: 'p', + describe: 'Platforms. Choose `windows` or `linux` (all lowercase) as wildcard.', type: 'array', string: true, - choices: [ - ...allProductDescriptions, - ...(Object.keys(productDescriptionWildcards) as ProductDescriptionWildcards[]), - ], + choices: [...allPlatforms, ...(Object.keys(platformWildcards) as PlatformsWildcards[])], + default: defaults.platforms, }, limit: { alias: 'l', @@ -109,6 +119,18 @@ export const main = (argvInput?: string[]): Promise => return val; }, }, + reduceAZ: { + alias: 'raz', + describe: 'Reduce results with cheapest Availability Zone within Region', + type: 'boolean', + default: defaults.reduceAZ, + }, + wide: { + alias: 'w', + describe: 'Output results with detail (vCPU, memory, etc)', + type: 'boolean', + default: defaults.wide, + }, json: { alias: 'j', describe: 'Outputs in JSON format', @@ -134,8 +156,12 @@ export const main = (argvInput?: string[]): Promise => familyType, size, limit, - priceMax, - productDescription, + reduceAZ, + wide, + minVCPU, + minMemoryGiB, + priceLimit, + platforms, json, accessKeyId, secretAccessKey, @@ -165,25 +191,28 @@ export const main = (argvInput?: string[]): Promise => }); } - // process product description - const productDescriptionsSet = new Set(); - if (productDescription) { - (productDescription as (ProductDescription | ProductDescriptionWildcards)[]).forEach( - pd => { - /* istanbul ignore else */ - if (instanceOfProductDescription(pd)) { - productDescriptionsSet.add(pd); - } else if (pd === 'linux') { - productDescriptionWildcards.linux.forEach(desc => { - productDescriptionsSet.add(desc); - }); - } else if (pd === 'windows') { - productDescriptionWildcards.windows.forEach(desc => { - productDescriptionsSet.add(desc); - }); - } - }, - ); + // process platforms + const platformsSet = new Set(); + if (platforms && platforms.length) { + (platforms as (Platform | PlatformsWildcards)[]).forEach(pd => { + /* istanbul ignore else */ + if (instanceOfPlatforms(pd)) { + platformsSet.add(pd); + } else if (pd === 'linux') { + platformWildcards.linux.forEach(desc => { + platformsSet.add(desc); + }); + } else if (pd === 'windows') { + platformWildcards.windows.forEach(desc => { + platformsSet.add(desc); + }); + } + }); + } else { + // defaults to linux product + defaults.platforms.forEach(p => { + platformsSet.add(p); + }); } if (accessKeyId && !secretAccessKey) { @@ -204,7 +233,7 @@ export const main = (argvInput?: string[]): Promise => secretAccessKey, }); - const productDescriptionsSetArray = Array.from(productDescriptionsSet); + const platformsSetArray = Array.from(platformsSet); const familyTypeSetArray = Array.from(familyTypeSet); const sizeSetArray = Array.from(sizeSet); @@ -214,6 +243,7 @@ export const main = (argvInput?: string[]): Promise => let onRegionFetchFail: ((error: Ec2SpotPriceError) => void) | undefined; let onFetchComplete: (() => void) | undefined; + /* istanbul ignore if */ if (!json && process.env.NODE_ENV !== 'test') { spinner = ora({ text: 'Waiting for data to be retrieved...', @@ -245,10 +275,11 @@ export const main = (argvInput?: string[]): Promise => familyTypes: familyTypeSetArray.length ? familyTypeSetArray : undefined, sizes: sizeSetArray.length ? sizeSetArray : undefined, limit, - priceMax, - productDescriptions: productDescriptionsSetArray.length - ? productDescriptionsSetArray - : undefined, + reduceAZ, + minVCPU, + minMemoryGiB, + priceLimit, + platforms: platformsSetArray, accessKeyId, secretAccessKey, onRegionFetch, @@ -259,21 +290,62 @@ export const main = (argvInput?: string[]): Promise => if (json) { console.log(JSON.stringify(results, null, 2)); } else if (results.length > 0) { + // shorten price strings + let spotPriceToFixedLen = Number.NEGATIVE_INFINITY; + const allPricesStr = results.map(r => r.spotPrice.toFixed(10)); + allPricesStr.forEach(priceStr => { + const len = 10 - (priceStr.match(/0+$/)?.[0].length || 0); + if (len !== undefined && len > spotPriceToFixedLen) spotPriceToFixedLen = len; + }); + + let tableHeader: (string | undefined)[][] | undefined; + let tableData: (string | undefined)[][] | undefined; + let tableFormat: Record | undefined; + + if (!wide) { + tableHeader = [['Type', 'Price', 'Platform', 'Availability Zone']]; + tableData = results.map(info => [ + info.instanceType, + info.spotPrice.toFixed(spotPriceToFixedLen), + info.platform, + info.availabilityZone, + ]); + tableFormat = { + 0: { alignment: 'left' }, + 1: { alignment: 'right' }, + 2: { alignment: 'left' }, + 3: { alignment: 'left' }, + }; + } else { + tableHeader = [ + ['Type', 'Price', 'vCPU', 'RAM', 'Platform', 'Availability Zone', 'Region'], + ]; + tableData = results.map(info => [ + info.instanceType, + info.spotPrice.toFixed(spotPriceToFixedLen), + info.vCpu ? info.vCpu.toString() : 'unknown', + info.memoryGiB ? info.memoryGiB.toString() : 'unknown', + info.platform, + info.availabilityZone, + info.availabilityZone + ? regionNames[info.availabilityZone.slice(0, -1) as Region] + : /* istanbul ignore next */ undefined, + ]); + tableFormat = { + 0: { alignment: 'left' }, + 1: { alignment: 'right' }, + 2: { alignment: 'right' }, + 3: { alignment: 'right' }, + 4: { alignment: 'left' }, + 5: { alignment: 'left' }, + 6: { alignment: 'left' }, + }; + } console.log( - table( - results.reduce((list, price) => { - list.push([ - price.InstanceType, - price.SpotPrice, - price.ProductDescription, - price.AvailabilityZone, - price.AvailabilityZone - ? regionNames[price.AvailabilityZone.slice(0, -1) as Region] - : /* istanbul ignore next */ undefined, - ]); - return list; - }, [] as (string | undefined)[][]), - ), + table([...tableHeader, ...tableData], { + drawHorizontalLine: (index, tableSize) => index <= 1 || index === tableSize, + columns: tableFormat, + }), ); } else { console.log('no matching records found'); @@ -290,7 +362,7 @@ export const main = (argvInput?: string[]): Promise => console.log('AWS credentials are not found.'); } } else { - console.log('unexpected getGlobalSpotPrices error:', JSON.stringify(error, null, 2)); + console.log('unexpected getGlobalSpotPrices error:', error); } rej(); } diff --git a/src/constants/ec2-info.ts b/src/constants/ec2-info.ts new file mode 100644 index 00000000..249cd99a --- /dev/null +++ b/src/constants/ec2-info.ts @@ -0,0 +1,351 @@ +import { InstanceType } from 'aws-sdk/clients/ec2'; + +export type Ec2InstanceInfo = { vCpu?: number; memoryGiB?: number }; + +export const ec2Info: Record = { + 'a1.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'a1.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'a1.large': { vCpu: 2, memoryGiB: 4 }, + 'a1.medium': { vCpu: 1, memoryGiB: 2 }, + 'a1.metal': { vCpu: 16, memoryGiB: 32 }, + 'a1.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c1.medium': { vCpu: 2, memoryGiB: 1.7 }, + 'c1.xlarge': { vCpu: 8, memoryGiB: 7 }, + 'c3.2xlarge': { vCpu: 8, memoryGiB: 15 }, + 'c3.4xlarge': { vCpu: 16, memoryGiB: 30 }, + 'c3.8xlarge': { vCpu: 32, memoryGiB: 60 }, + 'c3.large': { vCpu: 2, memoryGiB: 3.75 }, + 'c3.xlarge': { vCpu: 4, memoryGiB: 7.5 }, + 'c4.2xlarge': { vCpu: 8, memoryGiB: 15 }, + 'c4.4xlarge': { vCpu: 16, memoryGiB: 30 }, + 'c4.8xlarge': { vCpu: 36, memoryGiB: 60 }, + 'c4.large': { vCpu: 2, memoryGiB: 3.75 }, + 'c4.xlarge': { vCpu: 4, memoryGiB: 7.5 }, + 'c5.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c5.18xlarge': { vCpu: 72, memoryGiB: 144 }, + 'c5.24xlarge': { vCpu: 96, memoryGiB: 192 }, + 'c5.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c5.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c5.9xlarge': { vCpu: 36, memoryGiB: 72 }, + 'c5.large': { vCpu: 2, memoryGiB: 4 }, + 'c5.metal': { vCpu: 96, memoryGiB: 192 }, + 'c5.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c5a.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c5a.16xlarge': { vCpu: 64, memoryGiB: 128 }, + 'c5a.24xlarge': { vCpu: 96, memoryGiB: 192 }, + 'c5a.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c5a.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c5a.8xlarge': { vCpu: 32, memoryGiB: 64 }, + 'c5a.large': { vCpu: 2, memoryGiB: 4 }, + 'c5a.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c5ad.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c5ad.16xlarge': { vCpu: 64, memoryGiB: 128 }, + 'c5ad.24xlarge': { vCpu: 96, memoryGiB: 192 }, + 'c5ad.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c5ad.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c5ad.8xlarge': { vCpu: 32, memoryGiB: 64 }, + 'c5ad.large': { vCpu: 2, memoryGiB: 4 }, + 'c5ad.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c5d.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c5d.18xlarge': { vCpu: 72, memoryGiB: 144 }, + 'c5d.24xlarge': { vCpu: 96, memoryGiB: 192 }, + 'c5d.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c5d.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c5d.9xlarge': { vCpu: 36, memoryGiB: 72 }, + 'c5d.large': { vCpu: 2, memoryGiB: 4 }, + 'c5d.metal': { vCpu: 96, memoryGiB: 192 }, + 'c5d.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c5n.18xlarge': { vCpu: 72, memoryGiB: 192 }, + 'c5n.2xlarge': { vCpu: 8, memoryGiB: 21 }, + 'c5n.4xlarge': { vCpu: 16, memoryGiB: 42 }, + 'c5n.9xlarge': { vCpu: 36, memoryGiB: 96 }, + 'c5n.large': { vCpu: 2, memoryGiB: 5.25 }, + 'c5n.metal': { vCpu: 72, memoryGiB: 192 }, + 'c5n.xlarge': { vCpu: 4, memoryGiB: 10.5 }, + 'c6g.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c6g.16xlarge': { vCpu: 64, memoryGiB: 128 }, + 'c6g.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c6g.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c6g.8xlarge': { vCpu: 32, memoryGiB: 64 }, + 'c6g.large': { vCpu: 2, memoryGiB: 4 }, + 'c6g.medium': { vCpu: 1, memoryGiB: 2 }, + 'c6g.metal': { vCpu: 64, memoryGiB: 128 }, + 'c6g.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'c6gd.12xlarge': { vCpu: 48, memoryGiB: 96 }, + 'c6gd.16xlarge': { vCpu: 64, memoryGiB: 128 }, + 'c6gd.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'c6gd.4xlarge': { vCpu: 16, memoryGiB: 32 }, + 'c6gd.8xlarge': { vCpu: 32, memoryGiB: 64 }, + 'c6gd.large': { vCpu: 2, memoryGiB: 4 }, + 'c6gd.medium': { vCpu: 1, memoryGiB: 2 }, + 'c6gd.metal': { vCpu: 64, memoryGiB: 128 }, + 'c6gd.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'cc2.8xlarge': { vCpu: 32, memoryGiB: 60.5 }, + 'd2.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'd2.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'd2.8xlarge': { vCpu: 36, memoryGiB: 244 }, + 'd2.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'f1.16xlarge': { vCpu: 64, memoryGiB: 976 }, + 'f1.2xlarge': { vCpu: 8, memoryGiB: 122 }, + 'f1.4xlarge': { vCpu: 16, memoryGiB: 244 }, + 'g2.2xlarge': { vCpu: 8, memoryGiB: 15 }, + 'g2.8xlarge': { vCpu: 32, memoryGiB: 60 }, + 'g3.16xlarge': { vCpu: 64, memoryGiB: 488 }, + 'g3.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'g3.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'g3s.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'g4dn.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'g4dn.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'g4dn.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'g4dn.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'g4dn.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'g4dn.metal': { vCpu: 96, memoryGiB: 384 }, + 'g4dn.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'h1.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'h1.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'h1.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'h1.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'i2.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'i2.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'i2.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'i2.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'i3.16xlarge': { vCpu: 64, memoryGiB: 488 }, + 'i3.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'i3.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'i3.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'i3.large': { vCpu: 2, memoryGiB: 15.25 }, + 'i3.metal': { vCpu: 72, memoryGiB: 512 }, + 'i3.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'i3en.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'i3en.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'i3en.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'i3en.3xlarge': { vCpu: 12, memoryGiB: 96 }, + 'i3en.6xlarge': { vCpu: 24, memoryGiB: 192 }, + 'i3en.large': { vCpu: 2, memoryGiB: 16 }, + 'i3en.metal': { vCpu: 96, memoryGiB: 768 }, + 'i3en.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'inf1.24xlarge': { vCpu: 96, memoryGiB: 192 }, + 'inf1.2xlarge': { vCpu: 8, memoryGiB: 16 }, + 'inf1.6xlarge': { vCpu: 24, memoryGiB: 48 }, + 'inf1.xlarge': { vCpu: 4, memoryGiB: 8 }, + 'm1.large': { vCpu: 2, memoryGiB: 7.5 }, + 'm1.medium': { vCpu: 1, memoryGiB: 3.7 }, + 'm1.small': { vCpu: 1, memoryGiB: 1.7 }, + 'm1.xlarge': { vCpu: 4, memoryGiB: 15 }, + 'm2.2xlarge': { vCpu: 4, memoryGiB: 34.2 }, + 'm2.4xlarge': { vCpu: 8, memoryGiB: 68.4 }, + 'm2.xlarge': { vCpu: 2, memoryGiB: 17.1 }, + 'm3.2xlarge': { vCpu: 8, memoryGiB: 30 }, + 'm3.large': { vCpu: 2, memoryGiB: 7.5 }, + 'm3.medium': { vCpu: 1, memoryGiB: 3.75 }, + 'm3.xlarge': { vCpu: 4, memoryGiB: 15 }, + 'm4.10xlarge': { vCpu: 40, memoryGiB: 160 }, + 'm4.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm4.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm4.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm4.large': { vCpu: 2, memoryGiB: 8 }, + 'm4.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5.large': { vCpu: 2, memoryGiB: 8 }, + 'm5.metal': { vCpu: 96, memoryGiB: 384 }, + 'm5.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5a.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5a.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5a.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5a.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5a.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5a.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5a.large': { vCpu: 2, memoryGiB: 8 }, + 'm5a.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5ad.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5ad.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5ad.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5ad.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5ad.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5ad.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5ad.large': { vCpu: 2, memoryGiB: 8 }, + 'm5ad.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5d.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5d.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5d.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5d.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5d.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5d.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5d.large': { vCpu: 2, memoryGiB: 8 }, + 'm5d.metal': { vCpu: 96, memoryGiB: 384 }, + 'm5d.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5dn.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5dn.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5dn.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5dn.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5dn.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5dn.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5dn.large': { vCpu: 2, memoryGiB: 8 }, + 'm5dn.metal': { vCpu: 96, memoryGiB: 384 }, + 'm5dn.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm5n.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm5n.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm5n.24xlarge': { vCpu: 96, memoryGiB: 384 }, + 'm5n.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm5n.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm5n.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm5n.large': { vCpu: 2, memoryGiB: 8 }, + 'm5n.metal': { vCpu: 96, memoryGiB: 384 }, + 'm5n.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm6g.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm6g.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm6g.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm6g.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm6g.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm6g.large': { vCpu: 2, memoryGiB: 8 }, + 'm6g.medium': { vCpu: 1, memoryGiB: 4 }, + 'm6g.metal': { vCpu: 64, memoryGiB: 256 }, + 'm6g.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'm6gd.12xlarge': { vCpu: 48, memoryGiB: 192 }, + 'm6gd.16xlarge': { vCpu: 64, memoryGiB: 256 }, + 'm6gd.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 'm6gd.4xlarge': { vCpu: 16, memoryGiB: 64 }, + 'm6gd.8xlarge': { vCpu: 32, memoryGiB: 128 }, + 'm6gd.large': { vCpu: 2, memoryGiB: 8 }, + 'm6gd.medium': { vCpu: 1, memoryGiB: 4 }, + 'm6gd.metal': { vCpu: 64, memoryGiB: 256 }, + 'm6gd.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'p2.16xlarge': { vCpu: 64, memoryGiB: 732 }, + 'p2.8xlarge': { vCpu: 32, memoryGiB: 488 }, + 'p2.xlarge': { vCpu: 4, memoryGiB: 61 }, + 'p3.16xlarge': { vCpu: 64, memoryGiB: 488 }, + 'p3.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'p3.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'p3dn.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'p4d.24xlarge': { vCpu: 96, memoryGiB: 1152 }, + 'r3.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'r3.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'r3.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'r3.large': { vCpu: 2, memoryGiB: 15 }, + 'r3.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'r4.16xlarge': { vCpu: 64, memoryGiB: 488 }, + 'r4.2xlarge': { vCpu: 8, memoryGiB: 61 }, + 'r4.4xlarge': { vCpu: 16, memoryGiB: 122 }, + 'r4.8xlarge': { vCpu: 32, memoryGiB: 244 }, + 'r4.large': { vCpu: 2, memoryGiB: 15.25 }, + 'r4.xlarge': { vCpu: 4, memoryGiB: 30.5 }, + 'r5.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5.large': { vCpu: 2, memoryGiB: 16 }, + 'r5.metal': { vCpu: 96, memoryGiB: 768 }, + 'r5.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r5a.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5a.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5a.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5a.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5a.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5a.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5a.large': { vCpu: 2, memoryGiB: 16 }, + 'r5a.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r5ad.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5ad.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5ad.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5ad.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5ad.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5ad.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5ad.large': { vCpu: 2, memoryGiB: 16 }, + 'r5ad.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r5d.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5d.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5d.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5d.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5d.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5d.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5d.large': { vCpu: 2, memoryGiB: 16 }, + 'r5d.metal': { vCpu: 96, memoryGiB: 768 }, + 'r5d.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r5dn.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5dn.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5dn.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5dn.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5dn.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5dn.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5dn.large': { vCpu: 2, memoryGiB: 16 }, + 'r5dn.metal': { vCpu: 96, memoryGiB: 768 }, + 'r5dn.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r5n.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r5n.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r5n.24xlarge': { vCpu: 96, memoryGiB: 768 }, + 'r5n.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r5n.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r5n.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r5n.large': { vCpu: 2, memoryGiB: 16 }, + 'r5n.metal': { vCpu: 96, memoryGiB: 768 }, + 'r5n.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r6g.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r6g.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r6g.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r6g.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r6g.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r6g.large': { vCpu: 2, memoryGiB: 16 }, + 'r6g.medium': { vCpu: 1, memoryGiB: 8 }, + 'r6g.metal': { vCpu: 64, memoryGiB: 512 }, + 'r6g.xlarge': { vCpu: 4, memoryGiB: 32 }, + 'r6gd.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'r6gd.16xlarge': { vCpu: 64, memoryGiB: 512 }, + 'r6gd.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'r6gd.4xlarge': { vCpu: 16, memoryGiB: 128 }, + 'r6gd.8xlarge': { vCpu: 32, memoryGiB: 256 }, + 'r6gd.large': { vCpu: 2, memoryGiB: 16 }, + 'r6gd.medium': { vCpu: 1, memoryGiB: 8 }, + 'r6gd.metal': { vCpu: 64, memoryGiB: 512 }, + 'r6gd.xlarge': { vCpu: 4, memoryGiB: 32 }, + 't1.micro': { vCpu: 1, memoryGiB: 0.613 }, + 't2.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 't2.large': { vCpu: 2, memoryGiB: 8 }, + 't2.medium': { vCpu: 2, memoryGiB: 4 }, + 't2.micro': { vCpu: 1, memoryGiB: 1 }, + 't2.nano': { vCpu: 1, memoryGiB: 0.5 }, + 't2.small': { vCpu: 1, memoryGiB: 2 }, + 't2.xlarge': { vCpu: 4, memoryGiB: 16 }, + 't3.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 't3.large': { vCpu: 2, memoryGiB: 8 }, + 't3.medium': { vCpu: 2, memoryGiB: 4 }, + 't3.micro': { vCpu: 2, memoryGiB: 1 }, + 't3.nano': { vCpu: 2, memoryGiB: 0.5 }, + 't3.small': { vCpu: 2, memoryGiB: 2 }, + 't3.xlarge': { vCpu: 4, memoryGiB: 16 }, + 't3a.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 't3a.large': { vCpu: 2, memoryGiB: 8 }, + 't3a.medium': { vCpu: 2, memoryGiB: 4 }, + 't3a.micro': { vCpu: 2, memoryGiB: 1 }, + 't3a.nano': { vCpu: 2, memoryGiB: 0.5 }, + 't3a.small': { vCpu: 2, memoryGiB: 2 }, + 't3a.xlarge': { vCpu: 4, memoryGiB: 16 }, + 't4g.2xlarge': { vCpu: 8, memoryGiB: 32 }, + 't4g.large': { vCpu: 2, memoryGiB: 8 }, + 't4g.medium': { vCpu: 2, memoryGiB: 4 }, + 't4g.micro': { vCpu: 2, memoryGiB: 1 }, + 't4g.nano': { vCpu: 2, memoryGiB: 0.5 }, + 't4g.small': { vCpu: 2, memoryGiB: 2 }, + 't4g.xlarge': { vCpu: 4, memoryGiB: 16 }, + 'x1.16xlarge': { vCpu: 64, memoryGiB: 976 }, + 'x1.32xlarge': { vCpu: 128, memoryGiB: 1952 }, + 'x1e.16xlarge': { vCpu: 64, memoryGiB: 1952 }, + 'x1e.2xlarge': { vCpu: 8, memoryGiB: 244 }, + 'x1e.32xlarge': { vCpu: 128, memoryGiB: 3904 }, + 'x1e.4xlarge': { vCpu: 16, memoryGiB: 488 }, + 'x1e.8xlarge': { vCpu: 32, memoryGiB: 976 }, + 'x1e.xlarge': { vCpu: 4, memoryGiB: 122 }, + 'z1d.12xlarge': { vCpu: 48, memoryGiB: 384 }, + 'z1d.2xlarge': { vCpu: 8, memoryGiB: 64 }, + 'z1d.3xlarge': { vCpu: 12, memoryGiB: 96 }, + 'z1d.6xlarge': { vCpu: 24, memoryGiB: 192 }, + 'z1d.large': { vCpu: 2, memoryGiB: 16 }, + 'z1d.metal': { vCpu: 48, memoryGiB: 384 }, + 'z1d.xlarge': { vCpu: 4, memoryGiB: 32 }, +}; diff --git a/src/constants/platform.ts b/src/constants/platform.ts new file mode 100644 index 00000000..1993dc42 --- /dev/null +++ b/src/constants/platform.ts @@ -0,0 +1,25 @@ +const linuxPlatforms = [ + 'Linux/UNIX', + 'Linux/UNIX (Amazon VPC)', + 'SUSE Linux', + 'SUSE Linux (Amazon VPC)', + 'Red Hat Enterprise Linux', + 'Red Hat Enterprise Linux (Amazon VPC)', +] as const; + +const windowsPlatforms = ['Windows', 'Windows (Amazon VPC)'] as const; + +export const allPlatforms = [...linuxPlatforms, ...windowsPlatforms]; + +export type Platform = typeof allPlatforms[number]; + +export const platformWildcards = { + linux: linuxPlatforms, + windows: windowsPlatforms, +} as const; + +export type PlatformsWildcards = keyof typeof platformWildcards; + +export const instanceOfPlatforms = (pd: string): pd is Platform => { + return allPlatforms.includes(pd as Platform); +}; diff --git a/src/constants/product-description.ts b/src/constants/product-description.ts deleted file mode 100644 index 825ca9f7..00000000 --- a/src/constants/product-description.ts +++ /dev/null @@ -1,25 +0,0 @@ -const linuxProductDescriptions = [ - 'Linux/UNIX', - 'Linux/UNIX (Amazon VPC)', - 'SUSE Linux', - 'SUSE Linux (Amazon VPC)', - 'Red Hat Enterprise Linux', - 'Red Hat Enterprise Linux (Amazon VPC)', -] as const; - -const windowsProductDescriptions = ['Windows', 'Windows (Amazon VPC)'] as const; - -export const allProductDescriptions = [...linuxProductDescriptions, ...windowsProductDescriptions]; - -export type ProductDescription = typeof allProductDescriptions[number]; - -export const productDescriptionWildcards = { - linux: linuxProductDescriptions, - windows: windowsProductDescriptions, -} as const; - -export type ProductDescriptionWildcards = keyof typeof productDescriptionWildcards; - -export const instanceOfProductDescription = (pd: string): pd is ProductDescription => { - return allProductDescriptions.includes(pd as ProductDescription); -}; diff --git a/src/constants/regions.ts b/src/constants/regions.ts index e688238d..d959d3fa 100644 --- a/src/constants/regions.ts +++ b/src/constants/regions.ts @@ -3,19 +3,20 @@ export const allRegions = [ 'us-east-2', 'us-west-1', 'us-west-2', - 'ca-central-1', - 'eu-central-1', - 'eu-west-1', - 'eu-west-2', - 'eu-west-3', - 'eu-north-1', + 'af-south-1', 'ap-east-1', 'ap-northeast-1', 'ap-northeast-2', - 'ap-northeast-3', + 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', - 'ap-south-1', + 'ca-central-1', + 'eu-central-1', + 'eu-north-1', + 'eu-south-1', + 'eu-west-1', + 'eu-west-2', + 'eu-west-3', 'me-south-1', 'sa-east-1', ] as const; @@ -27,20 +28,21 @@ export const defaultRegions: Region[] = [ 'us-east-2', 'us-west-1', 'us-west-2', + // 'af-south-1', // requires opt-in + // 'ap-east-1', // requires opt-in + 'ap-northeast-1', + 'ap-northeast-2', + 'ap-south-1', + 'ap-southeast-1', + 'ap-southeast-2', 'ca-central-1', 'eu-central-1', + 'eu-north-1', + // 'eu-south-1', // requires opt-in 'eu-west-1', 'eu-west-2', 'eu-west-3', - 'eu-north-1', - // 'ap-east-1', // requires opt-in - 'ap-northeast-1', - 'ap-northeast-2', - // 'ap-northeast-3', // requires opt-in - 'ap-southeast-1', - 'ap-southeast-2', - 'ap-south-1', - // 'me-south-1', // requires opt-in + // 'me-south-1', // requires opt-in 'sa-east-1', ]; @@ -49,19 +51,20 @@ export const regionNames: Record = { 'us-east-2': 'US East (Ohio)', 'us-west-1': 'US West (N. California)', 'us-west-2': 'US West (Oregon)', - 'ca-central-1': 'Canada (Central)', - 'eu-central-1': 'EU (Frankfurt)', - 'eu-west-1': 'EU (Ireland)', - 'eu-west-2': 'EU (London)', - 'eu-west-3': 'EU (Paris)', - 'eu-north-1': 'EU (Stockholm)', + 'af-south-1': 'Africa (Cape Town)', 'ap-east-1': 'Asia Pacific (Hong Kong)', 'ap-northeast-1': 'Asia Pacific (Tokyo)', 'ap-northeast-2': 'Asia Pacific (Seoul)', - 'ap-northeast-3': 'Asia Pacific (Osaka-Local)', + 'ap-south-1': 'Asia Pacific (Mumbai)', 'ap-southeast-1': 'Asia Pacific (Singapore)', 'ap-southeast-2': 'Asia Pacific (Sydney)', - 'ap-south-1': 'Asia Pacific (Mumbai)', + 'ca-central-1': 'Canada (Central)', + 'eu-central-1': 'Europe (Frankfurt)', + 'eu-north-1': 'Europe (Stockholm)', + 'eu-south-1': 'Europe (Milan)', + 'eu-west-1': 'Europe (Ireland)', + 'eu-west-2': 'Europe (London)', + 'eu-west-3': 'Europe (Paris)', 'me-south-1': 'Middle East (Bahrain)', - 'sa-east-1': 'South America (São Paulo)', + 'sa-east-1': 'South America (Sao Paulo)', }; diff --git a/src/lib/core.spec.ts b/src/lib/core.spec.ts index f4472973..06a30f34 100644 --- a/src/lib/core.spec.ts +++ b/src/lib/core.spec.ts @@ -1,4 +1,3 @@ -import { SpotPrice } from 'aws-sdk/clients/ec2'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import { filter } from 'lodash'; import nock from 'nock'; @@ -9,15 +8,16 @@ import { mockDefaultRegionEndpointsClear, } from '../../test/mock-ec2-endpoints'; import { consoleMockCallJoin } from '../../test/utils'; +import { ec2Info, Ec2InstanceInfo } from '../constants/ec2-info'; import { InstanceFamilyType, InstanceSize } from '../constants/ec2-types'; -import { ProductDescription } from '../constants/product-description'; +import { Platform } from '../constants/platform'; import { Region } from '../constants/regions'; -import { getGlobalSpotPrices } from './core'; +import { getEc2Info, getGlobalSpotPrices, SpotPriceExtended } from './core'; describe('lib', () => { describe('getGlobalSpotPrices', () => { describe('run with default options', () => { - let results: SpotPrice[]; + let results: SpotPriceExtended[]; let restoreConsole: RestoreConsole; beforeAll(async () => { @@ -37,10 +37,10 @@ describe('lib', () => { }); describe('run with specific options', () => { - let results: SpotPrice[]; + let results: SpotPriceExtended[]; const familyTypes: InstanceFamilyType[] = ['c4', 'c5']; const sizes: InstanceSize[] = ['large', 'xlarge']; - const productDescriptions: ProductDescription[] = ['Linux/UNIX']; + const platforms: Platform[] = ['Linux/UNIX']; beforeAll(async () => { mockDefaultRegionEndpoints({ maxLength: 5, returnPartialBlankValues: true }); @@ -48,8 +48,9 @@ describe('lib', () => { results = await getGlobalSpotPrices({ familyTypes, sizes, - productDescriptions, + platforms, limit: 20, + reduceAZ: false, }); }); @@ -62,18 +63,16 @@ describe('lib', () => { expect(results.length).toEqual(20); if (results) { results.forEach(result => { - expect(result.InstanceType).toBeDefined(); - expect(result.ProductDescription).toBeDefined(); - if (result.InstanceType && result.ProductDescription) { + expect(result.instanceType).toBeDefined(); + expect(result.platform).toBeDefined(); + if (result.instanceType && result.platform) { expect( - familyTypes.includes(result.InstanceType.split('.').shift() as InstanceFamilyType), + familyTypes.includes(result.instanceType.split('.').shift() as InstanceFamilyType), ).toBeTruthy(); expect( - sizes.includes(result.InstanceType.split('.').pop() as InstanceSize), - ).toBeTruthy(); - expect( - productDescriptions.includes(result.ProductDescription as ProductDescription), + sizes.includes(result.instanceType.split('.').pop() as InstanceSize), ).toBeTruthy(); + expect(platforms.includes(result.platform as Platform)).toBeTruthy(); } }); } @@ -81,7 +80,7 @@ describe('lib', () => { }); describe('run with family type only', () => { - let results: SpotPrice[]; + let results: SpotPriceExtended[]; const familyTypes: InstanceFamilyType[] = ['c1', 'c3', 'c4']; beforeAll(async () => { @@ -90,6 +89,7 @@ describe('lib', () => { results = await getGlobalSpotPrices({ familyTypes, limit: 20, + reduceAZ: false, }); }); @@ -102,10 +102,10 @@ describe('lib', () => { expect(results.length).toEqual(20); if (results) { results.forEach(result => { - expect(result.InstanceType).toBeDefined(); - if (result.InstanceType) { + expect(result.instanceType).toBeDefined(); + if (result.instanceType) { expect( - familyTypes.includes(result.InstanceType.split('.').shift() as InstanceFamilyType), + familyTypes.includes(result.instanceType.split('.').shift() as InstanceFamilyType), ).toBeTruthy(); } }); @@ -114,7 +114,7 @@ describe('lib', () => { }); describe('run with family sizes only', () => { - let results: SpotPrice[]; + let results: SpotPriceExtended[]; const sizes: InstanceSize[] = ['small', 'medium', 'large']; beforeAll(async () => { @@ -123,6 +123,7 @@ describe('lib', () => { results = await getGlobalSpotPrices({ sizes, limit: 20, + reduceAZ: false, }); }); @@ -135,10 +136,10 @@ describe('lib', () => { expect(results.length).toEqual(20); if (results) { results.forEach(result => { - expect(result.InstanceType).toBeDefined(); - if (result.InstanceType) { + expect(result.instanceType).toBeDefined(); + if (result.instanceType) { expect( - sizes.includes(result.InstanceType.split('.').pop() as InstanceSize), + sizes.includes(result.instanceType.split('.').pop() as InstanceSize), ).toBeTruthy(); } }); @@ -147,7 +148,7 @@ describe('lib', () => { }); describe('check instance types mix', () => { - let results: SpotPrice[]; + let results: SpotPriceExtended[]; beforeAll(async () => { mockDefaultRegionEndpoints(); @@ -156,8 +157,9 @@ describe('lib', () => { familyTypes: ['c4', 'c5'], sizes: ['large', 'xlarge'], instanceTypes: ['c5.2xlarge'], - productDescriptions: ['Linux/UNIX'], + platforms: ['Linux/UNIX'], limit: 200, + reduceAZ: false, }); }); @@ -166,11 +168,11 @@ describe('lib', () => { }); it('should contain all instance types', () => { - const c4large = filter(results, { InstanceType: 'c4.large' }); - const c5large = filter(results, { InstanceType: 'c5.large' }); - const c4xlarge = filter(results, { InstanceType: 'c4.xlarge' }); - const c5xlarge = filter(results, { InstanceType: 'c5.xlarge' }); - const c52xlarge = filter(results, { InstanceType: 'c5.2xlarge' }); + const c4large = filter(results, { instanceType: 'c4.large' }); + const c5large = filter(results, { instanceType: 'c5.large' }); + const c4xlarge = filter(results, { instanceType: 'c4.xlarge' }); + const c5xlarge = filter(results, { instanceType: 'c5.xlarge' }); + const c52xlarge = filter(results, { instanceType: 'c5.2xlarge' }); expect(c4large.length).toBeGreaterThan(0); expect(c5large.length).toBeGreaterThan(0); expect(c4xlarge.length).toBeGreaterThan(0); @@ -180,14 +182,15 @@ describe('lib', () => { }); describe('filter max price', () => { - const priceMax = 0.0018; - let results: SpotPrice[]; + const priceLimit = 0.0018; + let results: SpotPriceExtended[]; beforeAll(async () => { mockDefaultRegionEndpoints(); results = await getGlobalSpotPrices({ - priceMax, + priceLimit, + reduceAZ: false, }); }); @@ -195,9 +198,9 @@ describe('lib', () => { mockDefaultRegionEndpointsClear(); }); - it(`should return prices less than ${priceMax}`, () => { + it(`should return prices less than ${priceLimit}`, () => { results.forEach(r => { - expect(parseFloat(r.SpotPrice || '0')).toBeLessThanOrEqual(priceMax); + expect(r.spotPrice).toBeLessThanOrEqual(priceLimit); }); }); }); @@ -217,10 +220,131 @@ describe('lib', () => { nock.cleanAll(); }); it('should console log error', async () => { - await getGlobalSpotPrices({ regions: [region] }); + await getGlobalSpotPrices({ regions: [region], reduceAZ: false }); expect(console.error).toHaveBeenCalled(); expect(consoleMockCallJoin('error')).toContain('unexpected getEc2SpotPrice error'); }); }); + + describe('should handle auth error', () => { + const region: Region = 'ap-east-1'; + beforeAll(() => { + mockAwsCredentials(); + nock(`https://ec2.${region}.amazonaws.com`).persist().post('/').reply( + 401, + ` + + + + AuthFailure + AWS was not able to validate the provided access credentials + + + e359d062-474b-4621-888c-e269b594de4a + `, + ); + }); + afterAll(() => { + mockAwsCredentialsClear(); + nock.cleanAll(); + }); + it('should console log error', async () => { + try { + await getGlobalSpotPrices({ regions: [region], reduceAZ: false }); + expect(true).toBeFalsy(); + } catch (error) { + expect(error.name).toEqual('Ec2SpotPriceError'); + expect(error.region).toEqual(region); + expect(error.code).toEqual('AuthFailure'); + } + }); + }); + + describe('should fetch ec2 instance type info dynamically if not found from constants', () => { + let results: SpotPriceExtended[]; + let restoreConsole: RestoreConsole; + let t3aNanoInfo: Ec2InstanceInfo | undefined; + + beforeAll(async () => { + t3aNanoInfo = ec2Info['t3a.nano']; + delete ec2Info['t3a.nano']; + restoreConsole = mockConsole(); + mockDefaultRegionEndpoints(); + results = await getGlobalSpotPrices({ limit: 20 }); + }); + + afterAll(() => { + if (t3aNanoInfo) ec2Info['t3a.nano'] = t3aNanoInfo; + restoreConsole(); + mockDefaultRegionEndpointsClear(); + }); + + it('should return expected values', () => { + expect(results).toMatchSnapshot(); + }); + }); + + describe('should filter by minVCPU & minMemoryGiB', () => { + let results: SpotPriceExtended[]; + let restoreConsole: RestoreConsole; + + beforeAll(async () => { + restoreConsole = mockConsole(); + mockDefaultRegionEndpoints(); + results = await getGlobalSpotPrices({ limit: 5, minVCPU: 4, minMemoryGiB: 16 }); + }); + + afterAll(() => { + restoreConsole(); + mockDefaultRegionEndpointsClear(); + }); + + it('should return expected values', () => { + expect(results).toMatchSnapshot(); + }); + }); + }); + + describe('getEc2Info', () => { + type GetEc2InfoResults = Record< + string, + { vCpu?: number | undefined; memoryGiB?: number | undefined } + >; + + describe('run with default options', () => { + let results: GetEc2InfoResults; + + beforeAll(async () => { + mockDefaultRegionEndpoints({ maxLength: 5, returnPartialBlankValues: true }); + results = await getEc2Info(); + }); + + afterAll(() => { + mockDefaultRegionEndpointsClear(); + }); + + it('should return expected values', () => { + expect(Object.keys(results).length).toEqual(341); + expect(results).toMatchSnapshot(); + }); + }); + + describe('run with targeted instance type', () => { + let results: GetEc2InfoResults; + + beforeAll(async () => { + mockDefaultRegionEndpoints({ maxLength: 5, returnPartialBlankValues: true }); + results = await getEc2Info({ InstanceTypes: ['dummy.large'] }); + }); + + afterAll(() => { + mockDefaultRegionEndpointsClear(); + }); + + it('should return expected values', () => { + expect(Object.keys(results).length).toEqual(1); + expect(results).toMatchSnapshot(); + }); + }); }); }); diff --git a/src/lib/core.ts b/src/lib/core.ts index 82d2d642..b34e9c32 100644 --- a/src/lib/core.ts +++ b/src/lib/core.ts @@ -1,7 +1,8 @@ import EC2 from 'aws-sdk/clients/ec2'; +import { ec2Info, Ec2InstanceInfo } from '../constants/ec2-info'; import { InstanceFamilyType, InstanceSize, InstanceType } from '../constants/ec2-types'; -import { ProductDescription } from '../constants/product-description'; +import { Platform } from '../constants/platform'; import { Region, defaultRegions } from '../constants/regions'; import { generateInstantTypesFromFamilyTypeSize } from './utils'; @@ -27,6 +28,28 @@ const sortSpotPrice = (p1: EC2.SpotPrice, p2: EC2.SpotPrice): number => { return rtn; }; +const sortSpotPriceExtended = (p1: SpotPriceExtended, p2: SpotPriceExtended): number => { + let rtn = 0; + + const sort = (s1?: T, s2?: T): void => { + /* istanbul ignore else */ + if (rtn === 0 && s1 && s2) { + if (s1 < s2) { + rtn = -1; + } else if (s1 > s2) { + rtn = 1; + } + } + }; + + sort(p1.spotPrice, p2.spotPrice); + sort(p1.instanceType, p2.instanceType); + sort(p1.availabilityZone, p2.availabilityZone); + sort(p1.platform, p2.platform); + + return rtn; +}; + export class Ec2SpotPriceError extends Error { constructor(message: string, region: Region, code: string) { super(message) /* istanbul ignore next */; @@ -44,11 +67,11 @@ export class Ec2SpotPriceError extends Error { const getEc2SpotPrice = async (options: { region: Region; instanceTypes?: InstanceType[]; - productDescriptions?: ProductDescription[]; + platforms?: Platform[]; accessKeyId?: string; secretAccessKey?: string; }): Promise => { - const { region, instanceTypes, productDescriptions, accessKeyId, secretAccessKey } = options; + const { region, instanceTypes, platforms, accessKeyId, secretAccessKey } = options; let rtn: EC2.SpotPrice[] = []; @@ -67,7 +90,7 @@ const getEc2SpotPrice = async (options: { .describeSpotPriceHistory({ NextToken: nextToken, StartTime: startTime, - ProductDescriptions: productDescriptions, + ProductDescriptions: platforms, InstanceTypes: instanceTypes, }) .promise(); @@ -96,7 +119,7 @@ const getEc2SpotPrice = async (options: { } else { console.error( 'unexpected getEc2SpotPrice error.', - JSON.stringify({ region, instanceTypes, productDescriptions, error }, null, 2), + JSON.stringify({ region, instanceTypes, platforms, error }, null, 2), ); } } @@ -104,30 +127,106 @@ const getEc2SpotPrice = async (options: { return rtn; }; +// aws-sdk-js EC2.InstanceType is not always up to date. +type Ec2InstanceInfos = Record; + +export const getEc2Info = async ({ + region, + InstanceTypes, + log, +}: { + region?: string; + InstanceTypes?: (InstanceType | string)[]; + log?: boolean; +} = {}): Promise => { + if (!region) region = 'us-east-1'; + + const ec2 = new EC2({ region }); + + const fetchInfo = async (NextToken?: string): Promise => { + const rtn: Ec2InstanceInfos = {}; + const res = await ec2 + .describeInstanceTypes({ + NextToken, + MaxResults: InstanceTypes ? undefined : 100, + InstanceTypes, + }) + .promise(); + res.InstanceTypes?.forEach(i => { + if (i.InstanceType) { + rtn[i.InstanceType] = { + vCpu: i.VCpuInfo?.DefaultVCpus, + memoryGiB: i.MemoryInfo?.SizeInMiB + ? Math.ceil((i.MemoryInfo.SizeInMiB / 1024) * 1000) / 1000 // ceil to 3rd decimal place + : undefined, + }; + } + }); + /* istanbul ignore if */ + if (log) { + console.log( + `${region}: found ${res.InstanceTypes?.length}${res.NextToken ? ', fetching more...' : ''}`, + ); + } + const next = res.NextToken ? await fetchInfo(res.NextToken) : undefined; + return { ...rtn, ...next }; + }; + return fetchInfo(); +}; + export const defaults = { - limit: 20, + limit: 30, + wide: false, + reduceAZ: true, + platforms: ['Linux/UNIX', 'Linux/UNIX (Amazon VPC)'] as Platform[], + minVCPU: 1, + minMemoryGiB: 0.5, + priceLimit: 100, }; +export type SpotPriceExtended = { + availabilityZone: string; + instanceType: string; + platform: string; + spotPrice: number; + timestamp: Date; +} & Ec2InstanceInfo; + +const SpotPriceToExtended = (cur: EC2.SpotPrice) => + ({ + availabilityZone: cur.AvailabilityZone, + instanceType: cur.InstanceType, + platform: cur.ProductDescription, + spotPrice: cur.SpotPrice !== undefined ? parseFloat(cur.SpotPrice) : Number.MAX_VALUE, + timestamp: cur.Timestamp, + } as SpotPriceExtended); + export const getGlobalSpotPrices = async (options?: { regions?: Region[]; familyTypes?: InstanceFamilyType[]; sizes?: InstanceSize[]; - priceMax?: number; + priceLimit?: number; + minVCPU?: number; + minMemoryGiB?: number; instanceTypes?: InstanceType[]; - productDescriptions?: ProductDescription[]; + platforms?: Platform[]; limit?: number; + reduceAZ?: boolean; accessKeyId?: string; secretAccessKey?: string; onRegionFetch?: (region: Region) => void; onRegionFetchFail?: (error: Ec2SpotPriceError) => void; onFetchComplete?: () => void; -}): Promise => { +}): Promise => { const { familyTypes, sizes, - priceMax, - productDescriptions, + priceLimit, + minVCPU, + minMemoryGiB, + platforms, limit, + reduceAZ, accessKeyId, secretAccessKey, onRegionFetch, @@ -139,7 +238,7 @@ export const getGlobalSpotPrices = async (options?: { let { regions, instanceTypes } = options || {}; - if (regions === undefined) regions = defaultRegions; + if (regions === undefined || !regions.length) regions = defaultRegions; if (familyTypes || sizes) { const { instanceTypes: instanceTypesGenerated } = generateInstantTypesFromFamilyTypeSize({ @@ -153,13 +252,13 @@ export const getGlobalSpotPrices = async (options?: { } } - const rtn: EC2.SpotPrice[] = await Promise.all( + const rtn: SpotPriceExtended[] = await Promise.all( regions.map(async region => { try { const regionsPrices = await getEc2SpotPrice({ region, instanceTypes, - productDescriptions, + platforms, accessKeyId, secretAccessKey, }); @@ -168,67 +267,135 @@ export const getGlobalSpotPrices = async (options?: { return regionsPrices; } catch (error) { /* istanbul ignore if */ - if (error instanceof Ec2SpotPriceError) { - if (onRegionFetchFail) { - onRegionFetchFail(error); - } else { - throw error; - } + if (onRegionFetchFail) { + onRegionFetchFail(error); } else { - console.error(error); + throw error; } return []; } }), - ).then(results => { - /* istanbul ignore if */ - if (onFetchComplete) onFetchComplete(); - return results - .reduce((finalList: EC2.SpotPrice[], curList: EC2.SpotPrice[]) => { - const curListFiltered = curList.filter( - // filter price info without region or price greater than priceMax - price => { + ) + .then(results => { + // attach ec2 instance type info + /* istanbul ignore if */ + if (onFetchComplete) onFetchComplete(); + return Promise.all( + results + .reduce((acc, r) => { + // look for duplicate and remove prev data if older than current + const reduceToLatest = r.reduce((reduced, cur) => { + const duplicateIndex = reduced.findIndex( + info => + cur.AvailabilityZone && + cur.AvailabilityZone === info.availabilityZone && + cur.InstanceType && + cur.InstanceType === info.instanceType && + cur.ProductDescription && + cur.ProductDescription === info.platform, + ); + if (duplicateIndex >= 0) { + const dupeTimestamp = reduced[duplicateIndex].timestamp; + if (cur.Timestamp && dupeTimestamp && cur.Timestamp > dupeTimestamp) { + reduced.splice(duplicateIndex, 1); + reduced.push(SpotPriceToExtended(cur)); + } + } else { + reduced.push(SpotPriceToExtended(cur)); + } + return reduced; + }, [] as SpotPriceExtended[]); + + if (!reduceAZ) { + acc.push(...reduceToLatest); + return acc; + } + + // reduce results by region, choosing by cheapest record + acc.push( + ...reduceToLatest.reduce((reduced, cur) => { + const duplicateIndex = reduced.findIndex(info => { + const curRegion = cur.availabilityZone?.match(/^.+\d{1,}/)?.[0]; + const infoRegion = cur.availabilityZone?.match(/^.+\d{1,}/)?.[0]; + return ( + curRegion && + curRegion === infoRegion && + cur.instanceType && + cur.instanceType === info.instanceType && + cur.platform && + cur.platform === info.platform + ); + }); + // since items have already been sorted by price from getEc2SpotPrice() + // simply look for duplicates and add if non found + if (duplicateIndex < 0) reduced.push(cur); + return reduced; + }, [] as SpotPriceExtended[]), + ); + return acc; + }, [] as SpotPriceExtended[]) + .map(async r => { + const rExtended = { ...r } as SpotPriceExtended; + const instanceInfo = Object.entries(ec2Info).find( + ([instanceType]) => instanceType === r.instanceType, + )?.[1]; + if (instanceInfo) { + rExtended.vCpu = instanceInfo.vCpu; + rExtended.memoryGiB = instanceInfo.memoryGiB; + } else { + // fetch intance info data from aws + const region = rExtended.availabilityZone.match(/^.+\d/)?.[0]; + if (region && rExtended.instanceType) { + const desc = await getEc2Info({ region, InstanceTypes: [rExtended.instanceType] }); + + if ( + desc[rExtended.instanceType] && + desc[rExtended.instanceType].vCpu && + desc[rExtended.instanceType].memoryGiB + ) { + ec2Info[rExtended.instanceType] = { + vCpu: desc[rExtended.instanceType].vCpu, + memoryGiB: desc[rExtended.instanceType].memoryGiB, + }; + rExtended.vCpu = desc[rExtended.instanceType].vCpu; + rExtended.memoryGiB = desc[rExtended.instanceType].memoryGiB; + } + } + } + return rExtended; + }), + ); + }) + .then(results => { + return results + .filter( + // filter out info without region or price greater than priceLimit + info => { // 1. remove if data missing any of the required attributes - // 2. remove if price.SpotPrice is unavailable or price is higher than priceMax - if ( - !price.AvailabilityZone || - !price.SpotPrice || - !price.InstanceType || - (priceMax !== undefined && parseFloat(price.SpotPrice) > priceMax) - ) + // 2. remove if price.SpotPrice is unavailable or price is higher than priceLimit + // 2. remove if minimum vcpu / memory requirements does not meet requirements + if (!info.availabilityZone || !info.spotPrice || !info.instanceType) { + return false; + } + if (priceLimit !== undefined && info.spotPrice > priceLimit) { return false; + } + if (minVCPU !== undefined && info.vCpu !== undefined && info.vCpu < minVCPU) { + return false; + } + if ( + minMemoryGiB !== undefined && + info.memoryGiB !== undefined && + info.memoryGiB < minMemoryGiB + ) { + return false; + } return true; }, - ); - // look for duplicate and remove prev data if older than current - const curListReduced = curListFiltered.reduce((list, cur) => { - const duplicates = list.filter( - prevPrice => - cur.AvailabilityZone && - cur.AvailabilityZone === prevPrice.AvailabilityZone && - cur.InstanceType && - cur.InstanceType === prevPrice.InstanceType && - cur.ProductDescription && - cur.ProductDescription === prevPrice.ProductDescription, - ); - if (duplicates.length) { - while (duplicates.length) { - const dupe = duplicates.pop(); - if (dupe && cur.Timestamp && dupe.Timestamp && cur.Timestamp > dupe.Timestamp) { - list.splice(list.indexOf(dupe)); - list.push(cur); - } - } - } else { - list.push(cur); - } - return list; - }, [] as EC2.SpotPrice[]); - return finalList.concat(curListReduced); - }, [] as EC2.SpotPrice[]) - .sort(sortSpotPrice); - }); + ) + .sort(sortSpotPriceExtended); + }); // limit output if (limit && rtn.length > limit) rtn.splice(limit); diff --git a/src/lib/ui.spec.ts b/src/lib/ui.spec.ts index 7987814d..92ab5134 100644 --- a/src/lib/ui.spec.ts +++ b/src/lib/ui.spec.ts @@ -35,6 +35,10 @@ describe('cli-ui', () => { undefined, undefined, undefined, + undefined, + undefined, + false, + false, ]); }); @@ -50,8 +54,8 @@ describe('cli-ui', () => { expect(result.family).toEqual(['compute']); expect(result.familyType.sort()).toEqual(Array.from(instanceFamilyCompute).sort()); expect(result.size.sort()).toEqual(getFamilySize(['compute']).sort()); - expect(result.productDescription).toHaveLength(0); - expect(result.priceMax).toBeFalsy(); + expect(result.platforms).toHaveLength(0); + expect(result.priceLimit).toBeFalsy(); expect(result.limit).toBeFalsy(); expect(result.accessKeyId).toBeFalsy(); } @@ -69,6 +73,10 @@ describe('cli-ui', () => { undefined, undefined, undefined, + undefined, + undefined, + false, + false, ]); }); @@ -86,8 +94,8 @@ describe('cli-ui', () => { (Array.from(instanceFamilyGeneral) as string[]).concat(instanceFamilyMemory).sort(), ); expect(result.size.sort()).toEqual(getFamilySize(['general', 'memory']).sort()); - expect(result.productDescription).toHaveLength(0); - expect(result.priceMax).toBeFalsy(); + expect(result.platforms).toHaveLength(0); + expect(result.priceLimit).toBeFalsy(); expect(result.limit).toBeFalsy(); expect(result.accessKeyId).toBeFalsy(); } @@ -102,8 +110,12 @@ describe('cli-ui', () => { ['c4', 'r5', 'f1'], ['nano', 'micro', 'small', 'medium', 'large'], ['Linux/UNIX', 'SUSE Linux'], + undefined, + undefined, 0.5, 21, + false, + false, 'accessKeyId', 'secretAccessKey', ]); @@ -123,8 +135,8 @@ describe('cli-ui', () => { expect(result.family.sort()).toHaveLength(0); expect(result.familyType.sort()).toEqual(['c4', 'r5', 'f1'].sort()); expect(result.size.sort()).toEqual(['nano', 'micro', 'small', 'medium', 'large'].sort()); - expect(result.productDescription.sort()).toEqual(['Linux/UNIX', 'SUSE Linux'].sort()); - expect(result.priceMax).toEqual(0.5); + expect(result.platforms.sort()).toEqual(['Linux/UNIX', 'SUSE Linux'].sort()); + expect(result.priceLimit).toEqual(0.5); expect(result.limit).toEqual(21); expect(result.accessKeyId).toEqual('accessKeyId'); expect(result.secretAccessKey).toEqual('secretAccessKey'); diff --git a/src/lib/ui.ts b/src/lib/ui.ts index 0727b7ab..1a22a3f0 100644 --- a/src/lib/ui.ts +++ b/src/lib/ui.ts @@ -8,8 +8,9 @@ import { instanceFamilyTypes, instanceSizes, } from '../constants/ec2-types'; -import { ProductDescription, allProductDescriptions } from '../constants/product-description'; +import { Platform, allPlatforms } from '../constants/platform'; import { Region, allRegions, regionNames } from '../constants/regions'; +import { defaults } from './core'; import { generateTypeSizeSetsFromFamily } from './utils'; type Answer1 = { region: Region[]; family: InstanceFamily[] }; @@ -17,9 +18,13 @@ type Answer1 = { region: Region[]; family: InstanceFamily[] }; type Answer2 = { familyType: InstanceFamilyType[]; size: InstanceSize[]; - productDescription: ProductDescription[]; - priceMax: number; + platforms: Platform[]; + priceLimit: number; + minVCPU: number; + minMemoryGiB: number; + reduceAZ: boolean; limit: number; + wide: boolean; accessKeyId: string; secretAccessKey: string; }; @@ -131,19 +136,36 @@ export const ui = async (): Promise => { }, { type: 'autocompleteMultiselect', - name: 'productDescription', - message: `Select EC2 Product description (select none to include all)`, + name: 'platforms', + message: `Select Platform`, instructions: false, - choices: allProductDescriptions.map(desc => ({ + choices: allPlatforms.map(desc => ({ title: desc, value: desc, + selected: defaults.platforms.includes(desc), })), }, { type: 'number', - name: 'priceMax', - message: `Select maximum price`, - initial: 5, + name: 'minVCPU', + message: `Select minimum vCPU count`, + initial: defaults.minVCPU, + increment: 1, + min: 1, + }, + { + type: 'number', + name: 'minMemoryGiB', + message: `Select minimum memory (GiB)`, + initial: defaults.minMemoryGiB, + increment: 0.5, + min: 0.5, + }, + { + type: 'number', + name: 'priceLimit', + message: `Set maximum price limit`, + initial: defaults.priceLimit, float: true, round: 4, increment: 0.0001, @@ -153,9 +175,21 @@ export const ui = async (): Promise => { type: 'number', name: 'limit', message: `Select result limit`, - initial: 20, + initial: defaults.limit, min: 1, }, + { + type: 'confirm', + name: 'reduceAZ', + message: `Reduce results with cheapest Availability Zone within Region`, + initial: defaults.reduceAZ, + }, + { + type: 'confirm', + name: 'wide', + message: `Output results with detail (vCPU, memory, etc)`, + initial: defaults.wide, + }, { type: 'text', name: 'accessKeyId', diff --git a/src/module.ts b/src/module.ts index fadea04f..f434e8af 100644 --- a/src/module.ts +++ b/src/module.ts @@ -3,5 +3,5 @@ export * from './lib/core'; export * from './lib/credential'; export * from './lib/utils'; export * from './constants/ec2-types'; -export * from './constants/product-description'; +export * from './constants/platform'; export * from './constants/regions'; diff --git a/test/__snapshots__/cli.spec.ts.snap b/test/__snapshots__/cli.spec.ts.snap index 0a368322..4275dd0d 100644 --- a/test/__snapshots__/cli.spec.ts.snap +++ b/test/__snapshots__/cli.spec.ts.snap @@ -3,125 +3,156 @@ exports[`cli test by import should handle JSON output option 1`] = ` "[ { - \\"AvailabilityZone\\": \\"us-east-1a\\", - \\"InstanceType\\": \\"t3.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001600\\", - \\"Timestamp\\": \\"2019-10-15T17:09:43.000Z\\" + \\"availabilityZone\\": \\"us-east-1a\\", + \\"instanceType\\": \\"t3.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0016, + \\"timestamp\\": \\"2019-10-15T17:09:43.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1b\\", - \\"InstanceType\\": \\"t3.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001600\\", - \\"Timestamp\\": \\"2019-10-15T17:09:43.000Z\\" + \\"availabilityZone\\": \\"us-east-1b\\", + \\"instanceType\\": \\"t3.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0016, + \\"timestamp\\": \\"2019-10-15T17:09:43.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1c\\", - \\"InstanceType\\": \\"t3.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001600\\", - \\"Timestamp\\": \\"2019-10-15T17:09:43.000Z\\" + \\"availabilityZone\\": \\"us-east-1c\\", + \\"instanceType\\": \\"t3.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0016, + \\"timestamp\\": \\"2019-10-15T17:09:43.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1d\\", - \\"InstanceType\\": \\"t3.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001600\\", - \\"Timestamp\\": \\"2019-10-15T17:09:43.000Z\\" + \\"availabilityZone\\": \\"us-east-1d\\", + \\"instanceType\\": \\"t3.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0016, + \\"timestamp\\": \\"2019-10-15T17:09:43.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1f\\", - \\"InstanceType\\": \\"t3.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001600\\", - \\"Timestamp\\": \\"2019-10-15T17:09:43.000Z\\" + \\"availabilityZone\\": \\"us-east-1f\\", + \\"instanceType\\": \\"t3.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0016, + \\"timestamp\\": \\"2019-10-15T17:09:43.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1a\\", - \\"InstanceType\\": \\"t3a.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001700\\", - \\"Timestamp\\": \\"2019-10-15T22:11:29.000Z\\" + \\"availabilityZone\\": \\"us-east-1a\\", + \\"instanceType\\": \\"t3a.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0017, + \\"timestamp\\": \\"2019-10-15T22:11:29.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1c\\", - \\"InstanceType\\": \\"t3a.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001700\\", - \\"Timestamp\\": \\"2019-10-15T22:11:29.000Z\\" + \\"availabilityZone\\": \\"us-east-1c\\", + \\"instanceType\\": \\"t3a.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0017, + \\"timestamp\\": \\"2019-10-15T22:11:29.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1b\\", - \\"InstanceType\\": \\"t3a.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001800\\", - \\"Timestamp\\": \\"2019-10-15T22:11:29.000Z\\" + \\"availabilityZone\\": \\"us-east-1b\\", + \\"instanceType\\": \\"t3a.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0018, + \\"timestamp\\": \\"2019-10-15T22:11:29.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1d\\", - \\"InstanceType\\": \\"t3a.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001800\\", - \\"Timestamp\\": \\"2019-10-15T20:21:10.000Z\\" + \\"availabilityZone\\": \\"us-east-1d\\", + \\"instanceType\\": \\"t3a.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0018, + \\"timestamp\\": \\"2019-10-15T20:21:10.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 }, { - \\"AvailabilityZone\\": \\"us-east-1f\\", - \\"InstanceType\\": \\"t3a.nano\\", - \\"ProductDescription\\": \\"Linux/UNIX (Amazon VPC)\\", - \\"SpotPrice\\": \\"0.001800\\", - \\"Timestamp\\": \\"2019-10-15T22:11:29.000Z\\" + \\"availabilityZone\\": \\"us-east-1f\\", + \\"instanceType\\": \\"t3a.nano\\", + \\"platform\\": \\"Linux/UNIX (Amazon VPC)\\", + \\"spotPrice\\": 0.0018, + \\"timestamp\\": \\"2019-10-15T22:11:29.000Z\\", + \\"vCpu\\": 2, + \\"memoryGiB\\": 0.5 } ]" `; exports[`cli test by import should handle instance family option 1`] = ` -"╔═══════════╤══════════╤═════════════════════════╤═════════════════╤═════════════════════════╗ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-east-1a │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-east-1b │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-east-1c │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-east-1d │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-west-2b │ US West (Oregon) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.013000 │ Linux/UNIX │ us-west-2c │ US West (Oregon) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.014800 │ Linux/UNIX │ eu-west-1a │ EU (Ireland) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.014800 │ Linux/UNIX │ eu-west-1b │ EU (Ireland) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.014800 │ Linux/UNIX │ eu-west-1c │ EU (Ireland) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.014800 │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.014800 │ Linux/UNIX │ us-west-1c │ US West (N. California) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.015800 │ Linux/UNIX │ ap-northeast-1a │ Asia Pacific (Tokyo) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.015800 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1a │ Asia Pacific (Tokyo) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.015800 │ Linux/UNIX │ ap-northeast-1c │ Asia Pacific (Tokyo) ║ -╟───────────┼──────────┼─────────────────────────┼─────────────────┼─────────────────────────╢ -║ c1.medium │ 0.015800 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1c │ Asia Pacific (Tokyo) ║ -╚═══════════╧══════════╧═════════════════════════╧═════════════════╧═════════════════════════╝ +"╔═══════════╤════════╤═════════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟───────────┼────────┼─────────────────────────┼───────────────────╢ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-east-1a ║ +║ c1.medium │ 0.0130 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-east-1b ║ +║ c1.medium │ 0.0130 │ Linux/UNIX (Amazon VPC) │ us-east-1b ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-east-1c ║ +║ c1.medium │ 0.0130 │ Linux/UNIX (Amazon VPC) │ us-east-1c ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-east-1d ║ +║ c1.medium │ 0.0130 │ Linux/UNIX (Amazon VPC) │ us-east-1d ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-west-2a ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-west-2b ║ +║ c1.medium │ 0.0130 │ Linux/UNIX │ us-west-2c ║ +║ c1.medium │ 0.0148 │ Linux/UNIX │ eu-west-1a ║ +║ c1.medium │ 0.0148 │ Linux/UNIX │ eu-west-1b ║ +║ c1.medium │ 0.0148 │ Linux/UNIX │ eu-west-1c ║ +║ c1.medium │ 0.0148 │ Linux/UNIX │ us-west-1b ║ +║ c1.medium │ 0.0148 │ Linux/UNIX │ us-west-1c ║ +║ c1.medium │ 0.0158 │ Linux/UNIX │ ap-northeast-1a ║ +║ c1.medium │ 0.0158 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1a ║ +║ c1.medium │ 0.0158 │ Linux/UNIX │ ap-northeast-1c ║ +║ c1.medium │ 0.0158 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1c ║ +╚═══════════╧════════╧═════════════════════════╧═══════════════════╝ +" +`; + +exports[`cli test by import should handle no ec2 info found should return expected values 1`] = ` +"╔═══════════╤════════╤═════════╤═════════╤═════════════════════════╤═══════════════════╤═════════════════════════╗ +║ Type │ Price │ vCPU │ RAM │ Platform │ Availability Zone │ Region ║ +╟───────────┼────────┼─────────┼─────────┼─────────────────────────┼───────────────────┼─────────────────────────╢ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-east-1a │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-east-1b │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-east-1c │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-east-1d │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-west-2b │ US West (Oregon) ║ +║ c1.medium │ 0.0130 │ unknown │ unknown │ Linux/UNIX │ us-west-2c │ US West (Oregon) ║ +║ c1.medium │ 0.0148 │ unknown │ unknown │ Linux/UNIX │ eu-west-1a │ Europe (Ireland) ║ +║ c1.medium │ 0.0148 │ unknown │ unknown │ Linux/UNIX │ eu-west-1b │ Europe (Ireland) ║ +║ c1.medium │ 0.0148 │ unknown │ unknown │ Linux/UNIX │ eu-west-1c │ Europe (Ireland) ║ +║ c1.medium │ 0.0148 │ unknown │ unknown │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ +║ c1.medium │ 0.0148 │ unknown │ unknown │ Linux/UNIX │ us-west-1c │ US West (N. California) ║ +║ c1.medium │ 0.0158 │ unknown │ unknown │ Linux/UNIX │ ap-northeast-1a │ Asia Pacific (Tokyo) ║ +║ c1.medium │ 0.0158 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ ap-northeast-1a │ Asia Pacific (Tokyo) ║ +║ c1.medium │ 0.0158 │ unknown │ unknown │ Linux/UNIX │ ap-northeast-1c │ Asia Pacific (Tokyo) ║ +║ c1.medium │ 0.0158 │ unknown │ unknown │ Linux/UNIX (Amazon VPC) │ ap-northeast-1c │ Asia Pacific (Tokyo) ║ +╚═══════════╧════════╧═════════╧═════════╧═════════════════════════╧═══════════════════╧═════════════════════════╝ " `; exports[`cli test by import should print help 1`] = ` -"spot-price +"aws-spot-price get current AWS spot instance prices @@ -131,9 +162,9 @@ Options: --ui Start with UI mode [boolean] [default: false] -r, --region AWS regions. [array] [choices: \\"us-east-1\\", \\"us-east-2\\", \\"us-west-1\\", \\"us-west-2\\", - \\"ca-central-1\\", \\"eu-central-1\\", \\"eu-west-1\\", \\"eu-west-2\\", \\"eu-west-3\\", - \\"eu-north-1\\", \\"ap-east-1\\", \\"ap-northeast-1\\", \\"ap-northeast-2\\", - \\"ap-northeast-3\\", \\"ap-southeast-1\\", \\"ap-southeast-2\\", \\"ap-south-1\\", + \\"af-south-1\\", \\"ap-east-1\\", \\"ap-northeast-1\\", \\"ap-northeast-2\\", \\"ap-south-1\\", + \\"ap-southeast-1\\", \\"ap-southeast-2\\", \\"ca-central-1\\", \\"eu-central-1\\", + \\"eu-north-1\\", \\"eu-south-1\\", \\"eu-west-1\\", \\"eu-west-2\\", \\"eu-west-3\\", \\"me-south-1\\", \\"sa-east-1\\"] -i, --instanceType EC2 type [array] [choices: \\"a1.medium\\", \\"a1.large\\", \\"a1.xlarge\\", \\"a1.2xlarge\\", @@ -219,197 +250,197 @@ Options: [array] [choices: \\"nano\\", \\"micro\\", \\"small\\", \\"medium\\", \\"large\\", \\"xlarge\\", \\"2xlarge\\", \\"3xlarge\\", \\"4xlarge\\", \\"6xlarge\\", \\"8xlarge\\", \\"9xlarge\\", \\"10xlarge\\", \\"12xlarge\\", \\"16xlarge\\", \\"18xlarge\\", \\"24xlarge\\", \\"32xlarge\\", \\"metal\\"] - -p, --priceMax Maximum price [number] - -d, --productDescription Product descriptions. Choose \`windows\` or \`linux\` - (all lowercase) as wildcard. + --minVCPU, --mc Minimum VCPU count [number] [default: 1] + --minMemoryGiB, --mm Minimum memory (GiB) [number] [default: 0.5] + --priceLimit, --pl Maximum price limit [number] [default: 100] + -p, --platforms Platforms. Choose \`windows\` or \`linux\` (all + lowercase) as wildcard. [array] [choices: \\"Linux/UNIX\\", \\"Linux/UNIX (Amazon VPC)\\", \\"SUSE Linux\\", \\"SUSE Linux (Amazon VPC)\\", \\"Red Hat Enterprise Linux\\", \\"Red Hat Enterprise Linux (Amazon VPC)\\", \\"Windows\\", \\"Windows (Amazon VPC)\\", \\"linux\\", \\"windows\\"] - -l, --limit Limit results output length [number] [default: 20] + [default: [\\"Linux/UNIX\\",\\"Linux/UNIX (Amazon VPC)\\"]] + -l, --limit Limit results output length [number] [default: 30] + --reduceAZ, --raz Reduce results with cheapest Availability Zone + within Region [boolean] [default: true] + -w, --wide Output results with detail (vCPU, memory, etc) + [boolean] [default: false] -j, --json Outputs in JSON format [boolean] [default: false] --accessKeyId AWS Access Key ID. [string] --secretAccessKey AWS Secret Access Key. [string]" `; +exports[`cli test by import should return expected values if no matching records found 1`] = `"no matching records found"`; + exports[`cli test by import should return expected values with default options 1`] = ` -"╔══════════╤══════════╤═════════════════════════╤═══════════════╤═══════════════════════╗ -║ t3a.nano │ 0.001500 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3a.nano │ 0.001500 │ Linux/UNIX │ us-west-2c │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3a.nano │ 0.001500 │ Linux/UNIX │ us-west-2d │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ eu-north-1a │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ eu-north-1b │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ eu-north-1c │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-east-2a │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-east-2b │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-east-2c │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-west-2b │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-west-2c │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX │ us-west-2d │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3a.nano │ 0.001600 │ Linux/UNIX │ ca-central-1a │ Canada (Central) ║ -╟──────────┼──────────┼─────────────────────────┼───────────────┼───────────────────────╢ -║ t3a.nano │ 0.001600 │ Linux/UNIX │ ca-central-1b │ Canada (Central) ║ -╚══════════╧══════════╧═════════════════════════╧═══════════════╧═══════════════════════╝ +"╔══════════╤════════╤═════════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼────────┼─────────────────────────┼───────────────────╢ +║ t3a.nano │ 0.0015 │ Linux/UNIX │ us-west-2a ║ +║ t3.nano │ 0.0016 │ Linux/UNIX │ eu-north-1a ║ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ t3.nano │ 0.0016 │ Linux/UNIX │ us-east-2a ║ +║ t3.nano │ 0.0016 │ Linux/UNIX │ us-west-2a ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ ca-central-1a ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ eu-central-1a ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ eu-west-1b ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ eu-west-2a ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ eu-west-3a ║ +║ t3a.nano │ 0.0016 │ Linux/UNIX │ us-east-2b ║ +║ t3.nano │ 0.0017 │ Linux/UNIX │ ap-south-1a ║ +║ t3.nano │ 0.0017 │ Linux/UNIX │ ca-central-1a ║ +║ t3.nano │ 0.0017 │ Linux/UNIX │ eu-west-1a ║ +║ t3a.nano │ 0.0017 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ t3a.nano │ 0.0017 │ Linux/UNIX │ us-west-1b ║ +║ t3.nano │ 0.0018 │ Linux/UNIX │ eu-central-1a ║ +║ t3.nano │ 0.0018 │ Linux/UNIX │ eu-west-2a ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1a ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX │ ap-northeast-2a ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1a ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX │ ap-southeast-2a ║ +║ t3.nano │ 0.0019 │ Linux/UNIX │ us-west-1b ║ +║ t3a.nano │ 0.0019 │ Linux/UNIX │ sa-east-1a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX │ ap-southeast-1a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX │ ap-southeast-2a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX │ eu-west-1a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX │ us-east-1a ║ +║ t1.micro │ 0.0020 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +╚══════════╧════════╧═════════════════════════╧═══════════════════╝ " `; exports[`cli test by import should return expected values with instance family types and sizes 1`] = ` -"╔══════════╤══════════╤═════════════════════════╤═════════════════╤══════════════════════════╗ -║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2a │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2b │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2c │ US East (Ohio) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1a │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1b │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1c │ EU (Stockholm) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.028900 │ Linux/UNIX │ ca-central-1a │ Canada (Central) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.029300 │ Linux/UNIX │ ca-central-1b │ Canada (Central) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2a │ Asia Pacific (Seoul) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2b │ Asia Pacific (Seoul) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2c │ Asia Pacific (Seoul) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030300 │ Linux/UNIX │ eu-west-3c │ EU (Paris) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030400 │ Linux/UNIX │ eu-west-3b │ EU (Paris) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.030800 │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.031300 │ Linux/UNIX │ us-west-1c │ US West (N. California) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.031400 │ Linux/UNIX │ eu-west-2a │ EU (London) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.032100 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1c │ Asia Pacific (Singapore) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.032200 │ Linux/UNIX │ eu-west-2b │ EU (London) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.032600 │ Linux/UNIX │ us-west-2d │ US West (Oregon) ║ -╟──────────┼──────────┼─────────────────────────┼─────────────────┼──────────────────────────╢ -║ c5.large │ 0.032800 │ Linux/UNIX (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╚══════════╧══════════╧═════════════════════════╧═════════════════╧══════════════════════════╝ +"╔══════════╤══════════╤═════════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼──────────┼─────────────────────────┼───────────────────╢ +║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2a ║ +║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2b ║ +║ c5.large │ 0.019000 │ Linux/UNIX │ us-east-2c ║ +║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1a ║ +║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1b ║ +║ c5.large │ 0.027300 │ Linux/UNIX │ eu-north-1c ║ +║ c5.large │ 0.028900 │ Linux/UNIX │ ca-central-1a ║ +║ c5.large │ 0.029300 │ Linux/UNIX │ ca-central-1b ║ +║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2a ║ +║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2b ║ +║ c5.large │ 0.030000 │ Linux/UNIX │ ap-northeast-2c ║ +║ c5.large │ 0.030300 │ Linux/UNIX │ eu-west-3c ║ +║ c5.large │ 0.030400 │ Linux/UNIX │ eu-west-3b ║ +║ c5.large │ 0.030800 │ Linux/UNIX │ us-west-1b ║ +║ c5.large │ 0.031300 │ Linux/UNIX │ us-west-1c ║ +║ c5.large │ 0.031400 │ Linux/UNIX │ eu-west-2a ║ +║ c5.large │ 0.032100 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1c ║ +║ c5.large │ 0.032200 │ Linux/UNIX │ eu-west-2b ║ +║ c5.large │ 0.032600 │ Linux/UNIX │ us-west-2d ║ +║ c5.large │ 0.032712 │ Linux/UNIX (Amazon VPC) │ us-east-1f ║ +╚══════════╧══════════╧═════════════════════════╧═══════════════════╝ " `; exports[`cli test by import should return expected values with user options 1`] = ` -"╔══════════╤══════════╤═════════════════════════╤════════════╤═══════════════════════╗ -║ c5.large │ 0.032800 │ Linux/UNIX (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ c5.large │ 0.037600 │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ c5.large │ 0.038300 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ c5.large │ 0.038400 │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ c5.large │ 0.041000 │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╚══════════╧══════════╧═════════════════════════╧════════════╧═══════════════════════╝ +"╔══════════╤══════════╤═════════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼──────────┼─────────────────────────┼───────────────────╢ +║ c5.large │ 0.032712 │ Linux/UNIX (Amazon VPC) │ us-east-1f ║ +║ c5.large │ 0.037600 │ Linux/UNIX (Amazon VPC) │ us-east-1c ║ +║ c5.large │ 0.038300 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ c5.large │ 0.038400 │ Linux/UNIX (Amazon VPC) │ us-east-1d ║ +║ c5.large │ 0.041000 │ Linux/UNIX (Amazon VPC) │ us-east-1b ║ +╚══════════╧══════════╧═════════════════════════╧═══════════════════╝ +" +`; + +exports[`cli test by import should return expected values with wide option 1`] = ` +"╔══════════╤════════╤══════╤═══════╤═════════════════════════╤═══════════════════╤═══════════════════════════╗ +║ Type │ Price │ vCPU │ RAM │ Platform │ Availability Zone │ Region ║ +╟──────────┼────────┼──────┼───────┼─────────────────────────┼───────────────────┼───────────────────────────╢ +║ t3a.nano │ 0.0015 │ 2 │ 0.5 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ +║ t3.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ eu-north-1a │ Europe (Stockholm) ║ +║ t3.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ +║ t3.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ us-east-2a │ US East (Ohio) ║ +║ t3.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ ca-central-1a │ Canada (Central) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ eu-central-1a │ Europe (Frankfurt) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ eu-west-1b │ Europe (Ireland) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ eu-west-2a │ Europe (London) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ eu-west-3a │ Europe (Paris) ║ +║ t3a.nano │ 0.0016 │ 2 │ 0.5 │ Linux/UNIX │ us-east-2b │ US East (Ohio) ║ +║ t3.nano │ 0.0017 │ 2 │ 0.5 │ Linux/UNIX │ ap-south-1a │ Asia Pacific (Mumbai) ║ +║ t3.nano │ 0.0017 │ 2 │ 0.5 │ Linux/UNIX │ ca-central-1a │ Canada (Central) ║ +║ t3.nano │ 0.0017 │ 2 │ 0.5 │ Linux/UNIX │ eu-west-1a │ Europe (Ireland) ║ +║ t3a.nano │ 0.0017 │ 2 │ 0.5 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ +║ t3a.nano │ 0.0017 │ 2 │ 0.5 │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ +║ t3.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX │ eu-central-1a │ Europe (Frankfurt) ║ +║ t3.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX │ eu-west-2a │ Europe (London) ║ +║ t3a.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX (Amazon VPC) │ ap-northeast-1a │ Asia Pacific (Tokyo) ║ +║ t3a.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX │ ap-northeast-2a │ Asia Pacific (Seoul) ║ +║ t3a.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1a │ Asia Pacific (Singapore) ║ +║ t3a.nano │ 0.0018 │ 2 │ 0.5 │ Linux/UNIX │ ap-southeast-2a │ Asia Pacific (Sydney) ║ +║ t3.nano │ 0.0019 │ 2 │ 0.5 │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ +║ t3a.nano │ 0.0019 │ 2 │ 0.5 │ Linux/UNIX │ sa-east-1a │ South America (Sao Paulo) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX │ ap-southeast-1a │ Asia Pacific (Singapore) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX (Amazon VPC) │ ap-southeast-1a │ Asia Pacific (Singapore) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX │ ap-southeast-2a │ Asia Pacific (Sydney) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX │ eu-west-1a │ Europe (Ireland) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX │ us-east-1a │ US East (N. Virginia) ║ +║ t1.micro │ 0.0020 │ 1 │ 0.613 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ +╚══════════╧════════╧══════╧═══════╧═════════════════════════╧═══════════════════╧═══════════════════════════╝ " `; -exports[`cli test by import should return expected values with wildcard product descriptions 1`] = ` -"╔══════════╤══════════╤═════════════════════════╤════════════╤═══════════════════════╗ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3.nano │ 0.001600 │ Linux/UNIX (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.001700 │ Linux/UNIX (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.001700 │ Linux/UNIX (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.001800 │ Linux/UNIX (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.001800 │ Linux/UNIX (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼─────────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.001800 │ Linux/UNIX (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╚══════════╧══════════╧═════════════════════════╧════════════╧═══════════════════════╝ +exports[`cli test by import should return expected values with wildcard platforms 1`] = ` +"╔══════════╤════════╤═════════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼────────┼─────────────────────────┼───────────────────╢ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1b ║ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1c ║ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1d ║ +║ t3.nano │ 0.0016 │ Linux/UNIX (Amazon VPC) │ us-east-1f ║ +║ t3a.nano │ 0.0017 │ Linux/UNIX (Amazon VPC) │ us-east-1a ║ +║ t3a.nano │ 0.0017 │ Linux/UNIX (Amazon VPC) │ us-east-1c ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX (Amazon VPC) │ us-east-1b ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX (Amazon VPC) │ us-east-1d ║ +║ t3a.nano │ 0.0018 │ Linux/UNIX (Amazon VPC) │ us-east-1f ║ +╚══════════╧════════╧═════════════════════════╧═══════════════════╝ -╔══════════╤══════════╤══════════════════════╤════════════╤═══════════════════════╗ -║ t1.micro │ 0.002000 │ Windows │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows │ us-east-1b │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows (Amazon VPC) │ us-east-1b │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows (Amazon VPC) │ us-east-1c │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows (Amazon VPC) │ us-east-1d │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t1.micro │ 0.002000 │ Windows (Amazon VPC) │ us-east-1f │ US East (N. Virginia) ║ -╟──────────┼──────────┼──────────────────────┼────────────┼───────────────────────╢ -║ t3a.nano │ 0.006000 │ Windows (Amazon VPC) │ us-east-1a │ US East (N. Virginia) ║ -╚══════════╧══════════╧══════════════════════╧════════════╧═══════════════════════╝ +╔══════════╤═══════╤══════════════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼───────┼──────────────────────┼───────────────────╢ +║ t1.micro │ 0.002 │ Windows │ us-east-1a ║ +║ t1.micro │ 0.002 │ Windows (Amazon VPC) │ us-east-1a ║ +║ t1.micro │ 0.002 │ Windows │ us-east-1b ║ +║ t1.micro │ 0.002 │ Windows (Amazon VPC) │ us-east-1b ║ +║ t1.micro │ 0.002 │ Windows │ us-east-1c ║ +║ t1.micro │ 0.002 │ Windows (Amazon VPC) │ us-east-1c ║ +║ t1.micro │ 0.002 │ Windows │ us-east-1d ║ +║ t1.micro │ 0.002 │ Windows (Amazon VPC) │ us-east-1d ║ +║ t1.micro │ 0.002 │ Windows (Amazon VPC) │ us-east-1f ║ +║ t3a.nano │ 0.006 │ Windows (Amazon VPC) │ us-east-1a ║ +╚══════════╧═══════╧══════════════════════╧═══════════════════╝ " `; exports[`cli test by import ui mode should return expected result 1`] = ` -"╔══════════╤══════════╤════════════╤════════════╤═════════════════════════╗ -║ c4.large │ 0.018100 │ Linux/UNIX │ us-east-2a │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.018100 │ Linux/UNIX │ us-east-2c │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.019500 │ Linux/UNIX │ us-east-2b │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ r5.large │ 0.020900 │ Linux/UNIX │ us-east-2a │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ r5.large │ 0.021100 │ Linux/UNIX │ us-east-2c │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ r5.large │ 0.021200 │ Linux/UNIX │ us-east-2b │ US East (Ohio) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.029300 │ Linux/UNIX │ us-west-1b │ US West (N. California) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.029300 │ Linux/UNIX │ us-west-1c │ US West (N. California) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.031300 │ Linux/UNIX │ us-west-2c │ US West (Oregon) ║ -╟──────────┼──────────┼────────────┼────────────┼─────────────────────────╢ -║ c4.large │ 0.031500 │ Linux/UNIX │ us-west-2a │ US West (Oregon) ║ -╚══════════╧══════════╧════════════╧════════════╧═════════════════════════╝ +"╔══════════╤════════╤════════════╤═══════════════════╗ +║ Type │ Price │ Platform │ Availability Zone ║ +╟──────────┼────────┼────────────┼───────────────────╢ +║ c4.large │ 0.0181 │ Linux/UNIX │ us-east-2a ║ +║ c4.large │ 0.0181 │ Linux/UNIX │ us-east-2c ║ +║ c4.large │ 0.0195 │ Linux/UNIX │ us-east-2b ║ +║ r5.large │ 0.0209 │ Linux/UNIX │ us-east-2a ║ +║ r5.large │ 0.0211 │ Linux/UNIX │ us-east-2c ║ +║ r5.large │ 0.0212 │ Linux/UNIX │ us-east-2b ║ +║ c4.large │ 0.0293 │ Linux/UNIX │ us-west-1b ║ +║ c4.large │ 0.0293 │ Linux/UNIX │ us-west-1c ║ +║ c4.large │ 0.0313 │ Linux/UNIX │ us-west-2c ║ +║ c4.large │ 0.0315 │ Linux/UNIX │ us-west-2a ║ +╚══════════╧════════╧════════════╧═══════════════════╝ " `; exports[`cli test by spawnSync should stdout help screen 1`] = ` -"spot-price +"aws-spot-price get current AWS spot instance prices @@ -419,9 +450,9 @@ Options: --ui Start with UI mode [boolean] [default: false] -r, --region AWS regions. [array] [choices: \\"us-east-1\\", \\"us-east-2\\", \\"us-west-1\\", \\"us-west-2\\", - \\"ca-central-1\\", \\"eu-central-1\\", \\"eu-west-1\\", \\"eu-west-2\\", \\"eu-west-3\\", - \\"eu-north-1\\", \\"ap-east-1\\", \\"ap-northeast-1\\", \\"ap-northeast-2\\", - \\"ap-northeast-3\\", \\"ap-southeast-1\\", \\"ap-southeast-2\\", \\"ap-south-1\\", + \\"af-south-1\\", \\"ap-east-1\\", \\"ap-northeast-1\\", \\"ap-northeast-2\\", \\"ap-south-1\\", + \\"ap-southeast-1\\", \\"ap-southeast-2\\", \\"ca-central-1\\", \\"eu-central-1\\", + \\"eu-north-1\\", \\"eu-south-1\\", \\"eu-west-1\\", \\"eu-west-2\\", \\"eu-west-3\\", \\"me-south-1\\", \\"sa-east-1\\"] -i, --instanceType EC2 type [array] [choices: \\"a1.medium\\", \\"a1.large\\", \\"a1.xlarge\\", \\"a1.2xlarge\\", @@ -507,13 +538,20 @@ Options: [array] [choices: \\"nano\\", \\"micro\\", \\"small\\", \\"medium\\", \\"large\\", \\"xlarge\\", \\"2xlarge\\", \\"3xlarge\\", \\"4xlarge\\", \\"6xlarge\\", \\"8xlarge\\", \\"9xlarge\\", \\"10xlarge\\", \\"12xlarge\\", \\"16xlarge\\", \\"18xlarge\\", \\"24xlarge\\", \\"32xlarge\\", \\"metal\\"] - -p, --priceMax Maximum price [number] - -d, --productDescription Product descriptions. Choose \`windows\` or \`linux\` - (all lowercase) as wildcard. + --minVCPU, --mc Minimum VCPU count [number] [default: 1] + --minMemoryGiB, --mm Minimum memory (GiB) [number] [default: 0.5] + --priceLimit, --pl Maximum price limit [number] [default: 100] + -p, --platforms Platforms. Choose \`windows\` or \`linux\` (all + lowercase) as wildcard. [array] [choices: \\"Linux/UNIX\\", \\"Linux/UNIX (Amazon VPC)\\", \\"SUSE Linux\\", \\"SUSE Linux (Amazon VPC)\\", \\"Red Hat Enterprise Linux\\", \\"Red Hat Enterprise Linux (Amazon VPC)\\", \\"Windows\\", \\"Windows (Amazon VPC)\\", \\"linux\\", \\"windows\\"] - -l, --limit Limit results output length [number] [default: 20] + [default: [\\"Linux/UNIX\\",\\"Linux/UNIX (Amazon VPC)\\"]] + -l, --limit Limit results output length [number] [default: 30] + --reduceAZ, --raz Reduce results with cheapest Availability Zone + within Region [boolean] [default: true] + -w, --wide Output results with detail (vCPU, memory, etc) + [boolean] [default: false] -j, --json Outputs in JSON format [boolean] [default: false] --accessKeyId AWS Access Key ID. [string] --secretAccessKey AWS Secret Access Key. [string] diff --git a/test/__snapshots__/lib/core.spec.ts.snap b/test/__snapshots__/lib/core.spec.ts.snap index d50f776b..71151850 100644 --- a/test/__snapshots__/lib/core.spec.ts.snap +++ b/test/__snapshots__/lib/core.spec.ts.snap @@ -1,146 +1,1889 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`lib getEc2Info run with default options should return expected values 1`] = ` +Object { + "a1.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "a1.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "a1.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "a1.medium": Object { + "memoryGiB": 2, + "vCpu": 1, + }, + "a1.metal": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "a1.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c1.medium": Object { + "memoryGiB": 1.7, + "vCpu": 2, + }, + "c1.xlarge": Object { + "memoryGiB": 7, + "vCpu": 8, + }, + "c3.2xlarge": Object { + "memoryGiB": 15, + "vCpu": 8, + }, + "c3.4xlarge": Object { + "memoryGiB": 30, + "vCpu": 16, + }, + "c3.8xlarge": Object { + "memoryGiB": 60, + "vCpu": 32, + }, + "c3.large": Object { + "memoryGiB": 3.75, + "vCpu": 2, + }, + "c3.xlarge": Object { + "memoryGiB": 7.5, + "vCpu": 4, + }, + "c4.2xlarge": Object { + "memoryGiB": 15, + "vCpu": 8, + }, + "c4.4xlarge": Object { + "memoryGiB": 30, + "vCpu": 16, + }, + "c4.8xlarge": Object { + "memoryGiB": 60, + "vCpu": 36, + }, + "c4.large": Object { + "memoryGiB": 3.75, + "vCpu": 2, + }, + "c4.xlarge": Object { + "memoryGiB": 7.5, + "vCpu": 4, + }, + "c5.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c5.18xlarge": Object { + "memoryGiB": 144, + "vCpu": 72, + }, + "c5.24xlarge": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c5.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c5.9xlarge": Object { + "memoryGiB": 72, + "vCpu": 36, + }, + "c5.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c5.metal": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c5a.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c5a.16xlarge": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c5a.24xlarge": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5a.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c5a.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c5a.8xlarge": Object { + "memoryGiB": 64, + "vCpu": 32, + }, + "c5a.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c5a.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c5ad.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c5ad.16xlarge": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c5ad.24xlarge": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5ad.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c5ad.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c5ad.8xlarge": Object { + "memoryGiB": 64, + "vCpu": 32, + }, + "c5ad.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c5ad.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c5d.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c5d.18xlarge": Object { + "memoryGiB": 144, + "vCpu": 72, + }, + "c5d.24xlarge": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5d.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c5d.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c5d.9xlarge": Object { + "memoryGiB": 72, + "vCpu": 36, + }, + "c5d.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c5d.metal": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "c5d.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c5n.18xlarge": Object { + "memoryGiB": 192, + "vCpu": 72, + }, + "c5n.2xlarge": Object { + "memoryGiB": 21, + "vCpu": 8, + }, + "c5n.4xlarge": Object { + "memoryGiB": 42, + "vCpu": 16, + }, + "c5n.9xlarge": Object { + "memoryGiB": 96, + "vCpu": 36, + }, + "c5n.large": Object { + "memoryGiB": 5.25, + "vCpu": 2, + }, + "c5n.metal": Object { + "memoryGiB": 192, + "vCpu": 72, + }, + "c5n.xlarge": Object { + "memoryGiB": 10.5, + "vCpu": 4, + }, + "c6g.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c6g.16xlarge": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c6g.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c6g.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c6g.8xlarge": Object { + "memoryGiB": 64, + "vCpu": 32, + }, + "c6g.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c6g.medium": Object { + "memoryGiB": 2, + "vCpu": 1, + }, + "c6g.metal": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c6g.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "c6gd.12xlarge": Object { + "memoryGiB": 96, + "vCpu": 48, + }, + "c6gd.16xlarge": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c6gd.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "c6gd.4xlarge": Object { + "memoryGiB": 32, + "vCpu": 16, + }, + "c6gd.8xlarge": Object { + "memoryGiB": 64, + "vCpu": 32, + }, + "c6gd.large": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "c6gd.medium": Object { + "memoryGiB": 2, + "vCpu": 1, + }, + "c6gd.metal": Object { + "memoryGiB": 128, + "vCpu": 64, + }, + "c6gd.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "cc2.8xlarge": Object { + "memoryGiB": 60.5, + "vCpu": 32, + }, + "d2.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "d2.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "d2.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 36, + }, + "d2.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "f1.16xlarge": Object { + "memoryGiB": 976, + "vCpu": 64, + }, + "f1.2xlarge": Object { + "memoryGiB": 122, + "vCpu": 8, + }, + "f1.4xlarge": Object { + "memoryGiB": 244, + "vCpu": 16, + }, + "g2.2xlarge": Object { + "memoryGiB": 15, + "vCpu": 8, + }, + "g2.8xlarge": Object { + "memoryGiB": 60, + "vCpu": 32, + }, + "g3.16xlarge": Object { + "memoryGiB": 488, + "vCpu": 64, + }, + "g3.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "g3.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "g3s.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "g4dn.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "g4dn.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "g4dn.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "g4dn.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "g4dn.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "g4dn.metal": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "g4dn.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "h1.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "h1.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "h1.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "h1.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "i2.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "i2.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "i2.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "i2.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "i3.16xlarge": Object { + "memoryGiB": 488, + "vCpu": 64, + }, + "i3.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "i3.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "i3.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "i3.large": Object { + "memoryGiB": 15.25, + "vCpu": 2, + }, + "i3.metal": Object { + "memoryGiB": 512, + "vCpu": 72, + }, + "i3.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "i3en.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "i3en.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "i3en.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "i3en.3xlarge": Object { + "memoryGiB": 96, + "vCpu": 12, + }, + "i3en.6xlarge": Object { + "memoryGiB": 192, + "vCpu": 24, + }, + "i3en.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "i3en.metal": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "i3en.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "inf1.24xlarge": Object { + "memoryGiB": 192, + "vCpu": 96, + }, + "inf1.2xlarge": Object { + "memoryGiB": 16, + "vCpu": 8, + }, + "inf1.6xlarge": Object { + "memoryGiB": 48, + "vCpu": 24, + }, + "inf1.xlarge": Object { + "memoryGiB": 8, + "vCpu": 4, + }, + "m1.large": Object { + "memoryGiB": 7.5, + "vCpu": 2, + }, + "m1.medium": Object { + "memoryGiB": 3.7, + "vCpu": 1, + }, + "m1.small": Object { + "memoryGiB": 1.7, + "vCpu": 1, + }, + "m1.xlarge": Object { + "memoryGiB": 15, + "vCpu": 4, + }, + "m2.2xlarge": Object { + "memoryGiB": 34.2, + "vCpu": 4, + }, + "m2.4xlarge": Object { + "memoryGiB": 68.4, + "vCpu": 8, + }, + "m2.xlarge": Object { + "memoryGiB": 17.1, + "vCpu": 2, + }, + "m3.2xlarge": Object { + "memoryGiB": 30, + "vCpu": 8, + }, + "m3.large": Object { + "memoryGiB": 7.5, + "vCpu": 2, + }, + "m3.medium": Object { + "memoryGiB": 3.75, + "vCpu": 1, + }, + "m3.xlarge": Object { + "memoryGiB": 15, + "vCpu": 4, + }, + "m4.10xlarge": Object { + "memoryGiB": 160, + "vCpu": 40, + }, + "m4.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m4.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m4.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m4.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m4.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5.metal": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5a.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5a.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5a.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5a.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5a.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5a.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5a.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5a.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5ad.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5ad.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5ad.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5ad.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5ad.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5ad.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5ad.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5ad.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5d.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5d.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5d.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5d.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5d.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5d.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5d.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5d.metal": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5d.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5dn.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5dn.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5dn.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5dn.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5dn.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5dn.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5dn.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5dn.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m5n.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m5n.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m5n.24xlarge": Object { + "memoryGiB": 384, + "vCpu": 96, + }, + "m5n.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m5n.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m5n.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m5n.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m5n.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m6g.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m6g.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m6g.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m6g.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m6g.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m6g.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m6g.medium": Object { + "memoryGiB": 4, + "vCpu": 1, + }, + "m6g.metal": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m6g.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "m6gd.12xlarge": Object { + "memoryGiB": 192, + "vCpu": 48, + }, + "m6gd.16xlarge": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m6gd.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "m6gd.4xlarge": Object { + "memoryGiB": 64, + "vCpu": 16, + }, + "m6gd.8xlarge": Object { + "memoryGiB": 128, + "vCpu": 32, + }, + "m6gd.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "m6gd.medium": Object { + "memoryGiB": 4, + "vCpu": 1, + }, + "m6gd.metal": Object { + "memoryGiB": 256, + "vCpu": 64, + }, + "m6gd.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "p2.16xlarge": Object { + "memoryGiB": 732, + "vCpu": 64, + }, + "p2.8xlarge": Object { + "memoryGiB": 488, + "vCpu": 32, + }, + "p2.xlarge": Object { + "memoryGiB": 61, + "vCpu": 4, + }, + "p3.16xlarge": Object { + "memoryGiB": 488, + "vCpu": 64, + }, + "p3.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "p3.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "p3dn.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "p4d.24xlarge": Object { + "memoryGiB": 1152, + "vCpu": 96, + }, + "r3.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "r3.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "r3.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "r3.large": Object { + "memoryGiB": 15, + "vCpu": 2, + }, + "r3.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "r4.16xlarge": Object { + "memoryGiB": 488, + "vCpu": 64, + }, + "r4.2xlarge": Object { + "memoryGiB": 61, + "vCpu": 8, + }, + "r4.4xlarge": Object { + "memoryGiB": 122, + "vCpu": 16, + }, + "r4.8xlarge": Object { + "memoryGiB": 244, + "vCpu": 32, + }, + "r4.large": Object { + "memoryGiB": 15.25, + "vCpu": 2, + }, + "r4.xlarge": Object { + "memoryGiB": 30.5, + "vCpu": 4, + }, + "r5.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5.metal": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r5a.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5a.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5a.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5a.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5a.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5a.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5a.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5a.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r5ad.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5ad.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5ad.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5ad.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5ad.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5ad.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5ad.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5ad.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r5d.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5d.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5d.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5d.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5d.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5d.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5d.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5d.metal": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5d.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r5dn.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5dn.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5dn.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5dn.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5dn.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5dn.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5dn.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5dn.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r5n.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r5n.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r5n.24xlarge": Object { + "memoryGiB": 768, + "vCpu": 96, + }, + "r5n.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r5n.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r5n.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r5n.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r5n.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r6g.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r6g.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r6g.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r6g.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r6g.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r6g.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r6g.medium": Object { + "memoryGiB": 8, + "vCpu": 1, + }, + "r6g.metal": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r6g.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "r6gd.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "r6gd.16xlarge": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r6gd.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "r6gd.4xlarge": Object { + "memoryGiB": 128, + "vCpu": 16, + }, + "r6gd.8xlarge": Object { + "memoryGiB": 256, + "vCpu": 32, + }, + "r6gd.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "r6gd.medium": Object { + "memoryGiB": 8, + "vCpu": 1, + }, + "r6gd.metal": Object { + "memoryGiB": 512, + "vCpu": 64, + }, + "r6gd.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, + "t1.micro": Object { + "memoryGiB": 0.613, + "vCpu": 1, + }, + "t2.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "t2.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "t2.medium": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "t2.micro": Object { + "memoryGiB": 1, + "vCpu": 1, + }, + "t2.nano": Object { + "memoryGiB": 0.5, + "vCpu": 1, + }, + "t2.small": Object { + "memoryGiB": 2, + "vCpu": 1, + }, + "t2.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "t3.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "t3.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "t3.medium": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "t3.micro": Object { + "memoryGiB": 1, + "vCpu": 2, + }, + "t3.nano": Object { + "memoryGiB": 0.5, + "vCpu": 2, + }, + "t3.small": Object { + "memoryGiB": 2, + "vCpu": 2, + }, + "t3.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "t3a.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "t3a.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "t3a.medium": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "t3a.micro": Object { + "memoryGiB": 1, + "vCpu": 2, + }, + "t3a.nano": Object { + "memoryGiB": 0.5, + "vCpu": 2, + }, + "t3a.small": Object { + "memoryGiB": 2, + "vCpu": 2, + }, + "t3a.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "t4g.2xlarge": Object { + "memoryGiB": 32, + "vCpu": 8, + }, + "t4g.large": Object { + "memoryGiB": 8, + "vCpu": 2, + }, + "t4g.medium": Object { + "memoryGiB": 4, + "vCpu": 2, + }, + "t4g.micro": Object { + "memoryGiB": 1, + "vCpu": 2, + }, + "t4g.nano": Object { + "memoryGiB": 0.5, + "vCpu": 2, + }, + "t4g.small": Object { + "memoryGiB": 2, + "vCpu": 2, + }, + "t4g.xlarge": Object { + "memoryGiB": 16, + "vCpu": 4, + }, + "x1.16xlarge": Object { + "memoryGiB": 976, + "vCpu": 64, + }, + "x1.32xlarge": Object { + "memoryGiB": 1952, + "vCpu": 128, + }, + "x1e.16xlarge": Object { + "memoryGiB": 1952, + "vCpu": 64, + }, + "x1e.2xlarge": Object { + "memoryGiB": 244, + "vCpu": 8, + }, + "x1e.32xlarge": Object { + "memoryGiB": 3904, + "vCpu": 128, + }, + "x1e.4xlarge": Object { + "memoryGiB": 488, + "vCpu": 16, + }, + "x1e.8xlarge": Object { + "memoryGiB": 976, + "vCpu": 32, + }, + "x1e.xlarge": Object { + "memoryGiB": 122, + "vCpu": 4, + }, + "z1d.12xlarge": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "z1d.2xlarge": Object { + "memoryGiB": 64, + "vCpu": 8, + }, + "z1d.3xlarge": Object { + "memoryGiB": 96, + "vCpu": 12, + }, + "z1d.6xlarge": Object { + "memoryGiB": 192, + "vCpu": 24, + }, + "z1d.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, + "z1d.metal": Object { + "memoryGiB": 384, + "vCpu": 48, + }, + "z1d.xlarge": Object { + "memoryGiB": 32, + "vCpu": 4, + }, +} +`; + +exports[`lib getEc2Info run with targeted instance type should return expected values 1`] = ` +Object { + "dummy.large": Object { + "memoryGiB": 16, + "vCpu": 2, + }, +} +`; + exports[`lib getGlobalSpotPrices run with default options should return expected values 1`] = ` Array [ Object { - "AvailabilityZone": "us-west-2a", - "InstanceType": "t3a.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001500", - "Timestamp": 2019-10-15T22:41:58.000Z, + "availabilityZone": "us-west-2a", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T22:41:58.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2c", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T07:13:00.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2d", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T23:09:28.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-north-1a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-north-1b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-north-1c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-1a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-1b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-1c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-1d", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-1f", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-2a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-2b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-east-2c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "us-west-2d", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "ca-central-1a", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T15:04:27.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "ca-central-1b", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T15:04:27.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-central-1a", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-16T02:51:49.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-central-1b", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-16T02:51:49.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-1b", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T18:39:03.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-1c", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T08:01:03.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-2a", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:05:27.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-2b", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:05:27.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-2c", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:05:27.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-3a", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T04:02:17.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-3b", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T04:02:17.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-west-3c", + "instanceType": "t3a.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T04:02:17.000Z, + "vCpu": 2, + }, +] +`; + +exports[`lib getGlobalSpotPrices should fetch ec2 instance type info dynamically if not found from constants should return expected values 1`] = ` +Array [ + Object { + "availabilityZone": "us-west-2a", + "instanceType": "t3a.nano", + "memoryGiB": 1, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T22:41:58.000Z, + "vCpu": 4, + }, + Object { + "availabilityZone": "us-west-2c", + "instanceType": "t3a.nano", + "memoryGiB": 1, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T07:13:00.000Z, + "vCpu": 4, + }, + Object { + "availabilityZone": "us-west-2d", + "instanceType": "t3a.nano", + "memoryGiB": 1, + "platform": "Linux/UNIX", + "spotPrice": 0.0015, + "timestamp": 2019-10-15T23:09:28.000Z, + "vCpu": 4, + }, + Object { + "availabilityZone": "eu-north-1a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, + }, + Object { + "availabilityZone": "eu-north-1b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-west-2c", - "InstanceType": "t3a.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001500", - "Timestamp": 2019-10-15T07:13:00.000Z, + "availabilityZone": "eu-north-1c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:45:20.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-west-2d", - "InstanceType": "t3a.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001500", - "Timestamp": 2019-10-15T23:09:28.000Z, + "availabilityZone": "us-east-1a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "eu-north-1a", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:45:20.000Z, + "availabilityZone": "us-east-1b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "eu-north-1b", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:45:20.000Z, + "availabilityZone": "us-east-1c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "eu-north-1c", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:45:20.000Z, + "availabilityZone": "us-east-1d", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-1a", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:09:43.000Z, + "availabilityZone": "us-east-1f", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX (Amazon VPC)", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:09:43.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-1b", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:09:43.000Z, + "availabilityZone": "us-east-2a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-1c", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:09:43.000Z, + "availabilityZone": "us-east-2b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-1d", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:09:43.000Z, + "availabilityZone": "us-east-2c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T12:01:55.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-1f", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:09:43.000Z, + "availabilityZone": "us-west-2a", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-2a", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:01:55.000Z, + "availabilityZone": "us-west-2b", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-2b", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:01:55.000Z, + "availabilityZone": "us-west-2c", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-east-2c", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T12:01:55.000Z, + "availabilityZone": "us-west-2d", + "instanceType": "t3.nano", + "memoryGiB": 0.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T17:08:19.000Z, + "vCpu": 2, }, Object { - "AvailabilityZone": "us-west-2a", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:08:19.000Z, + "availabilityZone": "ca-central-1a", + "instanceType": "t3a.nano", + "memoryGiB": 1, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T15:04:27.000Z, + "vCpu": 4, }, Object { - "AvailabilityZone": "us-west-2b", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:08:19.000Z, + "availabilityZone": "ca-central-1b", + "instanceType": "t3a.nano", + "memoryGiB": 1, + "platform": "Linux/UNIX", + "spotPrice": 0.0016, + "timestamp": 2019-10-15T15:04:27.000Z, + "vCpu": 4, + }, +] +`; + +exports[`lib getGlobalSpotPrices should filter by minVCPU & minMemoryGiB should return expected values 1`] = ` +Array [ + Object { + "availabilityZone": "us-east-2a", + "instanceType": "r3.xlarge", + "memoryGiB": 30.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0379, + "timestamp": 2019-10-15T21:09:49.000Z, + "vCpu": 4, }, Object { - "AvailabilityZone": "us-west-2c", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:08:19.000Z, + "availabilityZone": "us-east-2b", + "instanceType": "r3.xlarge", + "memoryGiB": 30.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0379, + "timestamp": 2019-10-15T21:09:49.000Z, + "vCpu": 4, }, Object { - "AvailabilityZone": "us-west-2d", - "InstanceType": "t3.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T17:08:19.000Z, + "availabilityZone": "us-east-2c", + "instanceType": "r3.xlarge", + "memoryGiB": 30.5, + "platform": "Linux/UNIX", + "spotPrice": 0.0379, + "timestamp": 2019-10-15T21:09:49.000Z, + "vCpu": 4, }, Object { - "AvailabilityZone": "ca-central-1a", - "InstanceType": "t3a.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T15:04:27.000Z, + "availabilityZone": "us-east-2b", + "instanceType": "m4.xlarge", + "memoryGiB": 16, + "platform": "Linux/UNIX", + "spotPrice": 0.038, + "timestamp": 2019-10-15T19:11:29.000Z, + "vCpu": 4, }, Object { - "AvailabilityZone": "ca-central-1b", - "InstanceType": "t3a.nano", - "ProductDescription": "Linux/UNIX", - "SpotPrice": "0.001600", - "Timestamp": 2019-10-15T15:04:27.000Z, + "availabilityZone": "us-east-2c", + "instanceType": "m4.xlarge", + "memoryGiB": 16, + "platform": "Linux/UNIX", + "spotPrice": 0.038, + "timestamp": 2019-10-15T19:11:29.000Z, + "vCpu": 4, }, ] `; diff --git a/test/data/describe-instance-types-mocks/c1-medium.xml b/test/data/describe-instance-types-mocks/c1-medium.xml new file mode 100644 index 00000000..e66817ec --- /dev/null +++ b/test/data/describe-instance-types-mocks/c1-medium.xml @@ -0,0 +1,10 @@ + + + + + InvalidInstanceType + The following supplied instance types do not exist: [c1.medium] + + + 2776d8dd-afa3-48d3-9025-7cfc34cf1faf + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/dummy-large.xml b/test/data/describe-instance-types-mocks/dummy-large.xml new file mode 100644 index 00000000..4ca23c8b --- /dev/null +++ b/test/data/describe-instance-types-mocks/dummy-large.xml @@ -0,0 +1,92 @@ + + + dc300e7c-1cd0-4ff3-b0aa-99bc8fa3f522 + + + true + false + false + true + true + + + 650 + 3000 + 81.25 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + dummy.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/page1.xml b/test/data/describe-instance-types-mocks/page1.xml new file mode 100644 index 00000000..04362696 --- /dev/null +++ b/test/data/describe-instance-types-mocks/page1.xml @@ -0,0 +1,9697 @@ + + + cfe362d0-c830-4cb3-bb1a-a99946863c6f + + + false + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + m5dn.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1085 + 6000 + 135.625 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + r5a.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + r6g.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + true + false + false + true + true + + + 3500 + 20000 + 437.5 + 3500 + 20000 + 437.5 + + default + supported + unsupported + + false + false + xen + + + + 1 + 960 + ssd + + + unsupported + 960 + + true + x1e.8xlarge + + 999424 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 237 + ssd + + + required + 237 + + true + m6gd.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + true + false + false + true + true + + + 300 + 2500 + 37.5 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + nitro + false + a1.medium + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + false + m5n.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 75 Gigabit + + + 75 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + true + xen + + + + 2 + 320 + ssd + + + unsupported + 640 + + true + c3.8xlarge + + 61440 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.8 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1700 + 12000 + 212.5 + 1700 + 12000 + 212.5 + + default + supported + supported + + + + + 1 + Xilinx + + 65536 + + Virtex UltraScale (VU9P) + + + 65536 + + false + false + xen + + + + 1 + 470 + ssd + + + required + 470 + + true + f1.2xlarge + + 124928 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + false + + + 6780 + 30000 + 847.5 + 6780 + 30000 + 847.5 + + default + supported + unsupported + + false + false + nitro + false + r5a.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 6 + 12 + 18 + 24 + + + 1 + 2 + + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + false + xen + + + + 2 + 320 + ssd + + + unsupported + 640 + + true + r3.8xlarge + + 249856 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1580 + 8333 + 197.5 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + m5a.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + true + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + m5ad.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4000 + 32000 + 500.0 + 4000 + 32000 + 500.0 + + default + supported + unsupported + + false + true + xen + false + c4.8xlarge + + 61440 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.9 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 18 + 2 + 36 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + + + 1 + 2 + + + + + false + false + false + true + false + + + 6780 + 30000 + 847.5 + 6780 + 30000 + 847.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + r5ad.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 6 + 12 + 18 + 24 + + + 1 + 2 + + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + true + xen + + + + 2 + 16 + ssd + + + unsupported + 32 + + true + c3.large + + 3840 + + + 0 + false + unsupported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + i386 + x86_64 + + 2.8 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + default + supported + unsupported + + false + false + xen + + + + 6 + 2048 + hdd + + + unsupported + 12288 + + true + d2.2xlarge + + 62464 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 4 + 7500 + ssd + + + required + 30000 + + true + i3en.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + r5.24xlarge + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3a.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + m5.metal + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + true + false + xen + false + t1.micro + + 627 + + + 0 + false + unsupported + 2 + 0 + false + 1 + 2 + + + 2 + 0 + Very Low + + + Very Low + + + + partition + spread + + + + + i386 + x86_64 + + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + paravirtual + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + true + true + false + + + 256 + 2000 + 32.0 + 1536 + 11800 + 192.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.medium + + 4096 + + + 0 + false + required + 6 + 6 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + false + true + true + + + 1000 + 7400 + 125.0 + 1000 + 7400 + 125.0 + + default + supported + unsupported + + false + false + xen + + + + 1 + 240 + ssd + + + unsupported + 240 + + true + x1e.2xlarge + + 249856 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + m5.24xlarge + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1580 + 8333 + 197.5 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + r5a.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 59 + ssd + + + required + 59 + + true + m6gd.medium + + 4096 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + r5dn.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + false + false + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + unsupported + unsupported + + false + false + xen + + + + 2 + 840 + hdd + + + unsupported + 1680 + + true + m2.4xlarge + + 70041 + + + 0 + false + unsupported + 30 + 0 + false + 1 + 8 + + + 8 + 0 + High + + + High + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + false + true + false + + + 650 + 3600 + 81.25 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + r5a.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + c5.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + m5.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 950 + ssd + + + required + 950 + + true + m6gd.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + true + false + false + true + true + + + 650 + 4000 + 81.25 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c5n.large + + 5376 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + c6g.16xlarge + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + false + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + m5d.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + r5ad.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + true + + + 14000 + 75000 + 1750.0 + 14000 + 75000 + 1750.0 + + default + supported + unsupported + + false + false + xen + false + r4.16xlarge + + 499712 + + + 0 + false + supported + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 13570 + 60000 + 1696.25 + 13570 + 60000 + 1696.25 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + r5ad.24xlarge + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 12 + 18 + 24 + 36 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 15000 + 593.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + r5n.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + true + false + + + 2880 + 16000 + 360.0 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + m5ad.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1580 + 8333 + 197.5 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + m5ad.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 2 + 1900 + ssd + + + required + 3800 + + true + c6gd.metal + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + true + false + false + true + false + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r6g.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + false + true + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + default + supported + unsupported + + false + true + xen + false + m4.4xlarge + + 65536 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + m6g.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + true + true + + + 650 + 3600 + 81.25 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + m5d.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + false + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 59 + ssd + + + required + 59 + + true + r6gd.medium + + 8192 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + m5d.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1580 + 6600 + 197.5 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + false + c5a.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 8 + + + 1 + 2 + + + + + true + false + false + true + false + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r6g.medium + + 8192 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 2 + 1900 + ssd + + + required + 3800 + + true + m6gd.metal + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + true + xen + + + + 1 + 32 + ssd + + + unsupported + 32 + + true + r3.large + + 15360 + + + 0 + false + unsupported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 1900 + ssd + + + unsupported + 3800 + + true + c5ad.24xlarge + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 40 + 44 + 48 + + + 1 + 2 + + + + + false + false + false + true + false + + + 6780 + 30000 + 847.5 + 6780 + 30000 + 847.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + m5ad.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 6 + 12 + 18 + 24 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + m5.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 650 + 4000 + 81.25 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 50 + ssd + + + required + 50 + + true + c5d.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.2xlarge + + 32768 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + true + true + false + + + 175 + 1000 + 21.875 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3a.small + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + unsupported + + false + true + nitro + false + m5.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + false + false + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + unsupported + unsupported + + false + false + xen + + + + 1 + 850 + hdd + + + unsupported + 850 + + true + m2.2xlarge + + 35020 + + + 0 + false + unsupported + 30 + 0 + false + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + true + false + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 237 + ssd + + + required + 237 + + true + r6gd.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + false + r5n.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1580 + 6600 + 197.5 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + + + + 2 + 300 + ssd + + + unsupported + 600 + + true + c5ad.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 7000 + 40000 + 875.0 + 7000 + 40000 + 875.0 + + default + supported + unsupported + + false + false + xen + + + + 1 + 1920 + ssd + + + unsupported + 1920 + + true + x1.16xlarge + + 999424 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + c5d.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + m5dn.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + false + + + 2880 + 16000 + 360.0 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + m5a.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + r6g.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + true + false + false + true + true + + + 14000 + 80000 + 1750.0 + 14000 + 80000 + 1750.0 + + default + supported + unsupported + + false + false + xen + + + + 2 + 1920 + ssd + + + unsupported + 3840 + + true + x1e.32xlarge + + 3997696 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 2 + 128 + + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 40 + 44 + 48 + 52 + 56 + 60 + 64 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 8 + 7500 + ssd + + + required + 60000 + + true + i3en.24xlarge + + 786432 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + m5dn.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + c5.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 3800 + 15000 + 475.0 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 7500 + ssd + + + required + 7500 + + true + i3en.3xlarge + + 98304 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 6 + 2 + 12 + + 2 + 4 + 6 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1190 + 4000 + 148.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + + + + 1 + AWS + Inferentia + + + + false + inf1.xlarge + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + unsupported + + false + false + nitro + false + c6g.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + false + false + false + true + true + + + 650 + 3000 + 81.25 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + m5dn.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + m6g.metal + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + false + false + false + true + false + + + 6300 + 26700 + 787.5 + 6300 + 26700 + 787.5 + + default + supported + required + + false + false + nitro + + + + 2 + 1200 + ssd + + + unsupported + 2400 + + true + c5ad.16xlarge + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + + + 1 + 2 + + + + + true + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + m5a.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + m5d.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c5n.4xlarge + + 43008 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + required + + false + false + nitro + + + + 2 + 1425 + ssd + + + required + 2850 + + true + m6gd.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + + + + 8 + NVIDIA + + 16384 + + T4 + + + 131072 + + false + + + + 2 + 900 + ssd + + + required + 1800 + + true + g4dn.metal + + 393216 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + false + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + m5dn.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2300 + 10000 + 287.5 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c5n.2xlarge + + 21504 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + true + true + false + + + 32 + 250 + 4.0 + 1536 + 11800 + 192.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.nano + + 512 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + unsupported + 1800 + + true + c5ad.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + + + 1 + 2 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + false + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 474 + ssd + + + required + 474 + + true + r6gd.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + false + false + false + true + true + + + 4000 + 32000 + 500.0 + 4000 + 32000 + 500.0 + + default + supported + unsupported + + false + false + xen + + + + 24 + 2048 + hdd + + + unsupported + 49152 + + true + d2.8xlarge + + 249856 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 18 + 2 + 36 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + + + 1 + 2 + + + + + false + false + false + false + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + supported + unsupported + + false + false + xen + + + + 2 + 800 + ssd + + + unsupported + 1600 + + true + i2.2xlarge + + 62464 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + default + supported + unsupported + + false + true + xen + false + c4.4xlarge + + 30720 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.9 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14000 + 80000 + 1750.0 + 14000 + 80000 + 1750.0 + + default + supported + unsupported + + false + + + + 4 + NVIDIA + + 8192 + + M60 + + + 32768 + + false + xen + false + g3.16xlarge + + 499712 + + + 0 + false + supported + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 118 + ssd + + + required + 118 + + true + r6gd.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + false + + + 650 + 3600 + 81.25 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + m5ad.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c6g.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + true + true + + + 3170 + 13333 + 396.25 + 3170 + 13333 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + z1d.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 4 + 900 + ssd + + + required + 3600 + + true + m5d.metal + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + page2 + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/page2.xml b/test/data/describe-instance-types-mocks/page2.xml new file mode 100644 index 00000000..525fe72e --- /dev/null +++ b/test/data/describe-instance-types-mocks/page2.xml @@ -0,0 +1,9697 @@ + + + eea5a2a5-58a8-45ad-8500-d445744fd60e + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + + + + 4 + NVIDIA + + 16384 + + T4 + + + 65536 + + false + nitro + + + + 1 + 900 + ssd + + + required + 900 + + true + g4dn.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + false + + + 800 + 3200 + 100.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + false + c5a.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + r5n.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + true + true + false + + + 512 + 4000 + 64.0 + 2048 + 15700 + 256.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.large + + 8192 + + + 0 + false + required + 12 + 12 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + true + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 237 + ssd + + + required + 237 + + true + c6gd.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + false + false + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + unsupported + unsupported + + false + false + xen + + + + 4 + 420 + hdd + + + unsupported + 1680 + + true + c1.xlarge + + 7168 + + + 0 + false + unsupported + 15 + 0 + false + 1 + 4 + + + 4 + 0 + High + + + High + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + m6g.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + true + false + false + true + true + + + 750 + 6000 + 93.75 + 750 + 6000 + 93.75 + + default + supported + unsupported + + false + true + xen + false + c4.xlarge + + 7680 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.9 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + true + true + xen + false + t2.micro + + 1024 + + + 0 + false + unsupported + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Low to Moderate + + + Low to Moderate + + + + partition + spread + + + + + i386 + x86_64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + false + + + 2880 + 16000 + 360.0 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + r5a.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + true + false + + + 13750 + 60000 + 1718.75 + 13750 + 60000 + 1718.75 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + m5ad.24xlarge + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 12 + 18 + 24 + 36 + 48 + + + 1 + 2 + + + + + true + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + true + nitro + false + c5.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + false + false + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + unsupported + unsupported + + false + false + xen + + + + 4 + 420 + hdd + + + unsupported + 1680 + + true + m1.xlarge + + 15360 + + + 0 + false + unsupported + 15 + 0 + false + 1 + 4 + + + 4 + 0 + High + + + High + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + true + true + + + 650 + 3600 + 81.25 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + r5d.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 650 + 3600 + 81.25 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + r5.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + r5a.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 450 + 3600 + 56.25 + 450 + 3600 + 56.25 + + default + supported + unsupported + + false + true + xen + false + m4.large + + 8192 + + + 0 + false + unsupported + 10 + 10 + true + 1 + 2 + + + 2 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + true + true + false + + + 43 + 250 + 5.375 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3.nano + + 512 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 850 + 6000 + 106.25 + 850 + 6000 + 106.25 + + default + supported + unsupported + + false + true + xen + false + r4.xlarge + + 31232 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1580 + 8333 + 197.5 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + r5ad.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + false + m5n.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 18750 + 593.75 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + r5.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + c5n.9xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 18 + 2 + 36 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + + + 1 + 2 + + + + + false + false + true + true + false + + + 64 + 500 + 8.0 + 1536 + 11800 + 192.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.micro + + 1024 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3.large + + 8192 + + + 0 + false + required + 12 + 12 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + m5a.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 15000 + 593.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + m5n.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + true + true + false + + + 347 + 2000 + 43.375 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3.medium + + 4096 + + + 0 + false + required + 6 + 6 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + r5d.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + m5d.24xlarge + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + true + nitro + false + c5.9xlarge + + 73728 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 18 + 2 + 36 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + c5d.18xlarge + + 147456 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 36 + 2 + 72 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + + + 1 + 2 + + + + + true + false + false + true + true + + + 750 + 6000 + 93.75 + 750 + 6000 + 93.75 + + default + supported + unsupported + + false + true + xen + false + m4.xlarge + + 16384 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + c5n.18xlarge + + 196608 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 36 + 2 + 72 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + + + 1 + 2 + + + + + false + false + false + true + true + + + 3500 + 20000 + 437.5 + 3500 + 20000 + 437.5 + + default + supported + unsupported + + false + + + + 1 + NVIDIA + + 8192 + + M60 + + + 8192 + + false + xen + false + g3.4xlarge + + 124928 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + true + false + true + true + + + 3500 + 20000 + 437.5 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + false + a1.metal + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + + + + false + false + false + true + true + + + 1580 + 6667 + 197.5 + 3170 + 13333 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + z1d.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 800 + 6000 + 100.0 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + nitro + false + a1.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 4 + + + 1 + + + + + false + false + true + true + false + + + 512 + 4000 + 64.0 + 2048 + 15700 + 256.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + false + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 400 + ssd + + + required + 400 + + true + c5d.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + default + supported + unsupported + + false + true + xen + false + c4.large + + 3840 + + + 0 + false + unsupported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.9 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + false + true + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + supported + unsupported + + false + true + xen + + + + 2 + 40 + ssd + + + unsupported + 80 + + true + m3.xlarge + + 15360 + + + 0 + false + unsupported + 15 + 0 + false + 1 + 4 + + + 4 + 0 + High + + + High + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + true + false + false + true + true + + + 1750 + 10000 + 218.75 + 1750 + 10000 + 218.75 + + default + supported + unsupported + + false + + + + 1 + NVIDIA + + 16384 + + V100 + + + 16384 + + false + xen + false + p3.2xlarge + + 62464 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + false + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + supported + unsupported + + false + + + + 1 + NVIDIA + + 4096 + + K520 + + + 4096 + + false + xen + + + + 1 + 60 + ssd + + + unsupported + 60 + + true + g2.2xlarge + + 15360 + + + 0 + false + unsupported + 15 + 0 + false + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.6 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + r5d.24xlarge + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + true + true + false + + + 128 + 1000 + 16.0 + 1536 + 11800 + 192.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.small + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 2 + 1900 + ssd + + + required + 3800 + + true + c6gd.16xlarge + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + true + false + false + true + true + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c6g.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + c5d.24xlarge + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + false + true + false + + + 400 + 1600 + 50.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + unsupported + 150 + + true + c5ad.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + false + c5a.24xlarge + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 40 + 44 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 650 + 3000 + 81.25 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + m5n.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + + + + 8 + NVIDIA + + 40960 + + A100 + + + 327680 + + false + nitro + + + + 8 + 1000 + ssd + + + required + 8000 + + true + p4d.24xlarge + + 1179648 + + + 0 + true + required + 50 + 50 + true + 4 + 60 + + + 15 + 0 + 100 Gigabit + + + 15 + 1 + 100 Gigabit + + + 15 + 2 + 100 Gigabit + + + 15 + 3 + 100 Gigabit + + + 4x 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 950 + ssd + + + required + 950 + + true + r6gd.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + false + false + false + true + true + + + 850 + 6000 + 106.25 + 850 + 6000 + 106.25 + + default + supported + supported + + false + true + xen + + + + 1 + 950 + ssd + + + required + 950 + + true + i3.xlarge + + 31232 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + false + false + xen + + + + 1 + 350 + hdd + + + unsupported + 350 + + true + c1.medium + + 1740 + + + 0 + false + unsupported + 6 + 0 + false + 1 + 2 + + + 2 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + i386 + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.large + + 8192 + + + 0 + false + unsupported + 12 + 12 + true + 1 + 3 + + + 3 + 0 + Low to Moderate + + + Low to Moderate + + + + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + true + + + 1750 + 12000 + 218.75 + 1750 + 12000 + 218.75 + + default + supported + unsupported + + false + false + xen + + + + 1 + 2000 + hdd + + + unsupported + 2000 + + true + h1.2xlarge + + 32768 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + default + supported + unsupported + + false + true + xen + false + c4.2xlarge + + 15360 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.9 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 7000 + 40000 + 875.0 + 7000 + 40000 + 875.0 + + default + supported + unsupported + + false + + + + 2 + NVIDIA + + 8192 + + M60 + + + 16384 + + false + xen + false + g3.8xlarge + + 249856 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + false + true + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 2 + 1900 + ssd + + + required + 3800 + + true + r6gd.metal + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + + + + 4 + AWS + Inferentia + + + + false + inf1.6xlarge + + 49152 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 12 + 2 + 24 + + 2 + 4 + 6 + 8 + 10 + 12 + + + 1 + 2 + + + + + false + false + false + true + true + + + 7000 + 40000 + 875.0 + 7000 + 40000 + 875.0 + + default + supported + unsupported + + false + false + xen + + + + 4 + 2000 + hdd + + + unsupported + 8000 + + true + h1.8xlarge + + 131072 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14000 + 80000 + 1750.0 + 14000 + 80000 + 1750.0 + + default + supported + unsupported + + false + false + xen + + + + 8 + 2000 + hdd + + + unsupported + 16000 + + true + h1.16xlarge + + 262144 + + + 0 + false + supported + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1700 + 12000 + 212.5 + 1700 + 12000 + 212.5 + + default + supported + unsupported + + false + true + xen + false + r4.2xlarge + + 62464 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1190 + 6000 + 148.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + + + + 1 + AWS + Inferentia + + + + false + inf1.2xlarge + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + c5.24xlarge + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + m6g.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + false + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + r5d.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + false + false + true + false + + + 800 + 3200 + 100.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + unsupported + 300 + + true + c5ad.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + r5.metal + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + true + false + false + false + true + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + supported + unsupported + + false + true + xen + + + + 2 + 40 + ssd + + + unsupported + 80 + + true + c3.xlarge + + 7680 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.8 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + paravirtual + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 650 + 3000 + 81.25 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + r5dn.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + false + m5n.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + true + true + false + + + 87 + 500 + 10.875 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3.micro + + 1024 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 5000 + 32500 + 625.0 + 5000 + 32500 + 625.0 + + default + supported + unsupported + + false + + + + 8 + NVIDIA + + 12288 + + K80 + + + 98304 + + false + xen + false + p2.8xlarge + + 499712 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + unsupported + + false + false + nitro + false + r6g.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + true + true + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + c5.metal + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + true + false + false + false + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + supported + supported + unsupported + + false + true + xen + + + + 1 + 320 + ssd + + + unsupported + 320 + + true + r3.4xlarge + + 124928 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + false + + + 400 + 1600 + 50.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + false + c5a.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + false + c5a.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + + + 1 + 2 + + + + + false + false + false + false + true + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + supported + unsupported + + false + false + xen + + + + 1 + 800 + ssd + + + unsupported + 800 + + true + i2.xlarge + + 31232 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + false + true + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + supported + unsupported + + false + true + xen + + + + 1 + 80 + ssd + + + unsupported + 80 + + true + r3.xlarge + + 31232 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + true + true + false + + + 350 + 2000 + 43.75 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3a.medium + + 4096 + + + 0 + false + required + 6 + 6 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r6g.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + false + false + false + true + true + + + 4750 + 18750 + 593.75 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + r5d.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 18750 + 593.75 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + m5.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 525 + 4000 + 65.625 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + nitro + false + a1.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 2 + + + 1 + + + + + false + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + r5d.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 650 + 3600 + 81.25 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + r5ad.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + r5dn.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 2 + 1900 + ssd + + + required + 3800 + + true + m6gd.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + false + false + false + true + true + + + 3500 + 20000 + 437.5 + 3500 + 20000 + 437.5 + + default + supported + unsupported + + false + false + xen + + + + 2 + 2000 + hdd + + + unsupported + 4000 + + true + h1.4xlarge + + 65536 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + false + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + supported + unsupported + + false + true + xen + + + + 1 + 160 + ssd + + + unsupported + 160 + + true + r3.2xlarge + + 62464 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2300 + 10000 + 287.5 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 200 + ssd + + + required + 200 + + true + c5d.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + true + false + + + 10000 + 65000 + 1250.0 + 10000 + 65000 + 1250.0 + + default + supported + unsupported + + false + false + xen + false + m4.16xlarge + + 262144 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + unsupported + + false + false + nitro + false + r5.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + m6g.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + false + r5n.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 75 Gigabit + + + 75 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + false + r5n.24xlarge + + 786432 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + page3 + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/page3.xml b/test/data/describe-instance-types-mocks/page3.xml new file mode 100644 index 00000000..dfc9a790 --- /dev/null +++ b/test/data/describe-instance-types-mocks/page3.xml @@ -0,0 +1,9791 @@ + + + 5203d421-21c1-4303-a43d-4d4dc877e2f8 + + + true + false + false + true + true + + + 3500 + 20000 + 437.5 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + nitro + false + a1.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 16 + + + 1 + + + + + false + false + false + true + true + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 59 + ssd + + + required + 59 + + true + c6gd.medium + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + c6g.8xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + false + false + false + true + true + + + 7000 + 32500 + 875.0 + 7000 + 32500 + 875.0 + + default + supported + supported + + false + false + xen + + + + 4 + 1900 + ssd + + + required + 7600 + + true + i3.8xlarge + + 249856 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + true + false + false + true + true + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c6g.medium + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + r5d.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 800 + 3333 + 100.0 + 3170 + 13333 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + required + 75 + + true + z1d.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 14000 + 80000 + 1750.0 + 14000 + 80000 + 1750.0 + + default + supported + unsupported + + false + false + xen + + + + 2 + 1920 + ssd + + + unsupported + 3840 + + true + x1.32xlarge + + 1998848 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 64 + 2 + 128 + + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 40 + 44 + 48 + 52 + 56 + 60 + 64 + + + 1 + 2 + + + + + true + false + false + false + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + supported + unsupported + + false + true + xen + + + + 2 + 80 + ssd + + + unsupported + 160 + + true + m3.2xlarge + + 30720 + + + 0 + false + unsupported + 30 + 0 + false + 1 + 4 + + + 4 + 0 + High + + + High + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 4 + 900 + ssd + + + required + 3600 + + true + r5d.metal + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + false + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + required + 1200 + + true + r5d.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + true + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + r6g.metal + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + false + false + false + true + false + + + 3170 + 13300 + 396.25 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + + + + 2 + 600 + ssd + + + unsupported + 1200 + + true + c5ad.8xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 3170 + 13300 + 396.25 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + false + c5a.8xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + + + 1 + 2 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3a.large + + 8192 + + + 0 + false + required + 12 + 12 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2307 + 12000 + 288.3875 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 2500 + ssd + + + required + 5000 + + true + i3en.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + default + supported + unsupported + + false + false + xen + + + + 12 + 2048 + hdd + + + unsupported + 24576 + + true + d2.4xlarge + + 124928 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + false + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 2 + 1900 + ssd + + + required + 3800 + + true + r6gd.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.medium + + 4096 + + + 0 + false + unsupported + 6 + 6 + true + 1 + 3 + + + 3 + 0 + Low to Moderate + + + Low to Moderate + + + + partition + spread + + + + + i386 + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + false + + + 2880 + 16000 + 360.0 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + r5ad.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + true + true + false + + + 174 + 1000 + 21.75 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3.small + + 2048 + + + 0 + false + required + 4 + 4 + true + 1 + 3 + + + 3 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + + + + 16 + AWS + Inferentia + + + + false + inf1.24xlarge + + 196608 + + + 0 + true + required + 30 + 30 + true + 1 + 11 + + + 11 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 650 + 3600 + 81.25 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + m5.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + m5n.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + false + true + + unsupported + supported + unsupported + + false + false + xen + + + + 8 + 800 + ssd + + + unsupported + 6400 + + true + i2.8xlarge + + 249856 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 474 + ssd + + + required + 474 + + true + m6gd.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + false + m5n.24xlarge + + 393216 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.xlarge + + 16384 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + true + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + unsupported + + false + false + nitro + false + r5.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 1 + 1900 + ssd + + + required + 1900 + + true + r6gd.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + m5d.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + z1d.12xlarge + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1700 + 12000 + 212.5 + 1700 + 12000 + 212.5 + + default + supported + supported + + false + true + xen + + + + 1 + 1900 + ssd + + + required + 1900 + + true + i3.2xlarge + + 62464 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 6800 + 30000 + 850.0 + 6800 + 30000 + 850.0 + + default + supported + required + + false + false + nitro + false + r5n.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1750 + 10000 + 218.75 + 3500 + 20000 + 437.5 + + default + supported + required + + false + false + nitro + false + a1.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.3 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 8 + + + 1 + + + + + false + false + false + true + true + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 474 + ssd + + + required + 474 + + true + c6gd.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + false + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 100 + ssd + + + required + 100 + + true + c5d.xlarge + + 8192 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c6g.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + true + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r5a.8xlarge + + 262144 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + m5ad.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 8 + 1900 + ssd + + + required + 15200 + + true + i3.metal + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 72 + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + + + + 1 + NVIDIA + + 16384 + + T4 + + + 16384 + + false + nitro + + + + 1 + 900 + ssd + + + required + 900 + + true + g4dn.16xlarge + + 262144 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + r5dn.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 75 Gigabit + + + 75 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 425 + 3000 + 53.125 + 425 + 3000 + 53.125 + + default + supported + unsupported + + false + true + xen + false + r4.large + + 15616 + + + 0 + false + supported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 7000 + 37500 + 875.0 + 7000 + 37500 + 875.0 + + default + supported + unsupported + + false + false + xen + false + r4.8xlarge + + 249856 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + r5dn.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 15000 + 593.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + m5dn.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 950 + ssd + + + required + 950 + + true + c6gd.4xlarge + + 32768 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 1 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + + + + + true + false + false + true + false + + + 650 + 3600 + 81.25 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + m5a.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + r5n.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + false + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + supported + supported + unsupported + + false + true + xen + + + + 2 + 80 + ssd + + + unsupported + 160 + + true + c3.2xlarge + + 15360 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.8 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + true + false + true + true + false + + + 45 + 250 + 5.625 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3a.nano + + 512 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 4000 + 32000 + 500.0 + 4000 + 32000 + 500.0 + + default + supported + unsupported + + false + false + xen + false + m4.10xlarge + + 163840 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 20 + 2 + 40 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1085 + 6000 + 135.625 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + r5ad.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 7000 + 40000 + 875.0 + 7000 + 40000 + 875.0 + + default + supported + unsupported + + false + false + xen + + + + 1 + 1920 + ssd + + + unsupported + 1920 + + true + x1e.16xlarge + + 1998848 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + unsupported + + false + false + nitro + false + r5.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + true + + + 14000 + 80000 + 1750.0 + 14000 + 80000 + 1750.0 + + default + supported + unsupported + + false + + + + 8 + NVIDIA + + 16384 + + V100 + + + 131072 + + false + xen + false + p3.16xlarge + + 499712 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 300 + ssd + + + required + 300 + + true + m5d.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 1153 + 6000 + 144.2 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 2500 + ssd + + + required + 2500 + + true + i3en.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 10000 + 65000 + 1250.0 + 10000 + 65000 + 1250.0 + + default + supported + unsupported + + false + + + + 16 + NVIDIA + + 12288 + + K80 + + + 196608 + + false + xen + false + p2.16xlarge + + 749568 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 950 + 3000 + 118.75 + 3500 + 20000 + 437.5 + + default + supported + required + + false + + + + 1 + NVIDIA + + 16384 + + T4 + + + 16384 + + false + nitro + + + + 1 + 125 + ssd + + + required + 125 + + true + g4dn.xlarge + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + true + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 4 + 900 + ssd + + + required + 3600 + + true + c5d.metal + + 196608 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.6 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + false + false + true + true + false + + + 512 + 4000 + 64.0 + 2048 + 15700 + 256.0 + + default + supported + unsupported + + false + false + nitro + false + t4g.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + true + false + false + true + true + + + 500 + 3700 + 62.5 + 500 + 3700 + 62.5 + + default + supported + unsupported + + false + false + xen + + + + 1 + 120 + ssd + + + unsupported + 120 + + true + x1e.xlarge + + 124928 + + + 0 + false + supported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 1 + 900 + ssd + + + required + 900 + + true + z1d.6xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 12 + 2 + 24 + + 2 + 4 + 6 + 8 + 10 + 12 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14000 + 65000 + 1750.0 + 14000 + 65000 + 1750.0 + + default + supported + supported + + false + false + xen + + + + 8 + 1900 + ssd + + + required + 15200 + + true + i3.16xlarge + + 499712 + + + 0 + false + supported + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + true + + + 576 + 3000 + 72.1 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 1250 + ssd + + + required + 1250 + + true + i3en.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + c5n.metal + + 196608 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 72 + + + + true + false + false + true + true + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + unsupported + + false + false + nitro + false + m6g.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + r5dn.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + + + 1 + 2 + + + + + true + false + false + true + false + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r6g.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + unsupported + + false + false + nitro + false + m5.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + true + xen + + + + 1 + 4 + ssd + + + unsupported + 4 + + true + m3.medium + + 3840 + + + 0 + false + unsupported + 6 + 0 + false + 1 + 2 + + + 2 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + false + + + 13570 + 60000 + 1696.25 + 13570 + 60000 + 1696.25 + + default + supported + unsupported + + false + false + nitro + false + r5a.24xlarge + + 786432 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 12 + 18 + 24 + 36 + 48 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + m5n.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + m5.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + false + true + + unsupported + supported + unsupported + + false + true + xen + + + + 1 + 32 + ssd + + + unsupported + 32 + + true + m3.large + + 7680 + + + 0 + false + unsupported + 10 + 0 + false + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + false + true + true + + + 2300 + 12000 + 287.5 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + r5.2xlarge + + 65536 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + r5ad.16xlarge + + 524288 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + false + + + 200 + 800 + 25.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + + + + 1 + 75 + ssd + + + unsupported + 75 + + true + c5ad.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 13600 + 60000 + 1700.0 + 13600 + 60000 + 1700.0 + + default + supported + required + + false + false + nitro + + + + 4 + 600 + ssd + + + required + 2400 + + true + m5dn.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 75 Gigabit + + + 75 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + true + false + false + false + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + supported + supported + unsupported + + false + true + xen + + + + 2 + 160 + ssd + + + unsupported + 320 + + true + c3.4xlarge + + 30720 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.8 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 2300 + 10000 + 287.5 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + c5.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 18750 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + r5.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1085 + 6000 + 135.625 + 2880 + 16000 + 360.0 + + default + supported + required + + false + true + nitro + + + + 1 + 150 + ssd + + + required + 150 + + true + m5ad.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1188 + 6000 + 148.5 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + r6g.xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 1 + 4 + + 1 + 2 + 3 + 4 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 1 + 1900 + ssd + + + required + 1900 + + true + m6gd.8xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + true + false + false + true + true + + + 750 + 6000 + 93.75 + 750 + 6000 + 93.75 + + default + supported + unsupported + + false + + + + 1 + NVIDIA + + 12288 + + K80 + + + 12288 + + false + xen + false + p2.xlarge + + 62464 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 15000 + 593.75 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + r5dn.4xlarge + + 131072 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + false + false + false + false + true + + + 2000 + 16000 + 250.0 + 2000 + 16000 + 250.0 + + supported + supported + unsupported + + false + false + xen + + + + 4 + 800 + ssd + + + unsupported + 3200 + + true + i2.4xlarge + + 124928 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1750 + 10000 + 218.75 + 1750 + 10000 + 218.75 + + default + supported + unsupported + + false + false + xen + + + + 1 + 480 + ssd + + + unsupported + 480 + + true + x1e.4xlarge + + 499712 + + + 0 + false + supported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 650 + 4000 + 81.25 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + true + nitro + false + c5.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + false + + + 6300 + 26700 + 787.5 + 6300 + 26700 + 787.5 + + default + supported + required + + false + false + nitro + false + c5a.16xlarge + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 1 + 2 + 3 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + + + 1 + 2 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + nitro + false + m6g.16xlarge + + 262144 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 64 + 1 + 64 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + + + 1 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 2 + 900 + ssd + + + required + 1800 + + true + z1d.metal + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 48 + + + + false + false + false + true + true + + + 425 + 3000 + 53.125 + 425 + 3000 + 53.125 + + default + supported + supported + + false + true + xen + + + + 1 + 475 + ssd + + + required + 475 + + true + i3.large + + 15616 + + + 0 + false + supported + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1000 + 8000 + 125.0 + 1000 + 8000 + 125.0 + + default + supported + unsupported + + false + true + xen + false + m4.2xlarge + + 32768 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 1 + 2 + 3 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + m5dn.24xlarge + + 393216 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.small + + 2048 + + + 0 + false + unsupported + 4 + 4 + true + 1 + 3 + + + 3 + 0 + Low to Moderate + + + Low to Moderate + + + + partition + spread + + + + + i386 + x86_64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + false + + + 850 + 5000 + 106.25 + 850 + 5000 + 106.25 + + default + supported + unsupported + + false + + + + 1 + NVIDIA + + 8192 + + M60 + + + 8192 + + false + xen + false + g3s.xlarge + + 31232 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + page4 + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/page4.xml b/test/data/describe-instance-types-mocks/page4.xml new file mode 100644 index 00000000..d2e956c7 --- /dev/null +++ b/test/data/describe-instance-types-mocks/page4.xml @@ -0,0 +1,4074 @@ + + + dc300e7c-1cd0-4ff3-b0aa-99bc8fa3f522 + + + true + false + false + true + true + + + 650 + 3000 + 81.25 + 4750 + 15000 + 593.75 + + default + supported + required + + false + false + nitro + false + r5n.large + + 16384 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + false + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + + + + 1 + NVIDIA + + 16384 + + T4 + + + 16384 + + false + nitro + + + + 1 + 225 + ssd + + + required + 225 + + true + g4dn.4xlarge + + 65536 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + true + false + false + true + true + + + 1150 + 6000 + 143.75 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c5n.xlarge + + 10752 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 7000 + 40000 + 875.0 + 7000 + 40000 + 875.0 + + default + supported + unsupported + + false + + + + 4 + NVIDIA + + 16384 + + V100 + + + 65536 + + false + xen + false + p3.8xlarge + + 249856 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.7 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 13750 + 60000 + 1718.75 + 13750 + 60000 + 1718.75 + + default + supported + unsupported + + false + false + nitro + false + m5a.24xlarge + + 393216 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 12 + 18 + 24 + 36 + 48 + + + 1 + 2 + + + + + true + false + false + true + false + + + 200 + 800 + 25.0 + 3170 + 13300 + 396.25 + + default + supported + required + + false + false + nitro + false + c5a.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.3 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + true + true + + + 3500 + 16000 + 437.5 + 3500 + 16000 + 437.5 + + default + supported + supported + + false + true + xen + + + + 2 + 1900 + ssd + + + required + 3800 + + true + i3.4xlarge + + 124928 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + false + false + false + true + true + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 118 + ssd + + + required + 118 + + true + c6gd.large + + 4096 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + true + false + false + true + true + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + c6g.2xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + false + false + false + true + false + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + + + + 1 + NVIDIA + + 16384 + + T4 + + + 16384 + + false + nitro + + + + 1 + 900 + ssd + + + required + 900 + + true + g4dn.8xlarge + + 131072 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + 50 Gigabit + + + 50 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + true + false + false + true + false + + + 6780 + 30000 + 847.5 + 6780 + 30000 + 847.5 + + default + supported + unsupported + + false + false + nitro + false + m5a.12xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 24 + 2 + 48 + + 6 + 12 + 18 + 24 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 450 + ssd + + + required + 450 + + true + z1d.3xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 4.0 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 6 + 2 + 12 + + 2 + 4 + 6 + + + 1 + 2 + + + + + false + false + false + true + false + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + required + + false + false + nitro + + + + 2 + 1425 + ssd + + + required + 2850 + + true + r6gd.12xlarge + + 393216 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + false + false + xen + + + + 1 + 160 + hdd + + + unsupported + 160 + + true + m1.small + + 1740 + + + 0 + false + unsupported + 4 + 0 + false + 1 + 2 + + + 2 + 0 + Low + + + Low + + + + partition + spread + + + + + i386 + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + true + nitro + false + c5.18xlarge + + 147456 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 36 + 2 + 72 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + + + 1 + 2 + + + + + true + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + unsupported + + false + false + false + c6g.metal + + 131072 + + + 0 + false + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 64 + + + + false + false + false + true + false + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + + + + 8 + NVIDIA + + 32768 + + V100 + + + 262144 + + false + nitro + + + + 2 + 900 + ssd + + + required + 1800 + + true + p3dn.24xlarge + + 786432 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14000 + 75000 + 1750.0 + 14000 + 75000 + 1750.0 + + default + supported + unsupported + + + + + 8 + Xilinx + + 65536 + + Virtex UltraScale (VU9P) + + + 524288 + + false + false + xen + + + + 4 + 940 + ssd + + + required + 3760 + + true + f1.16xlarge + + 999424 + + + 0 + false + unsupported + 50 + 50 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 2 + 64 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + + + 1 + 2 + + + + + false + false + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + nitro + + + + 4 + 900 + ssd + + + required + 3600 + + true + r5dn.24xlarge + + 786432 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 2 + 96 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 + 26 + 28 + 30 + 32 + 34 + 36 + 38 + 40 + 42 + 44 + 46 + 48 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 20000 + 593.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 7500 + ssd + + + required + 15000 + + true + i3en.6xlarge + + 196608 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 25 Gigabit + + + 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 12 + 2 + 24 + + 2 + 4 + 6 + 8 + 10 + 12 + + + 1 + 2 + + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + false + false + xen + + + + 1 + 410 + hdd + + + unsupported + 410 + + true + m1.medium + + 3788 + + + 0 + false + unsupported + 6 + 0 + false + 1 + 2 + + + 2 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + i386 + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 1 + 900 + ssd + + + required + 900 + + true + c5d.9xlarge + + 73728 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.4 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 18 + 2 + 36 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + + + 1 + 2 + + + + + false + false + false + true + false + + + 1150 + 6000 + 143.75 + 3500 + 20000 + 437.5 + + default + supported + required + + false + + + + 1 + NVIDIA + + 16384 + + T4 + + + 16384 + + false + nitro + + + + 1 + 225 + ssd + + + required + 225 + + true + g4dn.2xlarge + + 32768 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 25 Gigabit + + + Up to 25 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 4 + 2 + 8 + + 2 + 4 + + + 1 + 2 + + + + + false + false + false + true + true + + + 14250 + 50000 + 1781.25 + 14250 + 50000 + 1781.25 + + default + supported + required + + false + false + nitro + + + + 2 + 1425 + ssd + + + required + 2850 + + true + c6gd.12xlarge + + 98304 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 20 Gigabit + + + 20 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 48 + 1 + 48 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + + + 1 + + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + false + false + xen + + + + 1 + 420 + hdd + + + unsupported + 420 + + true + m2.xlarge + + 17510 + + + 0 + false + unsupported + 15 + 0 + false + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + true + + + 750 + 6000 + 93.75 + 750 + 6000 + 93.75 + + default + supported + unsupported + + false + false + xen + + + + 3 + 2048 + hdd + + + unsupported + 6144 + + true + d2.xlarge + + 31232 + + + 0 + false + unsupported + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Moderate + + + Moderate + + + + cluster + partition + spread + + + + + x86_64 + + 2.4 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 1 + 2 + + + 1 + 2 + + + + + true + false + false + true + true + + + 315 + 2500 + 39.375 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + m6g.medium + + 4096 + + + 0 + false + required + 4 + 4 + true + 1 + 2 + + + 2 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + true + false + false + true + true + + + 2375 + 12000 + 296.875 + 4750 + 20000 + 593.75 + + default + supported + unsupported + + false + false + nitro + false + m6g.2xlarge + + 32768 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 1 + 8 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + + + + + true + false + true + true + false + + unsupported + supported + unsupported + + false + true + xen + false + t2.nano + + 512 + + + 0 + false + unsupported + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Low to Moderate + + + Low to Moderate + + + + partition + spread + + + + + i386 + x86_64 + + 2.4 + + + legacy-bios + + + ebs + + + on-demand + + + hvm + + + 1 + 1 + 1 + + 1 + + + 1 + + + + + false + false + false + true + true + + + 630 + 3600 + 78.75 + 4750 + 20000 + 593.75 + + default + supported + required + + false + false + nitro + + + + 1 + 118 + ssd + + + required + 118 + + true + m6gd.large + + 8192 + + + 0 + false + required + 10 + 10 + true + 1 + 3 + + + 3 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + true + false + true + true + + + 19000 + 80000 + 2375.0 + 19000 + 80000 + 2375.0 + + default + supported + required + + false + false + + + + 8 + 7500 + ssd + + + required + 60000 + + true + i3en.metal + + 786432 + + + 0 + true + required + 50 + 50 + true + 1 + 15 + + + 15 + 0 + 100 Gigabit + + + 100 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 96 + + + + true + false + true + true + false + + + 90 + 500 + 11.25 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3a.micro + + 1024 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + 2 + + 1 + + + 1 + 2 + + + + + false + false + false + false + true + + unsupported + supported + unsupported + + false + + + + 4 + NVIDIA + + 4096 + + K520 + + + 16384 + + false + xen + + + + 2 + 120 + ssd + + + unsupported + 240 + + true + g2.8xlarge + + 61440 + + + 0 + false + unsupported + 30 + 0 + false + 1 + 8 + + + 8 + 0 + High + + + High + + + + cluster + partition + spread + + + + + x86_64 + + 2.6 + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + false + false + + unsupported + unsupported + unsupported + + false + false + xen + + + + 4 + 840 + hdd + + + unsupported + 3360 + + true + cc2.8xlarge + + 61952 + + + 0 + false + unsupported + 30 + 0 + false + 1 + 8 + + + 8 + 0 + 10 Gigabit + + + 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.6 + + + legacy-bios + + + ebs + instance-store + + + on-demand + + + hvm + + + 16 + 2 + 32 + + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + + + 1 + 2 + + + + + false + false + false + true + true + + + 3500 + 44000 + 437.5 + 3500 + 44000 + 437.5 + + default + supported + supported + + + + + 2 + Xilinx + + 65536 + + Virtex UltraScale (VU9P) + + + 131072 + + false + false + xen + + + + 1 + 940 + ssd + + + required + 940 + + true + f1.4xlarge + + 249856 + + + 0 + false + unsupported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + true + false + false + true + false + + + 1085 + 6000 + 135.625 + 2880 + 16000 + 360.0 + + default + supported + unsupported + + false + true + nitro + false + m5a.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.5 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + true + false + true + true + false + + + 695 + 4000 + 86.875 + 2780 + 15700 + 347.5 + + default + supported + unsupported + + false + true + nitro + false + t3a.xlarge + + 16384 + + + 0 + false + required + 15 + 15 + true + 1 + 4 + + + 4 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 2 + 2 + 4 + + 2 + + + 1 + 2 + + + + + false + false + false + false + false + + + 500 + 4000 + 62.5 + 500 + 4000 + 62.5 + + supported + unsupported + unsupported + + false + false + xen + + + + 2 + 420 + hdd + + + unsupported + 840 + + true + m1.large + + 7680 + + + 0 + false + unsupported + 10 + 0 + false + 1 + 3 + + + 3 + 0 + Moderate + + + Moderate + + + + partition + spread + + + + + x86_64 + + + + legacy-bios + + + ebs + instance-store + + + on-demand + spot + + + paravirtual + hvm + + + 2 + 1 + 2 + + 1 + 2 + + + 1 + + + + + false + false + false + true + true + + + 9500 + 40000 + 1187.5 + 9500 + 40000 + 1187.5 + + default + supported + required + + false + false + nitro + + + + 1 + 1900 + ssd + + + required + 1900 + + true + c6gd.8xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + 12 Gigabit + + + 12 Gigabit + + + + cluster + partition + spread + + + + + arm64 + + 2.5 + + + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 32 + 1 + 32 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + + + 1 + + + + + true + false + false + true + true + + + 3500 + 18750 + 437.5 + 3500 + 18750 + 437.5 + + default + supported + unsupported + + false + true + xen + false + r4.4xlarge + + 124928 + + + 0 + false + supported + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 2.3 + + + legacy-bios + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + 1 + 2 + + + + + false + false + false + true + true + + + 4750 + 18750 + 593.75 + 4750 + 18750 + 593.75 + + default + supported + required + + false + false + nitro + + + + 2 + 300 + ssd + + + required + 600 + + true + m5d.4xlarge + + 65536 + + + 0 + false + required + 30 + 30 + true + 1 + 8 + + + 8 + 0 + Up to 10 Gigabit + + + Up to 10 Gigabit + + + + cluster + partition + spread + + + + + x86_64 + + 3.1 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 8 + 2 + 16 + + 2 + 4 + 6 + 8 + + + 1 + 2 + + + + + \ No newline at end of file diff --git a/test/data/describe-instance-types-mocks/t3a-nano.xml b/test/data/describe-instance-types-mocks/t3a-nano.xml new file mode 100644 index 00000000..3ff007f3 --- /dev/null +++ b/test/data/describe-instance-types-mocks/t3a-nano.xml @@ -0,0 +1,93 @@ + + + dc300e7c-1cd0-4ff3-b0aa-99bc8fa3f522 + + + true + false + true + true + false + + + 45 + 250 + 5.625 + 2085 + 11800 + 260.625 + + default + supported + unsupported + + false + true + nitro + false + t3a.nano + + + 1024 + + + 0 + false + required + 2 + 2 + true + 1 + 2 + + + 2 + 0 + Up to 5 Gigabit + + + Up to 5 Gigabit + + + + partition + spread + + + + + x86_64 + + 2.2 + + + legacy-bios + uefi + + + ebs + + + on-demand + spot + + + hvm + + + 1 + 2 + + 4 + + 1 + + + 1 + 2 + + + + + \ No newline at end of file diff --git a/test/spot-prices-mock.json b/test/data/spot-prices-mock.json similarity index 99% rename from test/spot-prices-mock.json rename to test/data/spot-prices-mock.json index 2f7975f0..c65a0922 100644 --- a/test/spot-prices-mock.json +++ b/test/data/spot-prices-mock.json @@ -22109,7 +22109,7 @@ "AvailabilityZone": "us-east-1f", "InstanceType": "c5.large", "ProductDescription": "Linux/UNIX (Amazon VPC)", - "SpotPrice": "0.032800", + "SpotPrice": "0.032712", "Timestamp": "2019-10-15T19:11:42.000Z" }, { @@ -259356,4 +259356,4 @@ "SpotPrice": "0.160700", "Timestamp": "2019-10-15T00:31:27.000Z" } -] \ No newline at end of file +] diff --git a/test/mock-ec2-endpoints.ts b/test/mock-ec2-endpoints.ts index 8ab788fc..5d34f577 100644 --- a/test/mock-ec2-endpoints.ts +++ b/test/mock-ec2-endpoints.ts @@ -10,7 +10,7 @@ import { Region, allRegions, defaultRegions } from '../src/constants/regions'; import { mockAwsCredentials, mockAwsCredentialsClear } from './mock-credential-endpoints'; const data = JSON.parse( - readFileSync(resolve(__dirname, '../test/spot-prices-mock.json')).toString(), + readFileSync(resolve(__dirname, '../test/data/spot-prices-mock.json')).toString(), ); type RegionalData = { [region in Region]: SpotPrice[] }; @@ -39,62 +39,104 @@ const nockEndpoint = (options: { .reply((uri, body) => { const params = parse(body as string); - const index = params.NextToken ? parseInt(params.NextToken as string, 10) : 0; + if (params.Action === 'DescribeSpotPriceHistory') { + const index = params.NextToken ? parseInt(params.NextToken as string, 10) : 0; - const instanceTypes = Object.keys(params).reduce((prev, key) => { - const value = params[key]; - if (key.startsWith('InstanceType') && typeof value === 'string') prev.push(value); - return prev; - }, [] as string[]); + const instanceTypes = Object.keys(params).reduce((prev, key) => { + const value = params[key]; + if (key.startsWith('InstanceType') && typeof value === 'string') prev.push(value); + return prev; + }, [] as string[]); - const productDescriptions = Object.keys(params).reduce((prev, key) => { - const value = params[key]; - if (key.startsWith('ProductDescription') && typeof value === 'string') prev.push(value); - return prev; - }, [] as string[]); + const platforms = Object.keys(params).reduce((prev, key) => { + const value = params[key]; + if (key.startsWith('ProductDescription') && typeof value === 'string') prev.push(value); + return prev; + }, [] as string[]); - const instanceData: SpotPrice[] = filter(regionalData[region], (o: SpotPrice) => { - let rtn = true; - if (instanceTypes.length && (!o.InstanceType || !instanceTypes.includes(o.InstanceType))) { - rtn = false; - } - if ( - productDescriptions.length && - (!o.ProductDescription || !productDescriptions.includes(o.ProductDescription)) - ) { - rtn = false; + const instanceData: SpotPrice[] = filter(regionalData[region], (o: SpotPrice) => { + let rtn = true; + if ( + instanceTypes.length && + (!o.InstanceType || !instanceTypes.includes(o.InstanceType)) + ) { + rtn = false; + } + if ( + platforms.length && + (!o.ProductDescription || !platforms.includes(o.ProductDescription)) + ) { + rtn = false; + } + return rtn; + }); + + const instanceDataSlice = maxLength + ? instanceData.slice(index, index + maxLength) + : instanceData; + const nextIndex = + maxLength && instanceData.length >= index + maxLength ? index + maxLength : undefined; + + return [ + 200, + ` + requestId + + ${instanceDataSlice.map((d, idx) => { + const returnWithBlank = + returnPartialBlankValues && + nextIndex === undefined && + idx === instanceDataSlice.length - 1; + return ` + ${d.InstanceType} + ${d.ProductDescription} + ${returnWithBlank ? '' : `${d.SpotPrice}`} + ${d.Timestamp} + ${ + returnWithBlank + ? '' + : `${d.AvailabilityZone}` + } + `; + })} + + ${nextIndex || ''} + `, + ]; + } + + // + // Action = DescribeInstanceTypes + // + const { NextToken } = params; + + const instanceTypes: string[] = []; + Object.entries(params).forEach(([key, value]) => { + if (key.match(/^InstanceType.\d{1,}$/) && typeof value === 'string') { + instanceTypes.push(value.replace(new RegExp('\\.', 'g'), '-')); } - return rtn; }); - const instanceDataSlice = maxLength - ? instanceData.slice(index, index + maxLength) - : instanceData; - const nextIndex = - maxLength && instanceData.length >= index + maxLength ? index + maxLength : undefined; - - return [ - 200, - ` - requestId - - ${instanceDataSlice.map((d, idx) => { - const returnWithBlank = - returnPartialBlankValues && - nextIndex === undefined && - idx === instanceDataSlice.length - 1; - return ` - ${d.InstanceType} - ${d.ProductDescription} - ${returnWithBlank ? '' : `${d.SpotPrice}`} - ${d.Timestamp} - ${returnWithBlank ? '' : `${d.AvailabilityZone}`} - `; - })} - - ${nextIndex || ''} - `, - ]; + // only support single instance type request (dummy.large, t3a.nano) + if (instanceTypes.length) { + const mockedData = readFileSync( + resolve( + __dirname, + '../test/data/describe-instance-types-mocks', + `${instanceTypes[0]}.xml`, + ), + ).toString(); + return [200, mockedData]; + } + + const mockedData = readFileSync( + resolve( + __dirname, + '../test/data/describe-instance-types-mocks', + `${NextToken || 'page1'}.xml`, + ), + ).toString(); + return [200, mockedData]; }); }; diff --git a/tsconfig.build-types.json b/tsconfig.build-types.json new file mode 100644 index 00000000..1abef96f --- /dev/null +++ b/tsconfig.build-types.json @@ -0,0 +1,22 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "noEmit": false, + "emitDeclarationOnly": true, + "declaration": true, + "declarationDir": "types" + }, + "files": [ + "src/cli.ts", + "src/module.ts", + "src/constants/ec2-info.ts", + "src/constants/ec2-types.ts", + "src/constants/platform.ts", + "src/constants/regions.ts", + "src/lib/core.ts", + "src/lib/credential.ts", + "src/lib/ui.ts", + "src/lib/utils.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json index e05835f4..e0dcd820 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,17 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", - "lib": ["es5"], + "target": "ES5", + "lib": ["ES2020"], "moduleResolution": "node", "strict": true, "strictPropertyInitialization": false, "sourceMap": true, "downlevelIteration": true, - "rootDir": "src", - "emitDeclarationOnly": true, - "declaration": true, - "declarationDir": "types", + "rootDir": ".", + "sourceRoot": "src", + "noEmit": true, "esModuleInterop": true }, - "files": [ - "src/cli.ts", - "src/module.ts", - "src/constants/ec2-types.ts", - "src/constants/product-description.ts", - "src/constants/regions.ts", - "src/lib/core.ts", - "src/lib/credential.ts", - "src/lib/ui.ts", - "src/lib/utils.ts" - ], "exclude": ["node_modules"] } diff --git a/yarn.lock b/yarn.lock index 3d08f78c..e1442f88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1997,7 +1997,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:4.7.0": +"@typescript-eslint/eslint-plugin@npm:4.7.0, @typescript-eslint/eslint-plugin@npm:^4.5.0": version: 4.7.0 resolution: "@typescript-eslint/eslint-plugin@npm:4.7.0" dependencies: @@ -3023,6 +3023,7 @@ __metadata: eslint-plugin-import: 2.22.1 eslint-plugin-jest: 24.1.3 eslint-plugin-prettier: 3.1.4 + eslint-plugin-unused-imports: ^1.0.0 husky: 4.3.0 import-sort-style-module: 6.0.0 jest: 26.6.3 @@ -5420,6 +5421,26 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-unused-imports@npm:^1.0.0": + version: 1.0.0 + resolution: "eslint-plugin-unused-imports@npm:1.0.0" + dependencies: + "@typescript-eslint/eslint-plugin": ^4.5.0 + eslint: ^7.11.0 + eslint-rule-composer: ^0.3.0 + requireindex: ~1.2.0 + typescript: ^4.0.3 + checksum: 1363c9850233de1267f5bd5a373c41f5dfe322335517009129f9d64aaffc98e25917cf438490ba5d2c4ec324c0b3166b273cffa1ea0fb35955bce70be0368207 + languageName: node + linkType: hard + +"eslint-rule-composer@npm:^0.3.0": + version: 0.3.0 + resolution: "eslint-rule-composer@npm:0.3.0" + checksum: eb96fffa4eb2cc40061bf082bb4cc48df746e9c556e4b20c653e1b84b34cabd66462bafad124d44ea2b89a750a2aec26c21507bd7b8b23f355136a8901e09d00 + languageName: node + linkType: hard + "eslint-scope@npm:^5.0.0": version: 5.0.0 resolution: "eslint-scope@npm:5.0.0" @@ -5479,7 +5500,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:7.13.0": +"eslint@npm:7.13.0, eslint@npm:^7.11.0": version: 7.13.0 resolution: "eslint@npm:7.13.0" dependencies: @@ -11953,6 +11974,13 @@ fsevents@^2.1.2: languageName: node linkType: hard +"requireindex@npm:~1.2.0": + version: 1.2.0 + resolution: "requireindex@npm:1.2.0" + checksum: a6c6c2edd46bcce88f839f69f1d29a11920664862d8b78c205fc69ab2d65a8f592c1a8d68755335898af14ab110cc9fdfc7c572412d38cec485bdf4db45c49c5 + languageName: node + linkType: hard + "resolve-cwd@npm:^3.0.0": version: 3.0.0 resolution: "resolve-cwd@npm:3.0.0" @@ -13764,7 +13792,7 @@ resolve@^1.13.1: languageName: node linkType: hard -typescript@4.0.5: +"typescript@4.0.5, typescript@^4.0.3": version: 4.0.5 resolution: "typescript@npm:4.0.5" bin: @@ -13784,7 +13812,7 @@ typescript@^3.2.4: languageName: node linkType: hard -"typescript@patch:typescript@4.0.5#builtin": +"typescript@patch:typescript@4.0.5#builtin, typescript@patch:typescript@^4.0.3#builtin": version: 4.0.5 resolution: "typescript@patch:typescript@npm%3A4.0.5#builtin::version=4.0.5&hash=5bf698" bin: