Skip to content
New issue

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

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

Already on GitHub? # to your account

Lambda Provisioned Concurrency bug and caveat #11152

Closed
Tirke opened this issue Dec 5, 2019 · 20 comments · Fixed by #31933
Closed

Lambda Provisioned Concurrency bug and caveat #11152

Tirke opened this issue Dec 5, 2019 · 20 comments · Fixed by #31933
Assignees
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@Tirke
Copy link

Tirke commented Dec 5, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.16

Affected Resource(s)

  • aws_lambda_provisioned_concurrency_config

Terraform Configuration Files

resource "aws_lambda_provisioned_concurrency_config" "keep-lambda-warm" {
  count                             = var.CAN_CALL_FROM_API_GATEWAY ? 1: 0
  function_name                     = aws_lambda_alias.lambda-alias.arn
  provisioned_concurrent_executions = 1
  qualifier                         = aws_lambda_alias.lambda-alias.name
}

Actual Behavior

I have found two problems with aws_lambda_provisioned_concurrency_config.

Problem 1

When using a lambda arn for the function_name property (it is documented as possible) terraform will fail with this error

Error: error getting Lambda Provisioned Concurrency Config (arn:aws:lambda:eu-west-1:787685363335:function:thom-test:latest:latest): ValidationException: 1 validation error detected: Value 'aws:lambda:eu-west-1:<account-id>:function:thom-test:latest:latest' at 'qualifier' failed to satisfy constraint: Member must satisfy regular expression pattern: (|[a-zA-Z0-9$_-]+)
        status code: 400, request id: c6bb9980-4fb6-494e-8387-3df5f995b001

  on ../lambda/warm.tf line 1, in resource "aws_lambda_provisioned_concurrency_config" "keep-lambda-warm":
   1: resource "aws_lambda_provisioned_concurrency_config" "keep-lambda-warm" {

If you use lambda function_name it works as expected.

Problem 2

Provisioning provisioned_concurrent_executions takes a very very long time (more than 3 minutes) to deploy because I think Terraform is waiting for all provisioned concurrency checks to be ok. I think the problem gets worse the more you add provisioned_concurrent_executions.

Expected Behavior

Problem 1

Should be possible to use arn for function_name property as documented.

Problem 2

Should add a flag to skip waiting for all provisioned_concurrent_executions.

Steps to Reproduce

  1. terraform apply
@ghost ghost added the service/lambda Issues and PRs that pertain to the lambda service. label Dec 5, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 5, 2019
@ericksoen
Copy link
Contributor

ericksoen commented Jan 17, 2020

I have some ideas about how I might go about fixing the first problem. I'll see if I can submit a PR in the next few days. To add some additional flavor to the original bug report, the lambda put-provisioned-concurrency docs support the following values for the function name parameter:

  • Function name, e.g., my-function
  • Function ARN, e.g., arn:aws:lambda:us-west-2:123456789012:function:my-function
  • Partial ARN, e.g., 123456789012:function:my-function

The resource is persisted into state via the following invocation:

d.SetId(fmt.Sprintf("%s:%s", functionName, qualifier))

The func that parses the id from the state file uses the following code:

func resourceAwsLambdaProvisionedConcurrencyConfigParseId(id string) (string, string, error) {
	parts := strings.SplitN(id, ":", 2)

	if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
		return "", "", fmt.Errorf("unexpected format of ID (%s), expected FUNCTION_NAME:QUALIFIER", id)
	}

	return parts[0], parts[1], nil
}

For each of the valid function name values noted in the API documentation, the function name, qualifier arn that this method returns are as follows:

Input Function Name Input Qualifier Output Function Name Output Qualifier
my-function test my-function test
arn:aws:lambda:us-west-2:123456789012:function:my-function test arn aws:lambda:us-west-2:123456789012:function:my-function:test
123456789012:function:my-function test 123456789012 function:my-function:test

In the case of the two latter items in the table, the qualifier must match the pattern "(|[a-zA-Z0-9$_-]+)", which the presence of the ":" character does not satisfy.

@mulumudig
Copy link

We have simillar problem while using the alias name as documented in terraform here. The provisioned concurrency settings are applied, but TF doesn't move on further on any further updates with the following error (details are modified for security reasons)

TF Version: Terraform v0.11.14
Provider Version: provider.aws v2.50.0

Error: Error refreshing state: 1 error occurred:
* module.dev.module.myfunction.aws_lambda_provisioned_concurrency_config.provisionedConcurrency: 1 error occurred:
* module.dev.module.myfunction.aws_lambda_provisioned_concurrency_config.provisionedConcurrency: aws_lambda_provisioned_concurrency_config.provisionedConcurrency: error getting Lambda Provisioned Concurrency Config (arn:aws:lambda:us-east-1:123456789:myfunction:myfunction:function_Alias): ValidationException: 1 validation error detected: Value 'aws:lambda:us-east-1:123456789:myfunction:myfunction:myfunction_Alias' at 'qualifier' failed to satisfy constraint: Member must satisfy regular expression pattern: (|[a-zA-Z0-9$_-]+)
status code: 400, request id: c66720c9-c5cb-4bd9-b24c-133e0b7a5f34

@ericksoen
Copy link
Contributor

