简体   繁体   English

如何删除刻度线 使用 Lambda AWS 上的代理集成 api

[英]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.

相关问题 API 网关 HTTP 与 aws-sam 的代理集成(不是 Lambda 代理) - API Gateway HTTP Proxy integration with aws-sam (NOT Lambda Proxy) AWS API Gateway Lambda 集成(非代理)- 如何发送自定义标头和二进制数据 - AWS API Gateway Lambda Integration (NOT Proxy) - How to Send Custom Headers and Binary Data AWS Api Gateway Lambda代理集成,如何从客户端请求中获取源端口 - AWS Api Gateway Lambda proxy integration, how to get source port from client request 如何使用 aws lambda + Puppeteer 的代理服务器? - How to use proxy servers with aws lambda + Puppeteer? AWS API 网关:如何删除/替换 HTTP 代理直通集成中的查询字符串参数? - AWS API Gateway: How to remove/replace query string parameter in HTTP Proxy Passthrough integration? 如何通过代理集成从 AWS API 网关提供二进制数据? - How to serve binary data from AWS API Gateway with proxy integration? Terraform:如何在 GET - 集成请求中选中使用 Terraform 选中的“使用 Lambda 代理集成”复选框 - Terraform: How to check the "Use Lambda Proxy integration" check box selected with Terraform in GET - Integration Request AWS Lambda 和 API 网关 NodeJs 的格式错误的 Lambda 代理响应 - Malformed Lambda proxy response with AWS Lambda and API Gateway NodeJs 使用 AWS 网关 API 代理从 Python AWS Lambda 重定向 - Redirect from a Python AWS Lambda with AWS Gateway API Proxy CORS 错误,API 网关和 Lambda **仅**使用代理集成时 - CORS error with API Gateway and Lambda **only** when using Proxy Integration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM