(ctx context.Context, additions, deletions []route53types.Change, zone *route53types.HostedZone)
| 366 | } |
| 367 | |
| 368 | func batchChanges(ctx context.Context, additions, deletions []route53types.Change, zone *route53types.HostedZone) *route53.ChangeResourceRecordSetsOutput { |
| 369 | // sort additions so aliases are last |
| 370 | sort.Sort(changeSorter{additions}) |
| 371 | |
| 372 | changes := append(deletions, additions...) |
| 373 | |
| 374 | var resp *route53.ChangeResourceRecordSetsOutput |
| 375 | for i := 0; i < len(changes); i += ChangeBatchSize { |
| 376 | end := i + ChangeBatchSize |
| 377 | if end > len(changes) { |
| 378 | end = len(changes) |
| 379 | } |
| 380 | batch := route53types.ChangeBatch{ |
| 381 | Changes: changes[i:end], |
| 382 | } |
| 383 | req := route53.ChangeResourceRecordSetsInput{ |
| 384 | HostedZoneId: zone.Id, |
| 385 | ChangeBatch: &batch, |
| 386 | } |
| 387 | var err error |
| 388 | resp, err = r53.ChangeResourceRecordSets(ctx, &req) |
| 389 | fatalIfErr(err) |
| 390 | } |
| 391 | return resp |
| 392 | } |
| 393 | |
| 394 | func UnexpandSelfAliases(records []dns.RR, zone *route53types.HostedZone, full bool) { |
| 395 | id := strings.Replace(*zone.Id, "/hostedzone/", "", 1) |
no test coverage detected