Unfortunately, that's the issue you'll receive on state refresh until the issue is closed (there's an associated PR open to resolve it). Essentially, it's splitting the resource id on the colon character into the function argument and qualifier argument. Since an ARN has multiple colons in it, it ends up looking something like arn (function name) and lambda:us-east-1:123456789:myfunction:myfunction:myfunction_Alias as the qualifier, which fails the regular expression validation noted in your error message.

If you need a short-term workaround, remove the resource from your state file and re-create using the function name (via the aws_lambda_function resource since the aws_lambda_alias.function_name is actually an ARN).

@mulumudig
Copy link

Am having the same error, even when using the alias name instead of the ARN as suggested. Here is the information from my state file which depicts the same.

"aws_lambda_provisioned_concurrency_config.provisionedConcurrency": {
"type": "aws_lambda_provisioned_concurrency_config",
"depends_on": [
"local.aliasName",
"local.alias_funcName"
],
"primary": {
"id": "arn:aws:lambda:us-east-1:123456789:function:myfunction:myfunction_Alias",
"attributes": {
"function_name": "arn:aws:lambda:us-east-1:123456789:function:myfunction",
"id": "arn:aws:lambda:us-east-1:123456789:function:myfunction:myfunction_Alias",
"provisioned_concurrent_executions": "1",
"qualifier": "myfunction_Alias"
},
"meta": {
"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": {
"create": 900000000000,
"update": 900000000000
}
},
"tainted": false
},
"deposed": [],
"provider": "provider.aws"
}

Also, the information/error is deceiving - since my qualifier from statefile doesn't have any : in it, but the error says it is

Error: Error refreshing state: 1 error occurred:
* module.dev.module.retrieveCase_lambda.aws_lambda_provisioned_concurrency_config.provisionedConcurrency: 1 error occurred:
* module.dev.module.retrieveCase_lambda.aws_lambda_provisioned_concurrency_config.provisionedConcurrency: aws_lambda_provisioned_concurrency_config.provisionedConcurrency: error getting Lambda Provisioned Concurrency Config (arn:aws:lambda:us-east-1:486031490454:function:myfunction:myfunction_Alias): ValidationException: 1 validation error detected: Value 'aws:lambda:us-east-1:123456789:function:myfunction:myfunction_Alias' at 'qualifier' failed to satisfy constraint: Member must satisfy regular expression pattern: (|[a-zA-Z0-9$_-]+)
status code: 400, request id: da7d069a-3006-4cb1-acda-dec208bedb73

Let me know if am doing this wrong

@ericksoen
Copy link
Contributor

@Gopinath1986 Can you share the original Terraform code used to generate that state file?

We tend to see this issue when then primary.id value has more than one colon in it, e.g., arn:aws:lambda:us-east-1:123456789:function:myfunction:myfunction_Alias since it gets split into exactly two chunks: arn and aws:lambda:us-east-1:123456789:function:myfunction:myfunction_Alias. That second value is what gets evaluated as the qualifier and does not satisfy the regular expression.

As one potential cause, the aws_lambda_function.name returns a text string with no colons while the aws_lambda_alias.function_name returns an ARN with colons. Sharing you original Terraform code should definitely help us understand how to resolve this issue in the short term?

@mulumudig
Copy link

@ericksoen : here is the piece of code that am using. Hope this helps.

resource "aws_lambda_function" "function" {
count = "${var.create_lambda}"
function_name = "${var.lambda_func_name}"
role = "${var.iam_for_lambda_arn}"
handler = "${var.lambda_func_handler}"
filename = "${var.lambda_payload_filename}"
source_code_hash = "${base64sha256(file(var.lambda_payload_filename))}"
runtime = "${var.lambda_runtime}"
timeout = "${var.lambda_timeout}"
memory_size = "${var.lambda_memory}"
reserved_concurrent_executions = "${var.lambda_concurrency}"

vpc_config {
subnet_ids = "${var.subnets}"
security_group_ids = ["${var.security_groups}"]
}

tags = "${var.tags}"
lifecycle {
ignore_changes = ["source_code_hash","filename","last_modified","s3_key","environment","layers","version","qualified_arn"]
}
layers = ["${var.layers}"]
}
locals {
env = "${element(split("", element(concat(aws_lambda_function.function.*.function_name, list("")), 0)), 1)}"
trimmedFuncName = "${element(split("
", element(concat(aws_lambda_function.function..function_name, list("")), 0)), 2)}"
region = "${element(split(":",element(concat(aws_lambda_function.function.
.arn, list("")), 0)),3)}"
account_id = "${element(split(":",element(concat(aws_lambda_function.function..arn, list("")), 0)),4)}"
fullFuncName = "${element(concat(aws_lambda_function.function.
.function_name, list("")), 0)}"
arn = "${element(concat(aws_lambda_function.function..arn, list("")), 0)}"
version = "${element(concat(aws_lambda_function.function.
.version, list("")), 0)}"
alias_funcName = "${element(concat(aws_lambda_alias.alias.*.function_name, list("")), 0)}"
aliasName = "${local.fullFuncName}_Alias"
}
resource "aws_lambda_alias" "alias" {
count = "${var.lambda_func_name == "myfunction" ? 1 : 0}"
name = "${var.lambda_func_name}_Alias"
function_name = "${local.arn}"
function_version = "${local.version}"
}
resource "aws_lambda_provisioned_concurrency_config" "provisionedConcurrency" {
count = "${var.lambda_func_name == "myfunction" ? 1 : 0}"
function_name = "${local.fullFuncName}"
provisioned_concurrent_executions = 1
qualifier = "${local.aliasName}"
}

@ericksoen
Copy link
Contributor

From what I can tell, this local.fullFuncName ("${element(concat(aws_lambda_function.function..function_name, list("")), 0)}") should evaluate to a valid name.

One of the issues you may still be encountering is that you have an invalid resource id in your state file and state refreshes happen before evaluating changes. Are you in a position to remove the aws_lambda_provisioned_concurrency_config.provisionedConcurrency from your state file and then try re-applying?

If that still fails, is it possible to pass var.lambda_func_name directly as the function_name arg in aws_lambda_provisioned_concurrency (may help cut down on some of the misdirection)

@mulumudig
Copy link

mulumudig commented Mar 4, 2020

