小编0pt*_*mus的帖子

如何使用aws中的cloudformation请求api网关中的参数并将其传递给lambda函数?

我尝试在 AWS CloudFormation 中使用 API Gateway 请求参数。我想要从 API 网关传递到 Lambda 函数的参数是“action”。我已经尝试了以下代码,到目前为止我遇到了错误,如下所述。有人可以帮助我确定问题和可能的解决方案吗?

“指定的映射表达式无效:验证结果:警告:[],错误:[指定的映射表达式无效:Integration.request.path.action](服务:AmazonApiGateway;状态代码:400;错误代码:BadRequestException;请求 ID:037f4753- 52b5-4276-979a-131a0f903e63)"

AWSTemplateFormatVersion: "2010-09-09"
Description: "API Gateway and Lambda function"

Resources:
  SampleApi:
    Type: "AWS::ApiGateway::RestApi"
    Properties:
      Name: Sample

  SampleApiMethod:
    Type: "AWS::ApiGateway::Method"
    Properties:
      AuthorizationType: "NONE"
      HttpMethod: "GET"
      RequestParameters:
        method.request.path.action: true
      RequestTemplates:
        application/yaml
      Integration:
        IntegrationHttpMethod: "POST"
        Type: "AWS_PROXY"
        RequestParameters:
          Integration.request.path.action: method.request.path.action 
        Uri: !Sub
          - "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${lambdaArn}/invocations"
          - lambdaArn: !GetAtt "SampleLambda.Arn"
        CacheKeyParameters:
          - method.request.path.action
      ResourceId: !GetAtt "SampleApi.RootResourceId"
      RestApiId: !Ref "SampleApi"

  SampleApiDeployment:
    Type: "AWS::ApiGateway::Deployment"
    DependsOn: "SampleApiMethod"
    Properties:
      RestApiId: !Ref "SampleApi"
      StageName: test

  SampleLambda:
    Type: …
Run Code Online (Sandbox Code Playgroud)

yaml amazon-web-services aws-cloudformation aws-lambda

5
推荐指数
1
解决办法
1万
查看次数

如何在DOS下打印彩色字符串?

我想以不同于通常的白色文本颜色的颜色打印下面的数据块集,这可以通过使用另一个 DOS 中断(dx:string-address; ah,08H; int 21h)来实现。

Jan             db  "         January$          "     
string          db  "Sun Mon Tue Wed Thu Fri Sat$"
string1         db  "                 1   2   3$"
string2         db  " 4   5   6   7   8   9  10$"
string3         db  "11  12  13  14  15  16  17$"
string4         db  "18  19  20  21  22  23  24$"
string5         db  "25  26  27  28  29  30  31$"
Run Code Online (Sandbox Code Playgroud)

assembly dos masm tasm x86-16

-2
推荐指数
1
解决办法
2万
查看次数