简体   繁体   English

如何在 cloudformation 堆栈中为 lambda 配置 asynconfig?

[英]how to configure asynconfig for lambda in cloudformation stack?

I created a cloud formation stack as below, I'm setting MaximumRetryAttempts: 1, but once the function is created the retry events is always set to 2 ( attached screenshot).我创建了一个云形成堆栈,如下所示,我设置了 MaximumRetryAttempts: 1,但是一旦创建了 function,重试事件总是设置为 2(附上的屏幕截图)。 how can i change the value of this.我怎样才能改变这个的价值。

HelloWorldLambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: hello-world
      Runtime: python3.7
      Handler: index.lambda_handler
   version:
     Type: AWS::Lambda::Version
     Properties:
       FunctionName: !Ref HelloWorldLambdaFunction
   asynconfig:
     Type: AWS::Lambda::EventInvokeConfig
     Properties:
       FunctionName: !Ref HelloWorldLambdaFunction
       MaximumRetryAttempts: 1
       Qualifier: !GetAtt version.Version
      

在此处输入图像描述

The code looks fine.代码看起来不错。 However, it seems to me that you are viewing $LATEST version in the console.但是,在我看来,您正在控制台中查看$LATEST版本。

However, you set the asynconfig for version 1 .但是,您为版本 1设置了asynconfig Thus, in the console you have to explicitly select the correct lambda function version:因此,在控制台中,您必须明确 select正确的 lambda function 版本:

在此处输入图像描述

Update更新

To use latest version:要使用最新版本:

  asynconfig:
    Type: AWS::Lambda::EventInvokeConfig
    Properties:
      FunctionName: !Ref HelloWorldLambdaFunction
      MaximumRetryAttempts: 1
      Qualifier: $LATEST

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不删除 CloudFormation Stack 的情况下恢复 python lambda - How to restore python lambda without any deletion of CloudFormation Stack 如何使用 lambda 删除和重新创建 CDK 堆栈 (Cloudformation)? - How can I delete and recreate a CDK Stack (Cloudformation) using a lambda? CDK/Cloudformation - 由于手动删除了 Lambda 版本,无法部署堆栈 - CDK/Cloudformation - Unable to deploy stack because of Lambda Version deleted manually 如何在 cloudformation 脚本中的 2 个依赖实例中配置 2 个文件? - How to configure 2 files in 2 dependent instances in cloudformation script? Cloudformation如何将现有资源导入Stack? - Cloudformation how to import existing resources into Stack? 如何在另一个堆栈参数中导入 cloudformation 堆栈 output? - How to import cloudformation stack output inside another stack parameter? 使用 SAM 或 Cloudformation 将一个堆栈的输出用作其他堆栈中 lambda 的环境变量 - Use output of one stack as environment variable for lambda in other stack with SAM or Cloudformation 如何配置 AWS CloudFormation 模板以运行 Fargate 容器? - How to property configure AWS CloudFormation template to run containers of Fargate? 如何为使用 CloudFormation 模板创建的 AWS Lambda function 添加触发器? - How to add triggers for a AWS Lambda function created using a CloudFormation template? 创建lambda时如何获取cloudformation创建的角色 - How to get at the role created by cloudformation when creating a lambda
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM