func (p *Plugin) OnConfigurationChange() error {
	configuration := p.getConfiguration().Clone()
	if loadConfigErr := p.API.LoadPluginConfiguration(configuration); loadConfigErr != nil {
		return errors.Wrap(loadConfigErr, "failed to load plugin configuration")
	}
	p.setConfiguration(configuration)
	return nil
}
OnConfigurationChange is invoked when configuration changes may have been made.
package main
import (
	"fmt"
	"github.com/pkg/errors"
)
type configuration struct {
	AWSAccessKeyID string
	AWSSecretAccessKey string
	AWSRegion string
	disabled bool
}
func (c *configuration) Clone() *configuration {
	return &configuration{
		AWSAccessKeyID:     c.AWSAccessKeyID,
		AWSSecretAccessKey: c.AWSSecretAccessKey,
		AWSRegion:          c.AWSRegion,
		disabled:           c.disabled,
	}
}
func (p *Plugin) getConfiguration() *configuration {
	p.configurationLock.RLock()
	defer p.configurationLock.RUnlock()
	if p.configuration == nil {
		return &configuration{}
	}
	return p.configuration
}
func (p *Plugin) setConfiguration(configuration *configuration) {
	p.configurationLock.Lock()
	defer p.configurationLock.Unlock()
	if configuration != nil && p.configuration == configuration {
		panic("setConfiguration called with the existing configuration")
	}
	p.configuration = configuration
}