Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reserved_concurrent_executions for aws_lambda_function does not support 0 concurrency #3803

Closed
austinbyers opened this issue Mar 16, 2018 · 4 comments · Fixed by #3806
Closed
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@austinbyers
Copy link

austinbyers commented Mar 16, 2018

Actual Result

If reserved_concurrent_executions = 0 for an aws_lambda_function in Terraform, reserve concurrency is disabled:

screen shot 2018-03-15 at 6 09 58 pm

Expected Result

However, 0 is actually a valid value with a specific meaning, which you can see via the console:

screen shot 2018-03-15 at 6 10 07 pm

Why would you ever set reserved concurrency to 0? From the AWS documentation:

If you need a function to stop processing any invocations, you can choose to set the concurrency to 0 and throttle all incoming executions.

This is useful for long-running jobs (example: airbnb/binaryalert#46)

Requested Change

Provide a way to distinguish between disabled reserve concurrency and no reserve concurrency. Not sure the best approach here - maybe a negative value or an empty string disables it?

Versions

Terraform 0.11.3 with AWS provider 1.11.0

Affected Resource(s)

  • aws_lambda_function

Terraform Configuration Files

resource "aws_lambda_function" "function" {
  function_name = "${var.function_name}"
  runtime       = "python2.7"
  role          = "${aws_iam_role.role.arn}"
  handler       = "${var.handler}"
  s3_bucket     = "${var.source_bucket}"
  s3_key        = "${var.source_object_key}"

  // Should temporarily throttle all invocations
  reserved_concurrent_executions = 0
}
@Puneeth-n
Copy link
Contributor

Missed it when I implemented it. @austinbyers Thanks for raising the issue. :)

@Puneeth-n
Copy link
Contributor

I introduced -1 as a way of telling terraform to remove concurrency limit.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. labels Mar 16, 2018
@bflad bflad added this to the v2.0.0 milestone Feb 23, 2019
@bflad
Copy link
Contributor

bflad commented Feb 23, 2019

Hi everyone 👋Thank you for your patience with this one. Support for disabling Lambda Function invocations with setting reserved_concurrent_executions to 0 has been merged and will release with version 2.0.0 of the Terraform AWS Provider, likely in the next week or two.

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
3 participants