ciscops / Netbox_Route53

Lambda script to port ip/dns pairs from netbox to route53
1 stars 0 forks source link

Feature request: support subdomains #45

Open jermudgeon opened 2 years ago

jermudgeon commented 2 years ago

Currently, I cannot create valid subdomain A records inside a parent domain:

e.g. host.domain.tld < succeeds host.subdomain.domain.tld < fails, despite being valid DNS

Is it possible to add A records to the parent domain (if available) when the subdomain does not exist as a separate zone?

ppajersk commented 2 years ago

I'll investigate this further after the extended weekend. This might be possible, I don't remember any limitations in the api, and checking for presence of a zone is very possible. I can look into implementing this controlled by a flag, like "default to parent domain" that can be set in the env var of the lambda function.

jermudgeon commented 2 years ago

FWIW, I don't think a flag is required.

If subdomain exists, the expected behavior is to add subdomain records there.

For reference, I am currently using the NS-records method from here: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-routing-traffic-for-subdomains.html

…but my preferred use case would be to be able to choose whether or not to break subdomains out into separate zones, and have this plugin Do The Right Thing.

ppajersk commented 2 years ago

I'll chat with some co-workers about this and determine if this fits the original scope of the project, I see what you're saying. While you're right, a flag isn't absolutely necessary, there needs to be some medium of control so that this script still maintains its original use-case abilities, without too many external changes, ie...needs to be a seamless change that should just integrate right into the existing uses of the script.