route53: allow custom client to be provided (#1050)
This commit is contained in:
parent
ee33cff002
commit
87e770cc02
1 changed files with 5 additions and 0 deletions
|
@ -25,6 +25,7 @@ type Config struct {
|
||||||
PropagationTimeout time.Duration
|
PropagationTimeout time.Duration
|
||||||
PollingInterval time.Duration
|
PollingInterval time.Duration
|
||||||
HostedZoneID string
|
HostedZoneID string
|
||||||
|
Client *route53.Route53
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDefaultConfig returns a default configuration for the DNSProvider
|
// 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")
|
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 := customRetryer{}
|
||||||
retry.NumMaxRetries = config.MaxRetries
|
retry.NumMaxRetries = config.MaxRetries
|
||||||
sessionCfg := request.WithRetryer(aws.NewConfig(), retry)
|
sessionCfg := request.WithRetryer(aws.NewConfig(), retry)
|
||||||
|
|
Loading…
Reference in a new issue