terraform-provider-aws: resource/aws_lambda_function - possible regression w/3.17.0 on us-east-2
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 0.12.25, 0.13.5
AWS Provider 3.17.0 and beyond (tested on 3.21.0 and the issue is still there)
Affected Resource(s)
- aws_lambda_function
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
Any aws_lamdba_function blocks, an example can be seen here:
https://github.com/hashicorp/terraform-provider-aws/issues/16398
Debug Output
Panic Output
Expected Behavior
Terraform apply is successful
Actual Behavior
Error: error getting Lambda Function Code Signing Config: AccessDeniedException: 11:31:34 status code: 403, request id: e5539b23-7f69-478d-ae36-67bc55c8e50c
Steps to Reproduce
terraform applyonus-east-2
Important Factoids
This issue is very similar to https://github.com/hashicorp/terraform-provider-aws/issues/16398. People have commented that it does not work for us-east-1 also.
References
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 16 (5 by maintainers)
Commits related to this issue
- Add new terraform permissions. The upgrade to the new AWS provider in terraform has introduced some new permissions errors. The lambda issue is documented here https://github.com/hashicorp/terraform... — committed to nationalarchives/tdr-terraform-backend by MancunianSam 3 years ago
- Update permissions to support Terraform v13 Terraform v13 requires some addition permission to be added. See: https://github.com/hashicorp/terraform-provider-aws/issues/16755 Without the additional ... — committed to nationalarchives/tdr-terraform-backend by TomJKing 3 years ago
- Additional lambda permission to support 3.48 Permission needed after change to AWS provider. See here for details: https://github.com/hashicorp/terraform-provider-aws/issues/16755 — committed to nationalarchives/tdr-terraform-backend by TomJKing 3 years ago
I found this while debugging an issue and found that I also needed to grant
lambda:GetFunctionCodeSigningConfigIām getting the same error in
ap-northeast-3and we are not trying to enable code signing at all. This code used to work fine, so something about introducing Lambda code signing into the AWS Provider has broken Lambda functions in general inap-northeast-3, whether or not you are trying to use the code signing functionality.This is a problem preventing the deployment of lambdas to ap-northeast-3 entirely. The most trivial example fails with the issue described, even will full admin permissions because the code signing service (AWS Signer) does not exist in ap-northeast-3. It is not a matter of permissions it is a matter of the service not existing in this region.
Try the following with the latest aws provider:
results in:
This is not a small unusual region either anymore as Osaka
ap-northeast-3went GA on 2021-03-1 https://aws.amazon.com/blogs/aws/aws-asia-pacific-osaka-region-now-open-to-all-with-three-azs-more-services/@kyleckf Yes,
lambda:GetCodeSigningConfigis a required permission. If I attach an IAM policy liketo my test account then I get
See the Roadmap for a research task on how we can better describe required IAM permissions.