{"id":13582802,"url":"https://github.com/amazon-archives/aws-apigateway-importer","last_synced_at":"2025-04-06T17:32:25.371Z","repository":{"id":35074864,"uuid":"39223917","full_name":"amazon-archives/aws-apigateway-importer","owner":"amazon-archives","description":"Tools to work with Amazon API Gateway, Swagger, and RAML","archived":true,"fork":false,"pushed_at":"2017-01-04T05:59:49.000Z","size":350,"stargazers_count":518,"open_issues_count":17,"forks_count":141,"subscribers_count":57,"default_branch":"master","last_synced_at":"2024-09-29T09:11:24.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"yankouskia/help-me","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-archives.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":"2015-07-16T22:41:20.000Z","updated_at":"2024-04-02T02:39:07.000Z","dependencies_parsed_at":"2022-08-08T04:16:18.823Z","dependency_job_id":null,"html_url":"https://github.com/amazon-archives/aws-apigateway-importer","commit_stats":null,"previous_names":["awslabs/aws-apigateway-importer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-apigateway-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-apigateway-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-apigateway-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-apigateway-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-archives","download_url":"https://codeload.github.com/amazon-archives/aws-apigateway-importer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522655,"owners_count":20952594,"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-08-01T15:03:02.373Z","updated_at":"2025-04-06T17:32:20.363Z","avatar_url":"https://github.com/amazon-archives.png","language":"Java","funding_links":[],"categories":["Java","API网关"],"sub_categories":["Spring Cloud框架"],"readme":"# Amazon API Gateway Importer\n\nThe **Amazon API Gateway Importer** lets you create or update [Amazon API Gateway][service-page] APIs from a Swagger or RAML API representation.\n\nTo learn more about API Gateway, please see the [service documentation][service-docs] or the [API documentation][api-docs].\n\n[service-page]: http://aws.amazon.com/api-gateway/\n[service-docs]: http://docs.aws.amazon.com/apigateway/latest/developerguide/\n[api-docs]: http://docs.aws.amazon.com/apigateway/api-reference\n\n[![Build Status](https://api.travis-ci.org/awslabs/aws-apigateway-importer.svg?branch=master)](https://travis-ci.org/awslabs/aws-apigateway-importer)\n\n#### Updates\n\nApril 5, 2016: Swagger/OpenAPI import is now generally available in the API Gateway [REST API][api], the AWS [CLI][cli] and all AWS [SDKs][sdks]. You can also import and export Swagger definitions using the API Gateway [console][console]. This release addresses many of the open issues and feedback in this repository.\n\nCustomers are encouraged to migrate their workflow to the standard AWS tools. aws-apigateway-importer will receive minimal support from the API Gateway team going forward. Pull requests will be periodically reviewed. Customers using RAML definitions should continue to use aws-apigateway-importer for the time being.\n\nThanks for all of your feedback and contributions to this tool. Any feedback or issues going forward should be directed to the official API Gateway [forums][forums]. - @rpgreen\n\n[sdks]: https://aws.amazon.com/tools\n[cli]: http://docs.aws.amazon.com/cli/latest/reference/apigateway/put-rest-api.html\n[forums]: https://forums.aws.amazon.com/forum.jspa?forumID=199\n[api]: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html\n[console]: https://console.aws.amazon.com/apigateway/home\n\n## Usage\n\n### Prerequisites\n\n#### Credentials\nThis tool requires AWS credentials to be configured in at least one of the locations specified by the [default credential provider chain](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html).\n\nIt will look for configured credentials in environment variables, Java system properties, [AWS SDK/CLI](http://aws.amazon.com/cli) profile credentials, and EC2 instance profile credentials.\n\n#### Build\n\nBuild with `mvn assembly:assembly`\n\n### Import a new API\n\n```sh\n./aws-api-import.sh --create path/to/swagger.json\n\n./aws-api-import.sh -c path/to/api.raml\n```\n\n### Update an existing API and deploy it to a stage\n\n```sh\n./aws-api-import.sh --update API_ID --deploy STAGE_NAME path/to/swagger.yaml\n\n./aws-api-import.sh --update API_ID --deploy STAGE_NAME --raml-config path/to/config.json path/to/api.raml\n```\n\nFor Windows environments replace `./aws-api-import.sh` with `./aws-api-import.cmd` in the examples.\n\n### API Gateway Extension Example\n\nYou can fully define an API Gateway API in Swagger using the `x-amazon-apigateway-auth` and `x-amazon-apigateway-integration` extensions,\nor in RAML using an external configuration file.\n\nDefined on an Operation:\n\n```json\n\n\"x-amazon-apigateway-auth\" : {\n    \"type\" : \"aws_iam\"\n},\n\"x-amazon-apigateway-integration\" : {\n   \"type\" : \"aws\",\n   \"uri\" : \"arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:MY_ACCT_ID:function:helloWorld/invocations\",\n   \"httpMethod\" : \"POST\",\n   \"credentials\" : \"arn:aws:iam::MY_ACCT_ID:role/lambda_exec_role\",\n   \"requestTemplates\" : {\n       \"application/json\" : \"json request template 2\",\n       \"application/xml\" : \"xml request template 2\"\n   },\n   \"requestParameters\" : {\n       \"integration.request.path.integrationPathParam\" : \"method.request.querystring.latitude\",\n       \"integration.request.querystring.integrationQueryParam\" : \"method.request.querystring.longitude\"\n   },\n   \"cacheNamespace\" : \"cache-namespace\",\n   \"cacheKeyParameters\" : [],\n   \"responses\" : {\n       \"2\\\\d{2}\" : {\n           \"statusCode\" : \"200\",\n           \"responseParameters\" : {\n               \"method.response.header.test-method-response-header\" : \"integration.response.header.integrationResponseHeaderParam1\"\n           },\n           \"responseTemplates\" : {\n               \"application/json\" : \"json 200 response template\",\n               \"application/xml\" : \"xml 200 response template\"\n           }\n       },\n       \"default\" : {\n           \"statusCode\" : \"400\",\n           \"responseParameters\" : {\n               \"method.response.header.test-method-response-header\" : \"'static value'\"\n           },\n           \"responseTemplates\" : {\n               \"application/json\" : \"json 400 response template\",\n               \"application/xml\" : \"xml 400 response template\"\n           }\n       }\n   }\n}\n```\n\n## Testing\n\n```sh\nmvn test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-apigateway-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-archives%2Faws-apigateway-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-apigateway-importer/lists"}