func (r *route53Router) createOrNuke(action string) error { log.Debugf(" R53 %s (%s, %s)", action, r.cname, r.ip) var u = route53.ChangeResourceRecordSetsRequest{ ZoneID: r.zone.HostedZoneId(), Comment: "", Changes: []route53.Change{ { Action: action, Name: r.cname, Type: "A", TTL: 300, Value: r.ip, }, }, } if _, err := u.Create(r.client); err != nil { return err } return nil }
func updateRecord(zone route53.HostedZone, aws route53.AccessIdentifiers, action string, name string, value string) { var create = route53.ChangeResourceRecordSetsRequest{ ZoneID: zone.HostedZoneId(), Comment: "", Changes: []route53.Change{ { Action: action, Name: name, Type: "A", TTL: 300, Value: value, }, }, } r, err := create.Create(aws) if err != nil { log.Fatal("Update record failed:", r, err) } }