-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_lambda_function undefining values #23281
Comments
Hi @pimperator I was trying to have a look into this. Then I tried to reproduce it with What I could see however is that I can trigger this "conflict" error if I set Could you please upgrade and retry? |
Dear @gbataille , yes, it still persists on my testing-code (not the glue-code from above):
let me check how I can better re-trigger this issue and put some better code (locally applied) for your tests. Cheers Erik |
Dear @gbataille I had to switch the conditionals for s3_bucket and s3_key to make it work. Also I had bo provide a package_type depending on either image_uri or function zip: resource "aws_lambda_function" "this" {
function_name = local.tags.Name
role = aws_iam_role.iam_for_lambda.arn
s3_bucket = local.image_uri == null ? local.s3_bucket : null #<<<<<<<<<<<<<<
s3_key = local.image_uri == null ? local.s3_key : null #<<<<<<<<<<<<<<
memory_size = 128
runtime = "python3.9"
handler = "lambda_function.lambda_handler"
architectures = ["x86_64"]
timeout = 5
publish = false
image_uri = local.image_uri #<<<<<<<<<<<<<<
package_type = local.image_uri == null ? "Zip" : "Image"
tags = local.tags
} The only thing that I now need to look into is how to provide an image_uri on creation for a non-existing container-tag since this makes terraform fail. Nevertheless we can see the issue solved. Thanks a lot for your help and best wishes form Bavaria! Erik |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
I have some glue-code here but please note: we want either to create lambdas with either a zip-file from s3 or like here with a container.
So the glue code raises the error but note that
aws_lambda_function
andaws_ecr_repository
are comeing from different modules handing over needed values via outputs.Debug Output
Panic Output
Expected Behavior
The expected behaviour here is that the following combinations are allowed:
Actual Behavior
For now you cannot define the 5 values at once. Only the combinations {s3_bucket, s3_key, s3_object_version}, {filename} or {image_uri} is allowed but for having one generic lambda module it would be awesome to being able to make the values undefined.
Steps to Reproduce
terraform apply
Important Factoids
References
image_uri
to data sourceaws_lambda_function
#21015The text was updated successfully, but these errors were encountered: