-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
feat: Added support for lambda permissions when the target is a lambda function #240
feat: Added support for lambda permissions when the target is a lambda function #240
Conversation
…target group to send requests to a lambda
…ure permissions for the alb. This is now covered in the module itself
This PR has been automatically marked as stale because it has been open 30 days |
This PR was automatically closed because of stale in 10 days |
Would love to see this implemented @eamonnmoloney |
@antonbabenko Can this be merged to master? |
Thank you for the update. I scheduled it for the 20th of May. I can't just merge it right away. |
## [6.11.0](v6.10.0...v6.11.0) (2022-05-20) ### Features * Added support for lambda permissions when the target is a lambda function ([#240](#240)) ([e79573d](e79573d))
This PR is included in version 6.11.0 🎉 |
Getting errors because of this today:
|
@fzipi360 Could you please provide the code snippet you are using? |
Of course. I can also confirm that pinning to 6.10 works again.
|
This code does not produce any error to me. |
TF version used in that repo is 0.13.7, just in case it adds anything. |
Yes, this helped me to identify the issue. I am working on a workaround for Terraform 0.13++. We will upgrade modules to a higher version of Terraform to avoid such issues in the future. |
I actually couldn't find a way to make it work with 0.13. It works well with 0.14 and up. The problem with 0.13 related to this PR is different behavior of @bryantbiggs I am really looking forward to dropping support for 0.13 all over terraform-aws-modules as soon as we hit any weird issues like this. WDYT if we drop support for 0.13 here? The minimum version where this PR works as expected is 0.14. Do you agree that we make a major release and require Terraform 1.0 in this module (and maybe in other modules, too, if we hit some cases)? |
This issue has been resolved in version 7.0.0 🎉 |
Awesome, thanks! That's exactly what we did, glad at least there is an explanation :) |
This conversation helped me with the |
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
This PR adds the
aws_lambda_permission
resource that should be created before theaws_lb_target_group_attachment
is created.target_groups.targets
is extended to allowaws_lambda_permission
attributes to be passed in. The new attributes are listed under the top level oftarget_groups.target
which makes the structure very flat. The ideal case would nest those within atarget_groups.target.lambda_permissions
however this is not possible as it leads to this problem hashicorp/terraform#22405The trigger on the lambda resource is also removed from the complete example as it is unnecessary now
Motivation and Context
The problem was that the lambda ARN is an input to the module. However, to create the permissions for the target group to to target the lambda, you needed the output target group ARN. The workaround was to run
terraform apply
twice.Now, the permission fields can be passed into the module and the module creates the permission resources required if
attach_lambda_permission = true
intargets
.This refers to #210
Breaking Changes
It does not break backward compatibility.
How Has This Been Tested?
examples/*
projectsThis has been added and tested against the complete ALB example where there is a mix of target types.