@ericksoen : Thanks for all your time on this. As suggested, we have removed the current state from the file and re-ran the same scripts (no modifications) and it went through and the subsequent run as well didn't result in error. Am pasting the output from TF, for reference. this output also proves that the Suggestion 2 is already in place and the only workaround is to remove the state and re-run the scripts (let me know if am wrong).

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

  • module.dev.module.retrieveCase_lambda.aws_lambda_provisioned_concurrency_config.provisionedConcurrency
    id:
    function_name: "myfunction"
    provisioned_concurrent_executions: "1"
    qualifier: "myfunction_Alias"

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

@angelarosario
Copy link

Should we at least update the Example usage in the documentation in the mean time so that others won't get this error?

@edeesis
Copy link

edeesis commented Apr 8, 2021

What can be done to get some movement on this issue? It's been open for over a year, has a PR (with tests) against it that hasn't been merged.

In the mean time this is the workaround we've used to avoid this:

resource "aws_lambda_provisioned_concurrency_config" "lambda_concurrency" {
  function_name                     = aws_lambda_function.lambda.function_name # this is the important bit, use the lambda name instead of the alias
  provisioned_concurrent_executions = var.provisioned_concurrency
  qualifier                         = aws_lambda_alias.lambda_alias.name
}

@mulumudig
Copy link

@edeesis : we have upgraded our TF version to 0.12.29 and the provider version to 3.0 and above and are not seeing this issue.

@edeesis
Copy link

edeesis commented Apr 9, 2021

@edeesis : we have upgraded our TF version to 0.12.29 and the provider version to 3.0 and above and are not seeing this issue.

I'm still experiencing a form of this error (it just says "ValidationException" no detail in the output) with AWS Provider 3.0 and Terraform version v0.14.7

This is the terraform that seemingly causes the error:

resource "aws_lambda_alias" "alias" {
  name             = "live"
  description      = "a sample description"
  function_name    = aws_lambda_function.lambda.arn
  function_version = aws_lambda_function.lambda.version
}


resource "aws_lambda_provisioned_concurrency_config" "example" {
  function_name                     = aws_lambda_alias.alias.function_name
  provisioned_concurrent_executions = 1
  qualifier                         = aws_lambda_alias.alias.name
}

It successfully applies, but fails on creating future plans.

@mulumudig
Copy link

The function_name in the alias definition should be the lambda function name and not the arn. Give it a try

function_name = aws_lambda_function.lambda.arn ==> function_name = aws_lambda_function.lambda.function_name

@edeesis
Copy link

edeesis commented Apr 9, 2021

The function_name in the alias definition should be the lambda function name and not the arn. Give it a try

function_name = aws_lambda_function.lambda.arn ==> function_name = aws_lambda_function.lambda.function_name

The function_name in the alias definition should be the lambda function name and not the arn. Give it a try

function_name = aws_lambda_function.lambda.arn ==> function_name = aws_lambda_function.lambda.function_name

Yeah, that's exactly what I suggested in this comment: #11152 (comment)

But the fact of the matter is both the AWS docs here: https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html

And the terraform docs here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_provisioned_concurrency_config

Both permit using an arn, so like angelarosario suggested, the docs should be updated or this PR merged.

@arq-kimong
Copy link

I have experienced another problem when using function version method is that somehow Terraform thinks that the function has new published version even though it hasn't and subsequently triggers replacement of lambda provisioned concurrency config. What makes it worse is that the replacement actually attempts to create then destroy - explicitly adding lifecycle create_before_destroy = false didn't help. Given that the provisioned concurrency doesn't actually have a unique identifier, the replacement actually resulted in destroying the config entirely.

here's the terraform output of my apply stage to show the sequence of create and destroy:

