Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hosted_zone missing records #356

Closed
eteterra-agworld opened this issue May 13, 2021 · 7 comments · Fixed by #811
Closed

hosted_zone missing records #356

eteterra-agworld opened this issue May 13, 2021 · 7 comments · Fixed by #811
Assignees

Comments

@eteterra-agworld
Copy link

eteterra-agworld commented May 13, 2021

I'd like to use aws_hosted_zone to check the records i've configured.

Describe the problem

  • my hosted zone has a total of 621 records
  • when I check the contents of aws_hosted_zone('acme.com.').record_names, I only see 110 records being returned
  • when i try to test using eg its('record_names') { should include "us-billing.acme.com." } it doesn't find the record, even though it's there when i check in the aws console
  • i would expect the hosted_zone(..).record_names size to equal 621, same as what I see in the aws console

Possible Solution

I would be happy to write some code if someone could get me started on where to look :)

@eteterra-agworld
Copy link
Author

eteterra-agworld commented May 22, 2021

digging into it a bit, from the aws route53 client:

... ListResourceRecordSets returns up to 300 resource record sets at a time

so the issue is at libraries/aws_hosted_zone.rb line 83:
resp = @aws.route53_client.list_resource_record_sets(hosted_zone_id: zone_id).

we'd have to check the responses isTruncated value and use the marker provided to keep making requests until we have fetched all the records.

looks like there's already an implementation of traversing responses with markers eg at libraries/aws_db_subnet_groups.rb. will attempt to write tests + code for the hosted zones resource so that it can do the same thing

@Williambrailey
Copy link

I am having a similar issue but its on a host with only 60 records, its only returning about 30 of them but the ones its not returning all have alias targets.
This might just be my error as have only just started using Inspec but thought I would flag it up just incase its helpful.

@ashokmnr
Copy link

I am having a similar issue with hosted_zone_id. It's only returning 4 record sets for me.

@Nirbhay1997 Nirbhay1997 self-assigned this Aug 17, 2021
@rdanilin
Copy link

Same here. Any plans to fix this issue?

@Nirbhay1997 Nirbhay1997 linked a pull request Jan 10, 2022 that will close this issue
7 tasks
@Nirbhay1997
Copy link
Contributor

Closing as fixed

@rdanilin
Copy link

rdanilin commented Apr 1, 2022

@Nirbhay1997 seems like the issue was not fixed.
Could we re-open this ticket?

@mwiczynski-cartera
Copy link

This is not fixed by #811 That PR only changed aws_hosted_zones. aws_hosted_zone is still broken, not returning all records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants