func (a *AmazonDNS) createARecord(name string, ip string) error {
	service, err := a.getDNSService()
	if err != nil {
		return err
	}
	if !strings.Contains(name, ".") {
		name = name + "." + DNSOptions.Zone + "."
	}
	params := &route53.ChangeResourceRecordSetsInput{
		ChangeBatch: &route53.ChangeBatch{
			Changes: []*route53.Change{
				{
					Action: aws.String("UPSERT"),
					ResourceRecordSet: &route53.ResourceRecordSet{
						Name: aws.String(name),
						Type: aws.String("A"),
						ResourceRecords: []*route53.ResourceRecord{
							{
								Value: aws.String(ip),
							},
						},
						TTL:           aws.Int64(int64(DNSOptions.TTL)),
						Weight:        aws.Int64(1),
						SetIdentifier: aws.String("lxdepot"),
					},
				},
			},
			Comment: aws.String("Adding A record for " + name),
		},
		HostedZoneId: aws.String(a.ZoneID),
	}
	_, err = service.ChangeResourceRecordSets(params)
	return err  
}
createARecord creates the entry in Route 53
package dns
import (
	"errors"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/route53"
	"strconv"
	"strings"
	"time"
)
type AmazonDNS struct {
	CredsFile string  
	Profile   string  
	ZoneID    string  
}
type amazonRrsetCache struct {
	Rrsets    []*route53.ResourceRecordSet
	CacheTime time.Time
}
var acache amazonRrsetCache
func NewAmazonDNS(credsfile string, profile string, zoneid string) *AmazonDNS {
	return &AmazonDNS{
		CredsFile: credsfile,
		Profile:   profile,
		ZoneID:    zoneid,
	}
}
func (a *AmazonDNS) getDNSService() (*route53.Route53, error) {
	session, err := session.NewSession(&aws.Config{
		Credentials: credentials.NewSharedCredentials(a.CredsFile, a.Profile),
	})
	if err != nil {
		return nil, errors.New("Could not create new Route 53 session: " + err.Error())
	}
	service := route53.New(session)
	return service, nil
}
func (a *AmazonDNS) getZoneRecordSet() error {
	if acache.CacheTime != (time.Time{}) {
		now := time.Now()
		if now.Sub(acache.CacheTime).Seconds() <= 30 {
			return nil
		}
		acache = amazonRrsetCache{}
	}
	service, err := a.getDNSService()
	if err != nil {
		return err
	}
	params := &route53.ListResourceRecordSetsInput{
		HostedZoneId: aws.String(a.ZoneID),
	}
	err = service.ListResourceRecordSetsPages(params,
		func(page *route53.ListResourceRecordSetsOutput, lastPage bool) bool {
			acache.Rrsets = append(acache.Rrsets, page.ResourceRecordSets...)
			return lastPage
		})
	if err != nil {
		return err
	}
	acache.CacheTime = time.Now()
	return nil
}