Skip to content
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

fix: permission for lambda-to-lambda async calls #141

Merged

Conversation

0xe1d1a
Copy link
Contributor

@0xe1d1a 0xe1d1a commented Apr 6, 2021

The async policy is missing the action to asynchronously call other lambda functions. Duplicate of #140, which I messed up somehow due to using github UI for the first time.

Description

Added lambda:InvokeFunction into the policy document for async integrations.

Check https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html as it states

"This operation requires permission for the lambda:InvokeFunction action."

Motivation and Context

When I deployed a lambda of which the destination_on_success is another lambda arn, my caller lambda failed to call my callee lambda due to a permission error.

Breaking Changes

Does not break backwards compatibility as it is an added permission.

How Has This Been Tested?

After adding the above changes on my local terraform module, the lambda integration works as expected, i.e. it has the permission to call another lambda asynchronously.

@0xe1d1a 0xe1d1a changed the title fix: added action to policy for lambda-to-lambda async calls fix: permission for lambda-to-lambda async calls Apr 6, 2021
@0xe1d1a
Copy link
Contributor Author

0xe1d1a commented Apr 6, 2021

@antonbabenko, no idea why this is failing the check but have a look when you can as the error seems like there is something wrong with the runner environment.

@antonbabenko
Copy link
Member

Thanks for the fix! Looks good to me.

@bryantbiggs Do you have an idea what can this be with GH Actions? terraform-docs is giving us extra work lately :(

@bryantbiggs
Copy link
Member

@antonbabenko ya, I don't have a good solution for terraform_docs unless we take it off the integration process and run it manually as part of the release process. there are two big issues that are competing:

  1. Terraform docs have been getting a lot of changes lately so we moved to try to pin the version, but this introduces a new issue which is
  2. If we pin the version of terraform_docs, how do users also utilize that same version. Without something like tfenv or pyenv, etc. to manage versions, I would suspect most users are pulling the latest or trying to use whatever version is currently installed

something we need to think about how we want to support this, and how it fits into our static checks process

@antonbabenko
Copy link
Member

antonbabenko commented Apr 6, 2021

I wonder what has changed recently so that we have this error (failed run):

Terraform docs...........................................................Failed
- hook id: terraform_docs
- exit code: 1

ERROR: terraform-docs is required by terraform_docs pre-commit hook but is not installed or in the system's PATH.

https://github.com/antonbabenko/pre-commit-terraform/blob/master/terraform_docs.sh#L58

I am fine with running terraform-docs myself with the correct version locally in the meantime as long as GH Actions run them also.

@bryantbiggs
Copy link
Member

terraform_docs released v0.12.1 which caused the breakage, you can see a fix here but not sure if that will work longterm - need to find a longterm solution to avoid this cycle of errors https://github.com/terraform-aws-modules/terraform-aws-alb/pull/191/files#diff-ac5eead3f3ce4863c524fff031a87b7aecccb4a0493df087a4e1c704a1505036R97

@antonbabenko
Copy link
Member

@bryantbiggs Thanks for the help! This one is passing fine now. Let's see when it break next time and we fix it better :)

Merging this one.

@antonbabenko antonbabenko merged commit a1f0f61 into terraform-aws-modules:master Apr 6, 2021
@antonbabenko
Copy link
Member

v1.45.0 has been just released.

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants