{"id":15033121,"url":"https://github.com/kyoshidajp/ec2spec","last_synced_at":"2025-10-04T01:31:16.637Z","repository":{"id":62557707,"uuid":"143578342","full_name":"kyoshidajp/ec2spec","owner":"kyoshidajp","description":"A simple comparison tool for Amazon EC2 Instances.","archived":true,"fork":false,"pushed_at":"2020-03-05T20:15:40.000Z","size":74,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T15:45:00.657Z","etag":null,"topics":["aws","ec2","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyoshidajp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-05T02:48:16.000Z","updated_at":"2023-01-28T15:23:37.000Z","dependencies_parsed_at":"2022-11-03T06:45:28.968Z","dependency_job_id":null,"html_url":"https://github.com/kyoshidajp/ec2spec","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyoshidajp%2Fec2spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyoshidajp%2Fec2spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyoshidajp%2Fec2spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyoshidajp%2Fec2spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyoshidajp","download_url":"https://codeload.github.com/kyoshidajp/ec2spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235208944,"owners_count":18953003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","ec2","ruby"],"created_at":"2024-09-24T20:20:09.901Z","updated_at":"2025-10-04T01:31:11.351Z","avatar_url":"https://github.com/kyoshidajp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![](https://user-images.githubusercontent.com/3317191/44626545-42a39380-a959-11e8-96a4-de3b0ea3e96f.png)](https://github.com/kyoshidajp/ec2spec)\n\n[![Gem Version](https://badge.fury.io/rb/ec2spec.svg)](https://badge.fury.io/rb/ec2spec)\n[![Build Status](https://travis-ci.org/kyoshidajp/ec2spec.svg?branch=master)](https://travis-ci.org/kyoshidajp/ec2spec)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]\n\n[license]: https://github.com/kyoshidajp/ec2spec/blob/master/LICENSE\n\nec2spec is a simple comparison tool for Amazon EC2 Instances you can access.\n\nSupports the following items.\n\n| item     | from    |\n| :------- | :------ |\n| instance type | host |\n| instance id | host |\n| vCPU | AWS Price List API |\n| memory | AWS Price List API |\n| price | AWS Price List API |\n\nThe target host must be accessible from the machine. Also, only On-Demand way and Linux machine.\n\n## Installation\n\n```\n$ gem install ec2spec\n```\n\n## Usage\n\n```\n$ ec2spec ssh -h host1 ... [options]\n```\n\n### Example\n\n```\n$ ec2spec ssh -h host1 host2 host3\nI, [2018-08-12T20:54:25.814752 #64341]  INFO -- : Started: host1\nI, [2018-08-12T20:54:25.814835 #64341]  INFO -- : Started: host2\nI, [2018-08-12T20:54:25.814867 #64341]  INFO -- : Started: host3\nE, [2018-08-12T20:54:25.826113 #64341] ERROR -- : Connection refused: host3\nI, [2018-08-12T20:54:29.385848 #64341]  INFO -- : Finished: host1\nI, [2018-08-12T20:54:37.560003 #64341]  INFO -- : Finished: host2\n+---------------+-------------+---------------------+-------+\n|               | host1       | host2               | host3 |\n+---------------+-------------+---------------------|-------+\n| instance_type |    t2.micro |          c4.2xlarge |   N/A |\n|   instance_id |  i-xxxxxxxx |          i-yyyyyyyy |   N/A |\n|          vCPU |           1 |                   8 |   N/A |\n|        memory |       1 GiB |              15 GiB |   N/A |\n| price (USD/H) |      0.0152 |               0.504 |   N/A |\n| price (USD/M) |     11.3088 |             374.976 |   N/A |\n+---------------+-------------+---------------------+-------+\n```\n\nThe data of `host3` could not be acquired due to a connection refused error.\n\n### Options\n\n```\n-h, --host    Target hosts name.\n\n--days        How many days per one month.\n\n--format      Output format (default: plain_text).\n              plain_text, json, hash, slack, markdown\n\n--region      Region of EC2 (default: ap-northeast-1).\n\n--unit        Currency unit.\n              with --rate.\n\n--rate        Dollar exchange rate.\n              with --unit.\n              \n--calc_type   Calculate exchange currency rate type.\n              api, manual\n              with --app_id, --unit (if app)\n                   --unit, rate (if manual)\n\n--app_id      App ID of Open Exchange Rates\n              https://openexchangerates.org/\n              with --calc_type, --unit\n\n--debug       Output logs as DEBUG level.\n```\n\n#### --format (`plain_text`)\n\n```\n+---------------+-------------+-------------+\n|               | host1       | host2       |\n+---------------+-------------+-------------|\n| instance_type |    t2.micro |  c4.2xlarge |\n|   instance_id |  i-xxxxxxxx |  i-yyyyyyyy |\n|          vCPU |           1 |           8 |\n|        memory |       1 GiB |      15 GiB |\n| price (USD/H) |      0.0152 |       0.504 |\n| price (USD/M) |     11.3088 |     374.976 |\n+---------------+-------------+-------------+\n```\n\n#### --format (`json` and `hash`)\n\n```\n{\"host1\":{\"instance_type\":\"t2.micro\",\"instance_id\":\"i-xxxxxxxx\",\"vCPU\":\"1\",\"memory\":\"1 GiB\",\"price (USD/H)\":0.0152,\"price (USD/M)\":11.3088},\"host2\":{\"instance_type\":\"c4.2xlarge\",\"instance_id\":\"i-yyyyyyyy\",\"vCPU\":\"8\",\"memory\":\"15 GiB\",\"price (USD/H)\":0.504,\"price (USD/M)\":374.976}}\n```\n\n#### --format (`slack`)\n\n````\n```\n+---------------+-------------+-------------+\n|               | host1       | host2       |\n+---------------+-------------+-------------+\n| instance_type |    t2.micro |  c4.2xlarge |\n|   instance_id |  i-xxxxxxxx |  i-yyyyyyyy |\n|          vCPU |           1 |           8 |\n|        memory |       1 GiB |      15 GiB |\n| price (USD/H) |      0.0152 |       0.504 |\n| price (USD/M) |     11.3088 |     374.976 |\n+---------------+-------------+-------------+\n```\n````\n\n#### --format (`markdown`)\n\n```\n|               | stg-bastion | worker1     |\n|---------------|-------------|-------------|\n| instance_type |    t2.micro |  c4.2xlarge |\n|   instance_id |  i-xxxxxxxx |  i-yyyyyyyy |\n|          vCPU |           1 |           8 |\n|        memory |       1 GiB |      15 GiB |\n| price (USD/H) |      0.0152 |       0.504 |\n| price (USD/M) |     11.3088 |     374.976 |\n```\n\n### Exchange currency rate\n\n#### Manual\n\nOutput JPY as exchange rate is 1 dollar 111 yen.\n\n```\n$ ec2spec ssh -h host1 host2 --unit JPY --calc_type manual\n```\n\n#### API\n\nFirst, get App ID from\nhttps://openexchangerates.org/\n\nOutput JPY with it.\n\n```\n$ ec2spec ssh -h host1 host2 --unit JPY --calc_type api --app_id xxxxxxxx\n```\n\n**Note:** Exchange rate is cached in `~/.ec2spec/oxr.json`. If you want to refresh, you have to delete it.\n\n## As a library\n\n```\n\u003e require 'ec2spec'\n\u003e hosts = %w[host1 host2]\n\u003e client = Ec2spec::Client.new(hosts, 30, 'hash')\n\u003e result_json = client.run\n\u003e puts result_json\nI, [2018-08-12T20:54:25.814752 #64341]  INFO -- : Started: host1\nI, [2018-08-12T20:54:25.814835 #64341]  INFO -- : Started: host2\nI, [2018-08-12T20:54:29.385848 #64341]  INFO -- : Finished: host1\nI, [2018-08-12T20:54:37.560003 #64341]  INFO -- : Finished: host2\n=\u003e {\"host1\":{\"instance_type\":\"t2.micro\",\"instance_id\":\"i-xxxxxxxx\",\"vCPU\":\"1\",\"memory\":\"1 GiB\",\"price (USD/H)\":0.152,\"price (USD/M)\":11.3088},\"host2\":{\"instance_type\":\"c4.2xlarge\",\"instance_id\":\"i-yyyyyyyy\",\"vCPU\":\"8\",\"memory\":\"15 GiB\",\"price (USD/H)\":0.504,\"price (USD/M)\":374.976}}\n```\n\n## Requirement\n\n- Ruby(MRI) 2.3.0 or higher\n\n## Competitors\n\n- [Amazon Web Services Simple Monthly Calculator](https://calculator.s3.amazonaws.com/index.html)\n- [Amazon EC2 Instance Comparison](https://www.ec2instances.info/)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/kyoshidajp/ec2spec.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyoshidajp%2Fec2spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyoshidajp%2Fec2spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyoshidajp%2Fec2spec/lists"}