[英]How to remove tickmark Use Lambda Proxy integration on aws api
Iam using sam template for creating api+lambdas but i have an issue facing How to remove tickmark Use Lambda Proxy integration on using in sam template enter image description here aws api??????我正在使用 sam 模板创建 api+lambdas,但我遇到了一个问题如何删除标记使用 Lambda 在 sam 模板中使用代理集成在此处输入图像描述aws api???????
You cannot do that with SAM because it's limited and they have chosen to keep it light and minimal (per my experience arguing with them at Github over additional features).你不能用 SAM 做到这一点,因为它是有限的,而且他们选择保持它的轻量和最小化(根据我在 Github 与他们争论附加功能的经验)。 What you can do is to mix the SAM with cloudformation types:
您可以做的是将 SAM 与 cloudformation 类型混合使用:
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
ApiKeySourceType: HEADER
Description: An API Gateway with a Lambda Integration
EndpointConfiguration:
Types:
- EDGE
Name: lambda-api
ApiGatewayResource:
Type: AWS::ApiGateway::Resource
Properties:
ParentId: !GetAtt ApiGatewayRestApi.RootResourceId
PathPart: 'lambda'
RestApiId: !Ref ApiGatewayRestApi
ApiGatewayMethod:
Type: AWS::ApiGateway::Method
Properties:
ApiKeyRequired: false
AuthorizationType: NONE
HttpMethod: POST
Integration:
ConnectionType: INTERNET
Credentials: !GetAtt ApiGatewayIamRole.Arn
IntegrationHttpMethod: POST
PassthroughBehavior: WHEN_NO_MATCH
TimeoutInMillis: 29000
Type: AWS
Uri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFunction.Arn}/invocations'
OperationName: 'lambda'
ResourceId: !Ref ApiGatewayResource
RestApiId: !Ref ApiGatewayRestApi
Notice the integration type
is set to AWS
instead of AWS_PROXY
.请注意,
integration type
设置为AWS
而不是AWS_PROXY
。 For more information about CFT types checkout documentation .有关 CFT 类型检查文档的更多信息。 Also important to note is that without proxying, you may need to provide model and req/res templates.
同样需要注意的是,如果没有代理,您可能需要提供 model 和 req/res 模板。 Also SAM CLI local will not work with req/res templates.
此外,SAM CLI local 将无法与 req/res 模板一起使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.