When provisioning aws_lambda_function and attaching aws_lambda_provisioned_concurrency_config on initial provision the aws_lambda_provisioned_concurrency_config expects a published version, this is not done in time for aws_lambda_provisioned_concurrency_config to recognize the published version.
When provisioning a new aws_lambda_function it publishes a new version attaches to an alias and successfully provisions
* aws_lambda_provisioned_concurrency_config.lambda_concurrency_config: error putting Lambda Provisioned Concurrency Config (NAME): InvalidParameterValueException: Provisioned Concurrency Configs cannot be applied to unpublished function versions.
{
Message_: "Provisioned Concurrency Configs cannot be applied to unpublished function versions.",
Type: "User"
}
When aws Lambda provisions make it so that publish = true
is required before aws_lambda_provisioned_concurrency_config can be provisioned
+1
Any movement here?
I am experiencing this issue as well.
experiencing the issue too
I am experiencing same issue.
This seems to be a problem not just for the first execution. I have all deployed but now want to ad the concurrency config.
resource "aws_lambda_alias" "deliver" {
name = "deliver"
function_name = aws_lambda_function.deliver.arn
function_version = "$LATEST"
}
resource "aws_lambda_provisioned_concurrency_config" "deliver" {
function_name = aws_lambda_alias.deliver.function_name
qualifier = aws_lambda_alias.deliver.name
provisioned_concurrent_executions = 1
}
and also get
aws_lambda_alias.deliver: Creating...
aws_lambda_alias.deliver: Creation complete after 1s [id=xx]
aws_lambda_provisioned_concurrency_config.deliver: Creating...
Error: error putting Lambda Provisioned Concurrency Config (xx): InvalidParameterValueException: Provisioned Concurrency Configs cannot be applied to unpublished function versions.
{
RespMetadata: {
StatusCode: 400,
RequestID: "xx"
},
Message_: "Provisioned Concurrency Configs cannot be applied to unpublished function versions.",
Type: "User"
}
I also tried
resource "aws_lambda_provisioned_concurrency_config" "deliver" {
function_name = aws_lambda_function.deliver.function_name
qualifier = aws_lambda_function.deliver.version
provisioned_concurrent_executions = 1
}
but it seems the problem is $LATEST
.
I don't understand why a concurrency configuration needs a dedicated version though.
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lambda_function#qualifier suggests aws_lambda_function
allows for a qualifier
but with
% terraform -v
Terraform v0.13.3
+ provider registry.terraform.io/hashicorp/archive v1.3.0
+ provider registry.terraform.io/hashicorp/aws v3.8.0
I am getting
Error: Unsupported argument
on foo.tf line 18, in resource "aws_lambda_function" "deliver":
18: qualifier = "$LATEST"
An argument named "qualifier" is not expected here.
Most helpful comment
+1