Skip to content

Commit

Permalink
Use the Provisioner interface for session provisioning (#3)
Browse files Browse the repository at this point in the history
* fix(route53): Use the Provisioner interface for session provisioning

* chore(route53): Code simplification
  • Loading branch information
Daniel Santos authored May 25, 2020
1 parent 8c20bfe commit 1421275
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1421275

Please sign in to comment.