mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
Terraform: Make private Cloud DNS GA (#224)
<!-- This change is generated by MagicModules. --> /cc @drebes
This commit is contained in:
parent
83cfad1e1b
commit
e2464b7687
2 changed files with 99 additions and 2 deletions
|
@ -73,6 +73,35 @@ options:
|
||||||
- A set of key/value label pairs to assign to this ManagedZone.
|
- A set of key/value label pairs to assign to this ManagedZone.
|
||||||
required: false
|
required: false
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
|
visibility:
|
||||||
|
description:
|
||||||
|
- 'The zone''s visibility: public zones are exposed to the Internet, while private
|
||||||
|
zones are visible only to Virtual Private Cloud resources.'
|
||||||
|
- 'Must be one of: `public`, `private`.'
|
||||||
|
required: false
|
||||||
|
default: public
|
||||||
|
version_added: 2.8
|
||||||
|
choices:
|
||||||
|
- private
|
||||||
|
- public
|
||||||
|
private_visibility_config:
|
||||||
|
description:
|
||||||
|
- For privately visible zones, the set of Virtual Private Cloud resources that
|
||||||
|
the zone is visible from.
|
||||||
|
required: false
|
||||||
|
version_added: 2.8
|
||||||
|
suboptions:
|
||||||
|
networks:
|
||||||
|
description:
|
||||||
|
- The list of VPC networks that can see this zone.
|
||||||
|
required: false
|
||||||
|
suboptions:
|
||||||
|
network_url:
|
||||||
|
description:
|
||||||
|
- The fully qualified URL of the VPC network to bind to.
|
||||||
|
- This should be formatted like `U(https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`)
|
||||||
|
.
|
||||||
|
required: false
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
notes:
|
notes:
|
||||||
- 'API Reference: U(https://cloud.google.com/dns/api/v1/managedZones)'
|
- 'API Reference: U(https://cloud.google.com/dns/api/v1/managedZones)'
|
||||||
|
@ -138,6 +167,33 @@ labels:
|
||||||
- A set of key/value label pairs to assign to this ManagedZone.
|
- A set of key/value label pairs to assign to this ManagedZone.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
|
visibility:
|
||||||
|
description:
|
||||||
|
- 'The zone''s visibility: public zones are exposed to the Internet, while private
|
||||||
|
zones are visible only to Virtual Private Cloud resources.'
|
||||||
|
- 'Must be one of: `public`, `private`.'
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
|
privateVisibilityConfig:
|
||||||
|
description:
|
||||||
|
- For privately visible zones, the set of Virtual Private Cloud resources that the
|
||||||
|
zone is visible from.
|
||||||
|
returned: success
|
||||||
|
type: complex
|
||||||
|
contains:
|
||||||
|
networks:
|
||||||
|
description:
|
||||||
|
- The list of VPC networks that can see this zone.
|
||||||
|
returned: success
|
||||||
|
type: complex
|
||||||
|
contains:
|
||||||
|
networkUrl:
|
||||||
|
description:
|
||||||
|
- The fully qualified URL of the VPC network to bind to.
|
||||||
|
- This should be formatted like `U(https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`)
|
||||||
|
.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -163,6 +219,8 @@ def main():
|
||||||
name=dict(required=True, type='str'),
|
name=dict(required=True, type='str'),
|
||||||
name_server_set=dict(type='str'),
|
name_server_set=dict(type='str'),
|
||||||
labels=dict(type='dict'),
|
labels=dict(type='dict'),
|
||||||
|
visibility=dict(default='public', type='str', choices=['private', 'public']),
|
||||||
|
private_visibility_config=dict(type='dict', options=dict(networks=dict(type='list', elements='dict', options=dict(network_url=dict(type='str'))))),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -208,7 +266,11 @@ def update(module, link, kind, fetch):
|
||||||
|
|
||||||
|
|
||||||
def update_fields(module, request, response):
|
def update_fields(module, request, response):
|
||||||
if response.get('description') != request.get('description') or response.get('labels') != request.get('labels'):
|
if (
|
||||||
|
response.get('description') != request.get('description')
|
||||||
|
or response.get('labels') != request.get('labels')
|
||||||
|
or response.get('privateVisibilityConfig') != request.get('privateVisibilityConfig')
|
||||||
|
):
|
||||||
description_update(module, request, response)
|
description_update(module, request, response)
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,7 +278,11 @@ def description_update(module, request, response):
|
||||||
auth = GcpSession(module, 'dns')
|
auth = GcpSession(module, 'dns')
|
||||||
auth.patch(
|
auth.patch(
|
||||||
''.join(["https://www.googleapis.com/dns/v1/", "projects/{project}/managedZones/{name}"]).format(**module.params),
|
''.join(["https://www.googleapis.com/dns/v1/", "projects/{project}/managedZones/{name}"]).format(**module.params),
|
||||||
{u'description': module.params.get('description'), u'labels': module.params.get('labels')},
|
{
|
||||||
|
u'description': module.params.get('description'),
|
||||||
|
u'labels': module.params.get('labels'),
|
||||||
|
u'privateVisibilityConfig': ManagedZonePrivatevisibilityconfig(module.params.get('private_visibility_config', {}), module).to_request(),
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -233,6 +299,8 @@ def resource_to_request(module):
|
||||||
u'name': module.params.get('name'),
|
u'name': module.params.get('name'),
|
||||||
u'nameServerSet': module.params.get('name_server_set'),
|
u'nameServerSet': module.params.get('name_server_set'),
|
||||||
u'labels': module.params.get('labels'),
|
u'labels': module.params.get('labels'),
|
||||||
|
u'visibility': module.params.get('visibility'),
|
||||||
|
u'privateVisibilityConfig': ManagedZonePrivatevisibilityconfig(module.params.get('private_visibility_config', {}), module).to_request(),
|
||||||
}
|
}
|
||||||
return_vals = {}
|
return_vals = {}
|
||||||
for k, v in request.items():
|
for k, v in request.items():
|
||||||
|
@ -306,6 +374,8 @@ def response_to_hash(module, response):
|
||||||
u'nameServerSet': response.get(u'nameServerSet'),
|
u'nameServerSet': response.get(u'nameServerSet'),
|
||||||
u'creationTime': response.get(u'creationTime'),
|
u'creationTime': response.get(u'creationTime'),
|
||||||
u'labels': response.get(u'labels'),
|
u'labels': response.get(u'labels'),
|
||||||
|
u'visibility': response.get(u'visibility'),
|
||||||
|
u'privateVisibilityConfig': ManagedZonePrivatevisibilityconfig(response.get(u'privateVisibilityConfig', {}), module).from_response(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,33 @@ items:
|
||||||
- A set of key/value label pairs to assign to this ManagedZone.
|
- A set of key/value label pairs to assign to this ManagedZone.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
|
visibility:
|
||||||
|
description:
|
||||||
|
- 'The zone''s visibility: public zones are exposed to the Internet, while private
|
||||||
|
zones are visible only to Virtual Private Cloud resources.'
|
||||||
|
- 'Must be one of: `public`, `private`.'
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
|
privateVisibilityConfig:
|
||||||
|
description:
|
||||||
|
- For privately visible zones, the set of Virtual Private Cloud resources that
|
||||||
|
the zone is visible from.
|
||||||
|
returned: success
|
||||||
|
type: complex
|
||||||
|
contains:
|
||||||
|
networks:
|
||||||
|
description:
|
||||||
|
- The list of VPC networks that can see this zone.
|
||||||
|
returned: success
|
||||||
|
type: complex
|
||||||
|
contains:
|
||||||
|
networkUrl:
|
||||||
|
description:
|
||||||
|
- The fully qualified URL of the VPC network to bind to.
|
||||||
|
- This should be formatted like `U(https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`)
|
||||||
|
.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
Loading…
Add table
Reference in a new issue