Skip to content

Commit

Permalink
fix(aws): Don't call GetFunctionCodeSigningConfig or GetRuntimeManage…
Browse files Browse the repository at this point in the history
…mentConfig on Lambdas packaged as Images (`aws_lambda_functions`)
  • Loading branch information
AshCorr committed Oct 19, 2023
1 parent 7f00f09 commit eae2760
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/source/aws/resources/services/lambda/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
"github.com/cloudquery/cloudquery/plugins/source/aws/client"
"github.com/cloudquery/plugin-sdk/v4/scalar"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/cloudquery/plugin-sdk/v4/transformers"
sdkTypes "github.com/cloudquery/plugin-sdk/v4/types"
Expand Down Expand Up @@ -153,9 +152,7 @@ func resolveCodeSigningConfig(ctx context.Context, meta schema.ClientMeta, resou
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*
lambdaType := resource.Get("code_repository_type").(*scalar.String)
if lambdaType != nil && lambdaType.Value == "ECR" {
if r.Configuration.PackageType == "Image" {
return nil
}

Expand Down Expand Up @@ -232,6 +229,11 @@ func resolveRuntimeManagementConfig(ctx context.Context, meta schema.ClientMeta,
cl := meta.(*client.Client)
svc := cl.Services(client.AWSServiceLambda).Lambda

// skip getting GetRuntimeManagementConfig since containerized lambda functions does not support this feature
if r.Configuration.PackageType == "Image" {
return nil
}

runtimeManagementConfig, err := svc.GetRuntimeManagementConfig(ctx, &lambda.GetRuntimeManagementConfigInput{
FunctionName: r.Configuration.FunctionName,
}, func(options *lambda.Options) {
Expand Down

0 comments on commit eae2760

Please sign in to comment.