-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
resource/aws_lambda_function - possible regression w/3.17.0 on us-east-2 #16755
Comments
@kyleckf Thanks for raising this issue. |
Hi @ewbankkit , we don't have the |
Just one more note @ewbankkit, we tried with the same IAM permission in us-west-2 and we don't see the error. Hence we think this is region specific. |
@kyleckf Yes, {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "lambda:GetCodeSigningConfig",
"Resource": "*"
}
]
} to my test account then I get $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLambdaFunction_codeSigningConfig'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaFunction_codeSigningConfig -timeout 120m
=== RUN TestAccAWSLambdaFunction_codeSigningConfig
=== PAUSE TestAccAWSLambdaFunction_codeSigningConfig
=== CONT TestAccAWSLambdaFunction_codeSigningConfig
resource_aws_lambda_function_test.go:194: Step 1/5 error: Error running apply: 2020/12/15 11:58:49 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.10.0
Error: error reading Lambda code signing config (arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0db84535440db24e0): AccessDeniedException:
status code: 403, request id: 19c55ac6-51b3-43a0-bc84-b291c9595eec
Error: error reading Lambda code signing config (arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-00bf60596266984f7): AccessDeniedException:
status code: 403, request id: d731cb3d-8fc8-4996-8892-8cb69d264a78
--- FAIL: TestAccAWSLambdaFunction_codeSigningConfig (9.72s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 9.790s
FAIL
GNUmakefile:27: recipe for target 'testacc' failed
make: *** [testacc] Error 1 See the Roadmap for a research task on how we can better describe required IAM permissions. |
I found this while debugging an issue and found that I also needed to grant |
@ewbankkit I added the policy and still get the issue originally reported. This appears to only have a problem in the east-2 region. Your example of getting the deny showed the error in west-2. Can you confirm that if you allow GetCodeSigningConfig in the east-2 region you get the same error.
|
@jbhennin I have no problem in $ AWS_DEFAULT_REGION=us-east-2 make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLambdaFunction_codeSigningConfig'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaFunction_codeSigningConfig -timeout 120m
=== RUN TestAccAWSLambdaFunction_codeSigningConfig
=== PAUSE TestAccAWSLambdaFunction_codeSigningConfig
=== CONT TestAccAWSLambdaFunction_codeSigningConfig
--- PASS: TestAccAWSLambdaFunction_codeSigningConfig (42.09s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 42.185s |
The upgrade to the new AWS provider in terraform has introduced some new permissions errors. The lambda issue is documented here hashicorp/terraform-provider-aws#16755 There's no documentation as to why we need the extra elasticache permission but terraform complains without it.
I'm getting the same error in |
@brikis98 did you find a solution? Facing the same issue with the same region |
No, we haven't found any solution. |
@brikis98 https://aws.amazon.com/blogs/aws/new-code-signing-a-trust-and-integrity-control-for-aws-lambda/ Okey now we know why. The question is how do we solve it? |
@brikis98 It really has nothing to do with whether you have code signing defined in your lambda function. To simply get the current state of the Lambda function, it will have to go get the signing config of the existing function in AWS. Think about it this way, how would you detect drift if something added code signing directly in the console but not in the TF if you couldn't find out if it was on the resource in the first place. Now, it does seem like added AWS permissions maybe should be better documented as a minor breaking change? But I guess then maybe you could say that every time they add a new resource/addition to a resource. But breaking reads is more painful to consumers, since it might impact everyone, vs impacting writes of only those who use the new capability. |
Is there any way for a provider to ship values? I'm thinking for example a built in map from |
Terraform v13 requires some addition permission to be added. See: hashicorp/terraform-provider-aws#16755 Without the additional permissions the tdr-aws-accounts Terraform throws errors
Permission needed after change to AWS provider. See here for details: hashicorp/terraform-provider-aws#16755
This is a problem preventing the deployment of lambdas to ap-northeast-3 entirely. Try the following with the latest aws provider:
results in:
This is not a small unusual region either anymore as Osaka |
This functionality has been released in v3.55.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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
Terraform
0.12.25
,0.13.5
AWS Provider
3.17.0
and beyond (tested on3.21.0
and the issue is still there)Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Any
aws_lamdba_function
blocks, an example can be seen here:#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 apply
onus-east-2
Important Factoids
This issue is very similar to #16398. People have commented that it does not work for
us-east-1
also.References
The text was updated successfully, but these errors were encountered: