Skip to content

Commit e99c277

Browse files
authored
fix: remove presigned S3 URL from aws_lambda_function code column (#2726)
1 parent b4c8a83 commit e99c277

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

aws/table_aws_lambda_function.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ func tableAwsLambdaFunction(_ context.Context) *plugin.Table {
207207
Description: "The deployment package of the function or version.",
208208
Type: proto.ColumnType_JSON,
209209
Hydrate: getAwsLambdaFunction,
210+
Transform: transform.FromField("Code").Transform(filterCodeLocation),
210211
},
211212
{
212213
Name: "environment_variables",
@@ -489,6 +490,18 @@ func getLambdaFunctionUrlConfig(ctx context.Context, d *plugin.QueryData, h *plu
489490
return urlConfigs, nil
490491
}
491492

493+
func filterCodeLocation(_ context.Context, d *transform.TransformData) (interface{}, error) {
494+
code, ok := d.Value.(*types.FunctionCodeLocation)
495+
if !ok || code == nil {
496+
return nil, nil
497+
}
498+
return map[string]interface{}{
499+
"ImageUri": code.ImageUri,
500+
"RepositoryType": code.RepositoryType,
501+
"ResolvedImageUri": code.ResolvedImageUri,
502+
}, nil
503+
}
504+
492505
func functionName(item interface{}) string {
493506
switch item := item.(type) {
494507
case types.FunctionConfiguration:

0 commit comments

Comments
 (0)