x-amazon-apigateway-integrations 객체 - Amazon API Gateway

x-amazon-apigateway-integrations 객체

통합의 모음을 정의합니다. OpenAPI 정의의 구성 요소 섹션에서 통합을 정의하고 여러 라우팅에서 통합을 다시 사용할 수 있습니다. HTTP API에서만 지원됩니다.

속성
속성 이름 유형 설명
통합 x-amazon-apigateway-integration 객체 통합 객체의 모음입니다.

x-amazon-apigateway-integrations 예제

다음 예제에서는 두 개의 통합을 정의하는 HTTP API를 생성하고, $ref": "#/components/x-amazon-apigateway-integrations/integration-name을 사용하여 통합을 참조합니다.

{ "openapi": "3.0.1", "info": { "title": "Integrations", "description": "An API that reuses integrations", "version": "1.0" }, "servers": [ { "url": "https://example.com/{basePath}", "description": "The production API server", "variables": { "basePath": { "default": "example/path" } } }], "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration1" } } }, "/pets": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration1" } } }, "/checkout": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration2" } } } }, "components": { "x-amazon-apigateway-integrations": { "integration1": { "type": "aws_proxy", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:my-function/invocations", "passthroughBehavior": "when_no_templates", "payloadFormatVersion": "1.0" }, "integration2": { "type": "aws_proxy", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:example-function/invocations", "passthroughBehavior": "when_no_templates", "payloadFormatVersion" : "1.0" } } } }