Menu
AWS SDK for Go
Developer Guide

Displaying Information about All Lambda Functions

The following example displays the names and descriptions of the Lambda functions in the us-west-2 region.

func main() { // Initialize a session sess := session.Must(session.NewSessionWithOptions(session.Options{ SharedConfigState: session.SharedConfigEnable, })) // Create Lambda service client svc := lambda.New(sess, &aws.Config{Region: aws.String("us-west-2")}) result, err := svc.ListFunctions(nil) if err != nil { fmt.Println("Cannot list functions") os.Exit(0) } fmt.Println("Functions:") for _, f := range result.Functions { fmt.Println("Name: " + aws.StringValue(f.FunctionName)) fmt.Println("Description: " + aws.StringValue(f.Description)) fmt.Println("") } }

See the complete example on GitHub.