mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add check to require vpc_id and vpc_region for private zones
Add parameter documentation for create_zone function
This commit is contained in:
parent
f3203f4037
commit
cd63dc4dc1
@ -55,6 +55,7 @@ import time
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
import salt.utils.odict as odict
|
||||
from salt.exceptions import SaltInvocationError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -145,6 +146,30 @@ def create_zone(zone, private=False, vpc_id=None, vpc_region=None, region=None,
|
||||
|
||||
.. versionadded:: 2015.8.0
|
||||
|
||||
zone
|
||||
DNZ zone to create
|
||||
|
||||
private
|
||||
True/False if the zone will be a private zone
|
||||
|
||||
vpc_id
|
||||
VPC ID to associate the zone to (required if private is True)
|
||||
|
||||
vpc_region
|
||||
VPC Region (required if private is True)
|
||||
|
||||
region
|
||||
region endpoint to connect to
|
||||
|
||||
key
|
||||
AWS key
|
||||
|
||||
keyid
|
||||
AWS keyid
|
||||
|
||||
profile
|
||||
AWS pillar profile
|
||||
|
||||
CLI Example::
|
||||
|
||||
salt myminion boto_route53.create_zone example.org
|
||||
@ -152,6 +177,11 @@ def create_zone(zone, private=False, vpc_id=None, vpc_region=None, region=None,
|
||||
if region is None:
|
||||
region = 'universal'
|
||||
|
||||
if private:
|
||||
if not vpc_id and not vpc_region:
|
||||
msg = 'vpc_id and vpc_region must be specified for a private zone'
|
||||
raise SaltInvocationError(msg)
|
||||
|
||||
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
|
||||
|
||||
_zone = conn.get_zone(zone)
|
||||
|
Loading…
Reference in New Issue
Block a user