Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Fix route53 hosted zone pagination issue (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
sschwebler authored Jan 13, 2023
1 parent 8fcf0c0 commit e60d832
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Empty file added config.yml
Empty file.
19 changes: 15 additions & 4 deletions resources/route53-hosted-zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@ func init() {
func ListRoute53HostedZones(sess *session.Session) ([]Resource, error) {
svc := route53.New(sess)

var hostedZones []*route53.HostedZone
params := &route53.ListHostedZonesInput{}
resp, err := svc.ListHostedZones(params)
if err != nil {
return nil, err

for {
resp, err := svc.ListHostedZones(params)
if err != nil {
return nil, err
}

hostedZones = append(hostedZones, resp.HostedZones...)

params.Marker = resp.NextMarker
if aws.StringValue(params.Marker) == "" {
break
}
}

resources := make([]Resource, 0)
for _, hz := range resp.HostedZones {
for _, hz := range hostedZones {
tags, err := svc.ListTagsForResource(&route53.ListTagsForResourceInput{
ResourceId: hz.Id,
ResourceType: aws.String("hostedzone"),
Expand Down

0 comments on commit e60d832

Please sign in to comment.