MCPcopy Create free account
hub / github.com/barnybug/cli53 / batchChanges

Function batchChanges

commands.go:368–392  ·  view source on GitHub ↗
(ctx context.Context, additions, deletions []route53types.Change, zone *route53types.HostedZone)

Source from the content-addressed store, hash-verified

366}
367
368func 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
394func UnexpandSelfAliases(records []dns.RR, zone *route53types.HostedZone, full bool) {
395 id := strings.Replace(*zone.Id, "/hostedzone/", "", 1)

Callers 3

importBindFunction · 0.85
createRecordsFunction · 0.85
instancesFunction · 0.85

Calls 1

fatalIfErrFunction · 0.70

Tested by

no test coverage detected