awslocal
is a wrapper for the Golang AWS SDK which makes interacting with LocalStack services easier. Simply wrap your service configuration with awslocal.Wrap()
.
session, err := session.NewSession(aws.NewConfig())
if err != nil {
log.Fatal(err)
}
cfg := aws.NewConfig()
// Wrap the service cfg for use with LocalStack
awslocal.Wrap(cfg, awslocal.ServiceS3)
svc := s3.New(session, cfg)
log.Println(svc.ListBuckets(&s3.ListBucketsInput{}))