module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_function.this: Modifying... [id=clp-api-dev-getPaymentMethods]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_function.this: Modifying... [id=clp-api-dev-savePaymentMethod]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_function.this: Modifying... [id=clp-api-dev-addRefund]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_function.this: Modifying... [id=clp-api-dev-addTransaction]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_function.this: Modifications complete after 6s [id=clp-api-dev-savePaymentMethod]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Creating...
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_function.this: Modifications complete after 6s [id=clp-api-dev-addRefund]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Creating...
module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_function.this: Modifications complete after 6s [id=clp-api-dev-getPaymentMethods]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_provisioned_concurrency_config.this[0]: Creating...
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_function.this: Modifications complete after 6s [id=clp-api-dev-addTransaction]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_provisioned_concurrency_config.this[0]: Creating...
module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_provisioned_concurrency_config.this[0]: Creation complete after 5s [id=clp-api-dev-getPaymentMethods:35]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_provisioned_concurrency_config.this[0]: Destroying... [id=clp-api-dev-getPaymentMethods:35]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_provisioned_concurrency_config.this[0]: Creation complete after 5s [id=clp-api-dev-addTransaction:35]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_provisioned_concurrency_config.this[0]: Destroying... [id=clp-api-dev-addTransaction:35]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["getPaymentMethods"].aws_lambda_provisioned_concurrency_config.this[0]: Destruction complete after 0s
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addTransaction"].aws_lambda_provisioned_concurrency_config.this[0]: Destruction complete after 1s
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [10s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [10s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [20s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [20s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [30s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [30s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [40s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [40s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [50s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [50s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m0s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m0s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m10s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m10s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m20s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m20s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m30s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m30s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m40s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m40s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m50s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [1m50s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m0s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m0s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["savePaymentMethod"].aws_lambda_provisioned_concurrency_config.this[0]: Creation complete after 2m8s [id=clp-api-dev-savePaymentMethod:35]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m10s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m20s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m30s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m40s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [2m50s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Still creating... [3m0s elapsed]
module.api_gw.module.services["clp-api"].module.lambda_s3_src["addRefund"].aws_lambda_provisioned_concurrency_config.this[0]: Creation complete after 3m8s [id=clp-api-dev-addRefund:35]

Apply complete! Resources: 4 added, 4 changed, 2 destroyed.

@ericksoen
Copy link
Contributor

What can be done to get some movement on this issue? It's been open for over a year, has a PR (with tests) against it that hasn't been merged.

I'm with you here. I just rebased #11679 off the more recent changes to main and have passing acceptance tests and a build again to hopefully make this more attractive to merge. As you point out, only one of the three behaviors in the AWS and Terraform resource documentations are currently functional.

--function-name (string)
The name of the Lambda function.
Name formats:
Function name - my-function .
Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function .
Partial ARN - 123456789012:function:my-function .

via aws cli lambda put-provisioned-concurrency-config

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 18, 2021
@eau-de-la-seine
Copy link

eau-de-la-seine commented May 12, 2023

I encounter a similar problem:

│ Error: reading Lambda Provisioned Concurrency Config (arn:aws:lambda:$AWS_REGION:$AWS_ACCOUNT_ID:function:$FUNCTION_NAME:$FUNCTION_VERSION): ValidationException: 1 validation error detected: Value 'aws:lambda:$AWS_REGION:$AWS_ACCOUNT_ID:function:$FUNCTION_NAME:$FUNCTION_VERSION' at 'qualifier' failed to satisfy constraint: Member must satisfy regular expression pattern: (|[a-zA-Z0-9$_-]+)

This happens when I use the lambda's arn for aws_lambda_provisioned_concurrency_config#function_name instead of function_name BUT documentation says:

function_name - (Required) Name or Amazon Resource Name (ARN) of the Lambda Function
qualifier - (Required) Lambda Function version or Lambda Alias name

My terraform version: 1.0.11

@jar-b
Copy link
Member

jar-b commented Jun 14, 2023

Hey everyone 👋 - Problem 1 (failed ID parsing when function_name is an ARN) has been resolved with #31933. As the majority of comments were related to this bug, we've opted to close this issue and migrate Problem 2 (feature request to optionally skip waiting on provisioned concurrency creation) to a new issue, #31981. Please follow along there for updates on this work.

@github-actions
Copy link

This functionality has been released in v5.4.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants