Skip to content

Commit

Permalink
fixed all
Browse files Browse the repository at this point in the history
  • Loading branch information
omerh committed Feb 27, 2020
1 parent 1fc696c commit 52b6de7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/helpers/lambda.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package helpers

import (
"fmt"

"github.com/aws/aws-sdk-go/service/lambda"
)

// GetAllLmbdasInRegion List all lambdas in a region
func GetAllLmbdasInRegion(region string) []*lambda.FunctionConfiguration {
func GetAllLmbdasInRegion(region string, arn string) []*lambda.FunctionConfiguration {
awsSession, _ := InitAwsSession(region)
svc := lambda.New(awsSession)
input := &lambda.ListFunctionsInput{}
Expand All @@ -24,5 +26,17 @@ func GetAllLmbdasInRegion(region string) []*lambda.FunctionConfiguration {
}
}

// Filter out lambda
if len(arn) > 0 {
for _, l := range lambdas {
if *l.FunctionArn == arn {
fmt.Println("match")
lambdas = nil
lambdas = append(lambdas, l)
return lambdas
}
}
}

return lambdas
}

0 comments on commit 52b6de7

Please sign in to comment.