From 0f396cd1358449aff4b7453871755009f8124ecc Mon Sep 17 00:00:00 2001 From: Hugo Barros <26457+hmrbarros@users.noreply.github.com> Date: Wed, 4 Dec 2019 15:17:28 +0000 Subject: [PATCH] ROUTE53: Add AWS_PROFILE functionality (#567) * Add AWS_PROFILE functionality for Route53 provider * Document named profiles authentication option for Route53 --- docs/_providers/route53.md | 7 +++++++ providers/route53/route53Provider.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/_providers/route53.md b/docs/_providers/route53.md index 6621a0156..9adce2cdf 100644 --- a/docs/_providers/route53.md +++ b/docs/_providers/route53.md @@ -36,6 +36,13 @@ $ export AWS_SESSION_TOKEN=ZZZZZZZZ } {% endhighlight %} +Alternatively if you want to used [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) you need to export the following variables + +``` +$ export AWS_SDK_LOAD_CONFIG=1 +$ export AWS_PROFILE=ZZZZZZZZ +``` + You can find some other ways to authenticate to Route53 in the [go sdk configuration](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html). ## Metadata diff --git a/providers/route53/route53Provider.go b/providers/route53/route53Provider.go index a41a0663b..5b7b4074b 100644 --- a/providers/route53/route53Provider.go +++ b/providers/route53/route53Provider.go @@ -47,7 +47,7 @@ func newRoute53(m map[string]string, metadata json.RawMessage) (*route53Provider if keyID != "" || secretKey != "" { config.Credentials = credentials.NewStaticCredentials(keyID, secretKey, tokenID) } - sess := session.New(config) + sess := session.Must(session.NewSession(config)) var dls *string = nil if val, ok := m["DelegationSet"]; ok {