{"id":15699816,"url":"https://github.com/aliscott/aws-prices-graphql","last_synced_at":"2025-05-09T02:39:27.432Z","repository":{"id":42782855,"uuid":"274697424","full_name":"aliscott/aws-prices-graphql","owner":"aliscott","description":"AWS Price List GraphQL API","archived":false,"fork":false,"pushed_at":"2022-03-26T23:33:34.000Z","size":751,"stargazers_count":9,"open_issues_count":11,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T21:31:53.512Z","etag":null,"topics":["aws","cost-control","pricing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/aliscott.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}},"created_at":"2020-06-24T15:00:44.000Z","updated_at":"2024-04-21T18:56:03.000Z","dependencies_parsed_at":"2022-08-23T05:50:27.006Z","dependency_job_id":null,"html_url":"https://github.com/aliscott/aws-prices-graphql","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/aliscott%2Faws-prices-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliscott%2Faws-prices-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliscott%2Faws-prices-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliscott%2Faws-prices-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliscott","download_url":"https://codeload.github.com/aliscott/aws-prices-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253178912,"owners_count":21866630,"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","cost-control","pricing"],"created_at":"2024-10-03T19:41:49.182Z","updated_at":"2025-05-09T02:39:27.410Z","avatar_url":"https://github.com/aliscott.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-prices-graphql: AWS Price List GraphQL API\n\nAWS offers a [Bulk API](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/using-ppslong.html), which returns large JSON files containing all price points for each service or a [Query API](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/using-pelong.html), which requires AWS credentials and an IAM user.\n\nThis project creates a GraphQL API using the data from the AWS Price List Bulk API.\n\nThis project currently uses a generic GraphQL schema to represent all AWS products. Future work might move to using schemas for each distinct AWS product.\n\n## Table of Contents\n\n* [Example requests](#example-requests)\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n* [Usage](#usage)\n  * [Running](#running)\n* [Future work](#future-work)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Example requests\n\nGet all t3.micro prices in US East, this returns 30+ results. Try it yourself by pasting the query into [https://aws-prices-graphql.alistair.scot/graphql](https://aws-prices-graphql.alistair.scot/graphql). This is running on minimal infrastructure so is not guaranteed to always be available.\n\n```graphql\nquery {\n  products(\n    filter: {\n      attributes: [\n        { key: \"servicecode\", value: \"AmazonEC2\" },\n        { key: \"instanceType\", value: \"t3.micro\" },\n        { key: \"location\", value: \"US East (N. Virginia)\" }\n      ]\n    },\n  ) {\n    attributes { key, value }\n    onDemandPricing {\n      priceDimensions {\n        pricePerUnit {\n          USD\n        }\n      }\n    }\n  }\n}\n```\n\nGet the hourly on-demand price of a Linux EC2 t3.micro instance in US East:\n\nRequest:\n\n```graphql\nquery {\n  products(\n    filter: {\n      attributes: [\n        { key: \"servicecode\", value: \"AmazonEC2\" },\n        { key: \"instanceType\", value: \"t3.micro\" },\n        { key: \"location\", value: \"US East (N. Virginia)\" }\n        { key: \"tenancy\", value: \"Shared\" }\n        { key: \"operatingSystem\", value: \"Linux\"}\n        { key: \"capacitystatus\", value: \"Used\" }\n        { key: \"preInstalledSw\", value: \"NA\"}\n      ]\n    },\n  ) {\n    onDemandPricing {\n      priceDimensions {\n        pricePerUnit {\n          USD\n        }\n      }\n    }\n  }\n}\n```\n\nResponse:\n\n```json\n{\n  \"data\": {\n    \"products\": [\n      {\n        \"onDemandPricing\": [\n          {\n            \"priceDimensions\": [\n              {\n                \"pricePerUnit\": {\n                  \"USD\": \"0.0104000000\"\n                }\n              }\n            ]\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Getting started\n\n### Prerequisites\n\n * Node.js \u003e= 12.18.0\n * MongoDB \u003e= 3.6\n\n### Installation\n\n1. Clone the repo\n\n  ```sh\n  git clone https://github.com/aliscott/aws-prices-graphql.git\n  cd aws-prices-graphql\n  ```\n\n2. Add a `.env` file to point to your MongoDB server, e.g.\n\n  ```\n  MONGODB_URI=mongodb://localhost:27017/awsPricing\n  ```\n\n3. Install the npm packages\n\n  ```sh\n  npm install\n  ```\n\n4. Download the AWS pricing files into the `data` directory.\n   **Note: this downloads about 1.8 GB of data**\n\n  ```sh\n  npm run downloadPrices\n  ```\n\n5. Load the prices into MongoDB\n\n  ```sh\n  npm run loadPrices\n  ```\n\n## Usage\n\n### Running\n\n```\nnpm start\n```\n\nYou can now access the GraphQL Playground at [http://localhost:4000/graphql](http://localhost:4000/graphql).\n\n## Future work\n\n * Product-specific schemas - can we auto-generate these?\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliscott%2Faws-prices-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliscott%2Faws-prices-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliscott%2Faws-prices-graphql/lists"}