Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
Feat/lambda runtime fix (#339)
Browse files Browse the repository at this point in the history
* fix function replacement
  • Loading branch information
zagronitay authored Dec 8, 2021
1 parent 0828911 commit d118191
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 11 additions & 0 deletions resources/lambda_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,3 +1209,14 @@ func fetchLambdaFunctionEventSourceMappings(ctx context.Context, meta schema.Cli
}
return nil
}
func resolveLambdaFunctionEventSourceMappingAccessConfigurations(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error {
p, ok := resource.Item.(types.EventSourceMappingConfiguration)
if !ok {
return fmt.Errorf("wrong type assertion: got %T instead of EventSourceMappingConfiguration", p)
}
data, err := json.Marshal(p.SourceAccessConfigurations)
if err != nil {
return err
}
return resource.Set(c.Name, data)
}
13 changes: 0 additions & 13 deletions resources/lambda_runtimes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package resources

import (
"context"
"encoding/json"
"fmt"

"github.com/aws/aws-sdk-go-v2/service/lambda/types"
"github.com/cloudquery/cq-provider-sdk/provider/schema"
Expand Down Expand Up @@ -37,17 +35,6 @@ func fetchLambdaRuntimes(ctx context.Context, meta schema.ClientMeta, parent *sc

return nil
}
func resolveLambdaFunctionEventSourceMappingAccessConfigurations(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error {
p, ok := resource.Item.(types.EventSourceMappingConfiguration)
if !ok {
return fmt.Errorf("wrong type assertion: got %T instead of EventSourceMappingConfiguration", p)
}
data, err := json.Marshal(p.SourceAccessConfigurations)
if err != nil {
return err
}
return resource.Set(c.Name, data)
}

type RuntimeWrapper struct {
Name string
Expand Down

0 comments on commit d118191

Please sign in to comment.