{"id":13581867,"url":"https://github.com/LeanerCloud/ec2-instances-info","last_synced_at":"2025-04-06T10:33:06.927Z","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":"2024-11-01T10:38:02.000Z","size":113895,"stargazers_count":51,"open_issues_count":0,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T13:08:06.815Z","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}},"created_at":"2017-03-06T22:05:17.000Z","updated_at":"2025-03-21T19:33:36.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":[],"tags_count":0,"template":false,"template_full_name":null,"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","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470545,"owners_count":20944146,"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-instance","golang-library","prices","specs"],"created_at":"2024-08-01T15:02:17.289Z","updated_at":"2025-04-06T10:33:01.907Z","avatar_url":"https://github.com/LeanerCloud.png","language":"Go","funding_links":[],"categories":["Go"],"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 AWS resources such as EC2 instances, RDS databases, ElastiCache and OpenSearch clusters.\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### 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## 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 code.\n","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"}