Golang library for using AWS Parameters and Secrets Lambda Extension.
- Using Parameter Store parameters in AWS Lambda functions - AWS Systems Manager
- Use AWS Secrets Manager secrets in AWS Lambda functions - AWS Secrets Manager
go get github.com/winebarrel/secretlamb
package main
import (
"context"
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/winebarrel/secretlamb"
)
func HandleRequest(ctx context.Context, event any) (*string, error) {
client := secretlamb.MustNewParameters() // .WithRetry(3)
v, err := client.Get("foo")
//v, err := client.GetWithDecryption("foo")
if err != nil {
return nil, err
}
fmt.Println(v.Parameter.Value)
return nil, nil
}
func main() {
lambda.Start(HandleRequest)
}
package main
import (
"context"
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/winebarrel/secretlamb"
)
func HandleRequest(ctx context.Context, event any) (*string, error) {
client := secretlamb.MustNewSecrets() // .WithRetry(3)
v, err := client.Get("foo")
if err != nil {
return nil, err
}
fmt.Println(v.SecretString)
return nil, nil
}
func main() {
lambda.Start(HandleRequest)
}