{"id":16351354,"url":"https://github.com/knisterpeter/aws-api-gateway","last_synced_at":"2025-04-12T18:08:30.619Z","repository":{"id":137925384,"uuid":"186784060","full_name":"KnisterPeter/aws-api-gateway","owner":"KnisterPeter","description":"Instantly deploy REST APIs on AWS API Gateway using Serverless Components","archived":false,"fork":false,"pushed_at":"2019-05-17T12:22:39.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:06:57.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.serverless.com","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KnisterPeter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-05-15T08:33:13.000Z","updated_at":"2021-02-19T05:20:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7796ab0-fddb-4acc-8ee6-7e02f5d3c828","html_url":"https://github.com/KnisterPeter/aws-api-gateway","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/KnisterPeter%2Faws-api-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnisterPeter%2Faws-api-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnisterPeter%2Faws-api-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnisterPeter%2Faws-api-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnisterPeter","download_url":"https://codeload.github.com/KnisterPeter/aws-api-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610342,"owners_count":21132921,"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":[],"created_at":"2024-10-11T01:09:11.852Z","updated_at":"2025-04-12T18:08:30.599Z","avatar_url":"https://github.com/KnisterPeter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-api-gateway\n\nInstantly deploy REST APIs on AWS API Gateway with very simple configuration using [Serverless Components](https://github.com/serverless/components).\n\n\u0026nbsp;\n\n1. [Install](#1-install)\n2. [Create](#2-create)\n3. [Configure](#3-configure)\n4. [Deploy](#4-deploy)\n\n\u0026nbsp;\n\n\n### 1. Install\n\n```shell\n$ npm install -g @serverless/components\n```\n\n### 2. Create\n\nJust create a `serverless.yml` file\n\n```shell\n$ touch serverless.yml\n$ touch .env      # your development AWS api keys\n$ touch .env.prod # your production AWS api keys\n```\n\nthe `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.\n\n```\nAWS_ACCESS_KEY_ID=XXX\nAWS_SECRET_ACCESS_KEY=XXX\n```\n\n### 3. Configure\n\n```yml\n# serverless.yml\n\nname: my-api\n\nmyLambda:\n  component: \"@serverless/aws-lambda\"\n  inputs:\n    name: ${name}-lambda\n    code: ./code\n    handler: index.handler\n\nmyApiGateway:\n  component: \"@serverless/aws-api-gateway\"\n  inputs:\n    name: ${name}-gateway\n    routes:\n      /foo:\n        get:\n          function: ${comp:myLambda.arn} # pass in the arn output property from the lambda component\n          cors: true\n```\n\n### 4. Deploy\n\n```shell\napi (master)$ components\n\n  myLambda › outputs:\n  name:  'my-api-lambda'\n  description:  'AWS Lambda Component'\n  memory:  512\n  timeout:  10\n  code:  './code'\n  bucket:  undefined\n  shims:  []\n  handler:  'index.handler'\n  runtime:  'nodejs8.10'\n  env: \n  role: \n    name:  'my-api-lambda'\n    arn:  'arn:aws:iam::552760238299:role/my-api-lambda'\n    service:  'lambda.amazonaws.com'\n    policy:  { arn: 'arn:aws:iam::aws:policy/AdministratorAccess' }\n  arn:  'arn:aws:lambda:us-east-1:552760238299:function:my-api-lambda'\n\n  myApiGateway › outputs:\n  name:  'my-api-gateway'\n  role: \n    name:  'my-api-gateway'\n    arn:  'arn:aws:iam::552760238299:role/my-api-gateway'\n    service:  'apigateway.amazonaws.com'\n    policy:  { arn: 'arn:aws:iam::aws:policy/AdministratorAccess' }\n  routes: \n    /foo:  { get:\n   { function:\n      'arn:aws:lambda:us-east-1:552760238299:function:my-api-lambda',\n     cors: true } }\n  id:  'z2itxmsoud'\n  url:  'https://z2itxssoud.execute-api.us-east-1.amazonaws.com/dev/'\n  urls:  [ 'https://z2itxssoud.execute-api.us-east-1.amazonaws.com/dev/foo' ]\n\n\n  7s › dev › my-api › done\n\napi (master)$\n```\n\n\u0026nbsp;\n\n### New to Components?\n\nCheckout the [Serverless Components](https://github.com/serverless/components) repo for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknisterpeter%2Faws-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknisterpeter%2Faws-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknisterpeter%2Faws-api-gateway/lists"}