route53 module currently does not allow zone creation.
Starting on line 216:
Get all the existing hosted zones and save their ID’s |
- |
zones = {} |
results = conn.get_all_hosted_zones() |
for r53zone in results[‘ListHostedZonesResponse’][‘HostedZones’]: |
zone_id = r53zone[‘Id’].replace(‘/hostedzone/’, ‘’) |
zones[r53zone[‘Name’]] = zone_id |
# Verify that the requested zone is already defined in Route53 |
if not zone_in in zones: |
errmsg = “Zone %s does not exist in Route53” % zone_in |
module.fail_json(msg = errmsg)
It seems it would be easy to modify this to allow creation of zones if they don’t exist. Is it a design choice to not allow this, or would a pull request be considered? It would be particularly useful for creating private zones (added to aws in Nov 2014) where you don’t need to register the private domain names so there is no issue about owning the zone names you are trying to create. |
Create a new Hosted Zone. Returns a Python data structure with information about the newly created Hosted Zone.
- |