From 87e770cc0204a86dc216e0df66114e7492a55d2b Mon Sep 17 00:00:00 2001 From: Aidan Steele Date: Sat, 1 Feb 2020 22:10:40 +1100 Subject: [PATCH] route53: allow custom client to be provided (#1050) --- providers/dns/route53/route53.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/dns/route53/route53.go b/providers/dns/route53/route53.go index 3c86b0b3..da881d63 100644 --- a/providers/dns/route53/route53.go +++ b/providers/dns/route53/route53.go @@ -25,6 +25,7 @@ type Config struct { PropagationTimeout time.Duration PollingInterval time.Duration HostedZoneID string + Client *route53.Route53 } // NewDefaultConfig returns a default configuration for the DNSProvider @@ -86,6 +87,10 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) { return nil, errors.New("route53: the configuration of the Route53 DNS provider is nil") } + if config.Client != nil { + return &DNSProvider{client: config.Client, config: config}, nil + } + retry := customRetryer{} retry.NumMaxRetries = config.MaxRetries sessionCfg := request.WithRetryer(aws.NewConfig(), retry)