fix: Don't call GetFunctionCodeSigningConfig or GetRuntimeManagementConfig on Lambdas packaged as Images (aws_lambda_functions)#14729
Merged
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom Oct 20, 2023
Conversation
AshCorr
commented
Oct 19, 2023
| svc := cl.Services(client.AWSServiceLambda).Lambda | ||
|
|
||
| // skip getting CodeSigningConfig since containerized lambda functions does not support this feature | ||
| // value can be nil if the caller doesn't have GetFunctionConfiguration permission and only has List* |
Contributor
Author
There was a problem hiding this comment.
This is still the case but theres a nil check for r.Configuration on https://github.com/cloudquery/cloudquery/pull/14729/files#diff-93c24c91e5c0e22f86d6415f1b98b47062f7d8974b9337c0b13c01322b8df981L149
AshCorr
commented
Oct 19, 2023
|
|
||
| // skip getting CodeSigningConfig since containerized lambda functions does not support this feature | ||
| // value can be nil if the caller doesn't have GetFunctionConfiguration permission and only has List* | ||
| lambdaType := resource.Get("code_repository_type").(*scalar.String) |
Contributor
Author
There was a problem hiding this comment.
Not entirely sure why we previously relied on untyped resource.Get instead of directly accessing values from r.Configuration. Either way, this approach seemed to not be working for us as we were still getting errors from GetRuntimeManagementConfig.
…mentConfig on Lambdas packaged as Images (`aws_lambda_functions`)
eae2760 to
05c9355
Compare
aws_lambda_functions)aws_lambda_functions)
Co-authored-by: Ben Bernays <ben@bernays.me>
bbernays
approved these changes
Oct 20, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Oct 23, 2023
🤖 I have created a release *beep* *boop* --- ## [22.16.0](plugins-source-aws-v22.15.2...plugins-source-aws-v22.16.0) (2023-10-23) ### This Release has the Following Changes to Tables - Table `aws_efs_filesystems`: column added with name `file_system_policy` and type `utf8` ### Features * Add `policy` column to `aws_efs_filesystems` table ([#14672](#14672)) ([833b9c2](833b9c2)) ### Bug Fixes * Changed the condition to check for policies in policies table ([#13935](#13935)) ([f136331](f136331)) * **deps:** Update github.com/cloudquery/arrow/go/v14 digest to f46436f ([#14803](#14803)) ([f5248d7](f5248d7)) * **deps:** Update module github.com/cloudquery/codegen to v0.3.10 ([#14773](#14773)) ([98f3e2c](98f3e2c)) * **deps:** Update module github.com/cloudquery/codegen to v0.3.11 ([#14870](#14870)) ([4fa917d](4fa917d)) * Don't call GetFunctionCodeSigningConfig or GetRuntimeManagementConfig on Lambdas packaged as Images (`aws_lambda_functions`) ([#14729](#14729)) ([6fc30d3](6fc30d3)) * Handle `NotFound` error when syncing Subscriptions with deleted topic (`aws_sns_subscriptions`) ([#14771](#14771)) ([6fcf43d](6fcf43d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When syncing
aws_lambda_functionsCloudquery has 2 resolvers for GetFunctionCodeSigningConfig and GetRuntimeManagementConfig. The AWS API does not support calling either of these APIs with Lambdas that use containerised images and this results in errors in Cloudquery.Thankfully Cloudquery is great and doesn't panic when it encounters these errors and theres no loss in data, but it does log it as "something bad happening" when in reality this is expected behaviour from the AWS API.
It looks like there was an attempt to fix this before for GetFunctionCodeSigningConfig but it doesn't seem to be preventing the errors.
Part of #14652