-
Notifications
You must be signed in to change notification settings - Fork 1
Override Hostname for A/PTR record #5
Comments
|
Per @badra001 's email.
|
|
@badra001 - for this statement:
Do we want to still create 1 A record or 2? So if |
|
So running through all of the permutations, the logic below is what I am going to use to update the code. I'm writing this in python-like statement format but the syntax/logic will be little more complex 🙂 if boc:dns:name field is present AND boc:dns:zone is valid: elif boc:dns:name field is present AND boc:dns:zone is not valid: elif Name field is present and FQDN matches the VPC DHCP option elif boc:dns:zone present and valid else # this is the current *For CNAME (boc:dns:cname), it will create a CNAME to the field A record created above.
It's little convoluted to try to inject the logic to the where we want but let me know if above logic makes sense. I need to probably reshuffle some of the code. I am going to remove all of the commented out code (e.g. zone creation, public dns record check, etc) to make the code easier to decode. |
|
What we need is "hostname selection code", as function, to make the code easier to handle. It ultimately spits out
And then these can be added accordingly. |
|
@badra001 - I changed up the script considerably. It's not in the function format but I have streamlined the code. https://github.e.it.census.gov/terraform-modules/aws-dynamic-route53/tree/awspeter_version007 I've updated the file the branch above. Please take a look. I've put a comment at the top that explains the rough idea of what the script. Also, I've removed all of the commented out code that weren't being used. The code is pretty much the same as before but I've moved some parts around, put things into a if/elif/else format to make the logic more readable. And 1 statement that either creates the A/PTR or delete A/PTR record. And finally, the CNAME creation is only if the CNAME tag is valid. I've done all different permutation testing and it is working as I expected it. I can go ahead and attach the test result (from my lab). |
|
Per Don's email, change the logic
|
|
revision made in pull request |
|
Closing. This is completed. |
if "boc:dns:name" Tag is filled or "Name" tag is filled, use that field instead of the default ip-1-2-3-4 as the name.
The text was updated successfully, but these errors were encountered: