-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda_misc.go
More file actions
33 lines (28 loc) · 810 Bytes
/
lambda_misc.go
File metadata and controls
33 lines (28 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package lambda_deploy
import (
"github.com/aws/aws-sdk-go/service/lambda"
"strings"
"fmt"
)
func ListLambdas(client *lambda.Lambda) (string) {
input := lambda.ListFunctionsInput{}
resp, err := client.ListFunctions(&input)
if err != nil {
if strings.Contains(err.Error(), "NoCredentialProviders") {
fmt.Println("Error: please check your AWS credentials")
}
panic(err)
}
return resp.String()
}
func DeleteLambda(client *lambda.Lambda, functionName string) {
deletionRequest := lambda.DeleteFunctionInput{FunctionName:&functionName}
_, err := client.DeleteFunction(&deletionRequest)
check(err)
}
func LambdaAccountSettings(client *lambda.Lambda) (string) {
input := lambda.GetAccountSettingsInput{}
result, err := client.GetAccountSettings(&input)
check(err)
return result.String()
}