Skip to content

Commit e96a410

Browse files
authored
fix(aws): Enable Partial Resolution of Lambda (#6391)
#### Summary This enables CQ to store the results of `ListFunctions` even if the `GetFunction` fails because of a permission error. This was a fix that we had implemented in V0 <!--
1 parent 45c4753 commit e96a410

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

plugins/source/aws/resources/services/lambda/functions_fetch.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ func getFunction(ctx context.Context, meta schema.ClientMeta, resource *schema.R
4747
}
4848
return nil
4949
}
50+
// This is intended to handle the case where the user does not have GetFunction permission
51+
// User should still get an error in the logs, but the data that was able to be fetched should be persisted
52+
if client.IsAWSError(err, "AccessDenied") || client.IsAWSError(err, "AccessDeniedException") {
53+
resource.Item = &lambda.GetFunctionOutput{
54+
Configuration: &f,
55+
}
56+
}
5057
return err
5158
}
5259

0 commit comments

Comments
 (0)