From 1421275593ba8d5cf5b5096d62cff0c7aa650dc5 Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Mon, 25 May 2020 10:58:34 -0600 Subject: [PATCH] Use the Provisioner interface for session provisioning (#3) * fix(route53): Use the Provisioner interface for session provisioning * chore(route53): Code simplification --- route53.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/route53.go b/route53.go index c6f530f..45bbad3 100644 --- a/route53.go +++ b/route53.go @@ -21,17 +21,17 @@ func (Provider) CaddyModule() caddy.ModuleInfo { return caddy.ModuleInfo{ ID: "dns.providers.route53", New: func() caddy.Module { - p := &Provider{new(route53.Provider)} - // Initialize the AWS client session - err := p.NewSession() - if err != nil { - return nil - } - return p + return &Provider{new(route53.Provider)} }, } } +// Provision implements the Provisioner interface to initialize the AWS Client sessions +func (p *Provider) Provision(ctx caddy.Context) error { + // Initialize the AWS client session + return p.NewSession() +} + // UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax: // // route53 {