如何配置 AWS Lambda 事件源映射中的 “最大并发数” 用于 AWS SQS?

huangapple go评论64阅读模式
英文:

How to configure "Maximum concurrency" for AWS SQS in aws_lambda_event_source_mapping

问题

在Terraform中,如何设置aws_lambda_event_source_mapping的最大并发数,使用SQS?

英文:

In Terraform, how can I set the maximum concurrency for an aws_lambda_event_source_mapping using SQS?

答案1

得分: 3

Terraform支持名为scaling_config的配置块,位于aws_lambda_event_source_mapping内部,在此块中,您可以使用参数maximum_concurrency

resource "aws_lambda_event_source_mapping" "lambda_trigger" {
  event_source_arn  = "your arn"
  function_name     = "your lambda function arn"
  batch_size = 10
  scaling_config {
      maximum_concurrency = 50
  }
}
英文:

Terraform supports a configuration block named scaling_config from aws_lambda_event_source_mapping, inside this block you can use the argument maximum_concurrency

resource "aws_lambda_event_source_mapping" "lambda_trigger" {

  event_source_arn  = "your arn"
  function_name     = "your lambda function arn"
  batch_size = 10
  scaling_config {
      maximum_concurrency = 50
  }
}

答案2

得分: 0

最大并发是使用 aws_lambda_function 中的 reserved_concurrent_executions 来设置的,而不是在 aws_lambda_event_source_mapping 中设置。

英文:

Max. concurrency is set using reserved_concurrent_executions in aws_lambda_function, not in aws_lambda_event_source_mapping.

huangapple
  • 本文由 发表于 2023年6月16日 10:42:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486646.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定