terraform-provider-aws: Error expanding plan for AWS Lambda Provisioned Concurrency
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 other comments that do not add relevant new information or questions, 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 CLI and Terraform AWS Provider Version
Terraform v0.12.20
- provider.aws v2.70.0
Affected Resource(s)
- aws_lambda_provisioned_concurrency_config
Terraform Configuration Files
resource "aws_lambda_function" "function" {
function_name = "${local.name_prefix}-${var.lambda_name_uniq_part}"
handler = var.lambda_handler
role = aws_iam_role.lambda_execution_role.arn
runtime = var.lambda_runtime
memory_size = var.lambda_memory_size
timeout = var.lambda_execution_timeout
filename = var.lambda_filename
source_code_hash = filebase64sha256(var.lambda_filename)
environment {
variables = var.lambda_env_vars
}
vpc_config {
security_group_ids = var.lambda_sg_ids
subnet_ids = var.lambda_subnet_ids
}
reserved_concurrent_executions = 50
depends_on = [aws_cloudwatch_log_group.lambda_logs, aws_iam_role_policy.lambda_log_policy]
publish = true
tags = local.common_tags
}
resource "aws_lambda_provisioned_concurrency_config" "lambda_config" {
count = 1
function_name = aws_lambda_function.function.function_name
provisioned_concurrent_executions = 5
qualifier = aws_lambda_function.function.version
}
Debug Output
Expected Behavior
New version of Lambda function should be published and provisioned concurrency config should be created and pointed to the published Lambda function version.
Actual Behavior
I see the following message:
When expanding the plan for
module.my_lambda.aws_lambda_provisioned_concurrency_config.lambda_config[0]
to include new values learned so far during apply, provider
"registry.terraform.io/-/aws" produced an invalid new value for .qualifier:
was cty.StringVal("$LATEST"), but now cty.StringVal("1").
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Steps to Reproduce
terraform apply
Important Factoids
I was able to apply this code during the next (second) run w/o any issues. Seems Lambda is published during the first run and config is not, on the second run config is able to refer published Lambda version and everything is fine.
Plan operation is ok during the both runs.
References
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 57
- Comments: 17 (4 by maintainers)
I have the same when I change something in the layer. Usually the second works but still annoying.
Same here but with
aws_lambda_layer_versionA second apply did work.
Using terraform
0.13.4and aws provider3.10.0I have seen this as well, but for the
aws_lambda_aliasresource, which is using a lambda function resource in the same way as theaws_lambda_provisioned_concurrency_configis doing.Could it be a race-condition with the lambda creation and the resources depending on them?
I am also experiencing this with Terraform 0.12.24 and AWS provider version 2.70.0. Plan also succeeds with no issues.
Apply output:
Config as follows:
Closing give lack of response to reproductions. Completed via #14578