{"id":22770360,"url":"https://github.com/leanercloud/ec2-instances-info","last_synced_at":"2026-03-07T19:33:43.491Z","repository":{"id":18372313,"uuid":"84125722","full_name":"LeanerCloud/ec2-instances-info","owner":"LeanerCloud","description":"Golang library for specs and pricing information about AWS EC2 instances based on the data from www.ec2instances.info","archived":false,"fork":false,"pushed_at":"2025-05-28T09:13:39.000Z","size":112131,"stargazers_count":53,"open_issues_count":0,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-17T22:47:29.961Z","etag":null,"topics":["aws","ec2-instance","golang-library","prices","specs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeanerCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-06T22:05:17.000Z","updated_at":"2025-06-10T08:14:56.000Z","dependencies_parsed_at":"2024-12-11T15:37:50.435Z","dependency_job_id":"b004725e-222c-421c-8543-babcd8b5ec4b","html_url":"https://github.com/LeanerCloud/ec2-instances-info","commit_stats":null,"previous_names":["cristim/ec2-instances-info"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeanerCloud/ec2-instances-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fec2-instances-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fec2-instances-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fec2-instances-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fec2-instances-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeanerCloud","download_url":"https://codeload.github.com/LeanerCloud/ec2-instances-info/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fec2-instances-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274488483,"owners_count":25294739,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-instance","golang-library","prices","specs"],"created_at":"2024-12-11T15:31:09.982Z","updated_at":"2025-10-28T01:33:32.627Z","avatar_url":"https://github.com/LeanerCloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ec2-instances-info\n\n![Build Status](https://github.com/LeanerCloud/ec2-instances-info/workflows/Test/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/LeanerCloud/ec2-instances-info)](https://goreportcard.com/report/github.com/LeanerCloud/ec2-instances-info)\n[![GoDoc](https://godoc.org/github.com/LeanerCloud/ec2-instances-info?status.svg)](http://godoc.org/github.com/LeanerCloud/ec2-instances-info)\n\nGolang library providing specs and pricing information about cloud resources such as:\n\n- AWS EC2 instances\n- AWS RDS databases\n- AWS ElastiCache clusters\n- AWS OpenSearch clusters\n- Azure VM instances\n\nIt is based on the data that is also powering the comprehensive\n[www.ec2instances.info](http://www.ec2instances.info) instance comparison\nwebsite, but made easier to consume from Go software.\n\nThis code is offered under the public domain/unlicense, but we also offer an API that automates data updates, available for a monthly subscription that helps support ongoing development of this library.\n\nReach out to us on [Slack](https://join.slack.com/t/leanercloud/shared_invite/zt-xodcoi9j-1IcxNozXx1OW0gh_N08sjg) if you're interested in API access.\n\n## History\n\nThis used to be a part of my other project\n[AutoSpotting](https://github.com/LeanerCloud/autospotting) which uses it\nintensively, but I decided to extract it into a dedicated project since it may be\nuseful to someone else out there.\n\nSome data fields that were not needed in AutoSpotting may not yet be exposed but\nthey can be added upon demand.\n\n## Installation or update\n\nYou will need Go 1.16 or latest, then it's a matter of installing it as usual using `go get`\n\n```text\ngo get -u github.com/LeanerCloud/ec2-instances-info/...\n```\n\n## Usage\n\n### AWS EC2 Usage\n\n#### One-off usage, with static data\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\ndata, err := ec2instancesinfo.Data() // only needed once\n\n// This would print all the available instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Instance type\", i.InstanceType)\n}\n```\n\nSee the examples directory for a working code example.\n\n#### One-off usage, with updated instance type data\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\nkey := \"API_KEY\" // API keys are available upon demand from contact@leanercloud.com, free of charge for personal use\n\nerr:= ec2instancesinfo.UpdateData(nil, \u0026key);\nif err!= nil{\n   fmt.Println(\"Couldn't update instance type data, reverting to static compile-time data\", err.Error())\n}\n\ndata, err := ec2instancesinfo.Data() // needs to be called once after data updates\n\n// This would print all the available instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Instance type\", i.InstanceType)\n}\n```\n\n#### Continuous usage, with instance type data updated every 2 days\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\nkey := \"API_KEY\"\ngo ec2instancesinfo.Updater(2, nil, \u0026key); // use 0 or negative values for weekly updates\n\ndata, err := ec2instancesinfo.Data() // only needed once\n\n// This would print all the available instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Instance type\", i.InstanceType)\n}\n```\n\n### Azure VM Usage\n\n#### Basic usage, with static data\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\ndata, err := ec2instancesinfo.AzureData() // only needed once\n\n// This would print all the available Azure VM instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Azure VM instance type:\", i.InstanceType)\n}\n```\n\n#### One-off usage, with updated Azure VM data\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\nkey := \"API_KEY\" // API keys are available upon demand from contact@leanercloud.com\n\nerr := ec2instancesinfo.UpdateAzureData(nil, \u0026key)\nif err != nil {\n   fmt.Println(\"Couldn't update Azure VM data, reverting to static compile-time data\", err.Error())\n}\n\ndata, err := ec2instancesinfo.AzureData() // needs to be called once after data updates\n\n// This would print all the available Azure VM instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Azure VM instance type:\", i.InstanceType)\n}\n```\n\n#### Continuous usage, with Azure VM data updated every 2 days\n\n```golang\nimport \"github.com/LeanerCloud/ec2-instances-info\"\n\nkey := \"API_KEY\"\ngo ec2instancesinfo.AzureUpdater(2, nil, \u0026key); // use 0 or negative values for weekly updates\n\ndata, err := ec2instancesinfo.AzureData() // only needed once\n\n// This would print all the available Azure VM instance type names:\nfor _, i := range *data {\n  fmt.Println(\"Azure VM instance type:\", i.InstanceType)\n}\n```\n\n## Contributing\n\nPull requests and feedback are welcome.\n\nThe data can be updated for new instance type coverage by running `make`.\n\n## Try it out on GCP Cloud Shell\n\n- [![Open in Cloud Shell](http://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/LeanerCloud/ec2-instances-info.git)\n\n- Click on the `Terminal` then `New Terminal` in the top menu\n- In the terminal run `cd ~/cloudshell_open/ec2-instances-info/examples/instances/`\n- `go run .` will run the example EC2 code.\n- For Azure VM data: `cd ~/cloudshell_open/ec2-instances-info/examples/azure/` and `go run .`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Fec2-instances-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanercloud%2Fec2-instances-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Fec2-instances-info/lists"}