- Service Client を生成する際にログレベルを指定すれば OK
実装例
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
"fmt"
)
func main() {
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
svc := ec2.New(sess, aws.NewConfig().WithLogLevel(aws.LogDebug))
resultRegions, err := svc.DescribeRegions(nil)
if err != nil {
fmt.Println("Error", err)
return
}
fmt.Println(resultRegions)
}
Using the AWS SDK for Go with AWS Services - AWS SDK for Go
https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/making-requests.html#get-http-request-response