route53: set WithCredentialsChainVerboseErrors

Otherwise we get an error message which is confusingly written on
authentication failures.
pull/6/head
Justin Santa Barbara 2017-01-13 00:18:39 -05:00
parent 9cbaff9e0f
commit 66640c7852
1 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,7 @@ package route53
import (
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/route53"
@ -53,7 +54,13 @@ func route53HandlerLogger(req *request.Request) {
func newRoute53(config io.Reader) (*Interface, error) {
// Connect to AWS Route53 - TODO: Do more sophisticated auth
svc := route53.New(session.New())
awsConfig := aws.NewConfig()
// This avoids a confusing error message when we fail to get credentials
// e.g. https://github.com/kubernetes/kops/issues/605
awsConfig = awsConfig.WithCredentialsChainVerboseErrors(true)
svc := route53.New(session.New(), awsConfig)
// Add our handler that will log requests
svc.Handlers.Sign.PushFrontNamed(request.NamedHandler{