Skip to content

Commit c1c6230

Browse files
committed
Add multi-AZ support for datalake
Signed-off-by: Jim Enright <jenright@cloudera.com>
1 parent 947bc60 commit c1c6230

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

plugins/modules/datalake.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@
139139
type: bool
140140
required: False
141141
default: False
142+
multi_az:
143+
description:
144+
- Flag indicating if the datalake is deployed across multi-availability zones.
145+
- Only applies to AWS datalakes.
146+
type: bool
147+
required: False
148+
default: False
142149
extends_documentation_fragment:
143150
- cloudera.cloud.cdp_sdk_options
144151
- cloudera.cloud.cdp_auth_options
@@ -405,6 +412,7 @@ def __init__(self, module):
405412
self.timeout = self._get_param('timeout')
406413
self.force = self._get_param('force')
407414
self.raz = self._get_param("raz")
415+
self.multi_az = self._get_param("multi_az")
408416

409417
# Initialize the return values
410418
self.datalake = dict()
@@ -556,6 +564,14 @@ def _configure_payload(self, environment):
556564
elif environment['cloudPlatform'] != 'GCP' :
557565
payload.update(enableRangerRaz=self.raz)
558566

567+
if self.multi_az:
568+
if environment['cloudPlatform'] == 'AWS':
569+
payload.update(multiAz=self.multi_az)
570+
else:
571+
self.module.fail_json(msg='Multi-AZ Datalakes are not supported on GCP and Azure')
572+
elif environment['cloudPlatform'] == 'AWS':
573+
payload.update(multiAz=self.multi_az)
574+
559575
if self.tags is not None:
560576
payload['tags'] = list()
561577
for k in self.tags:
@@ -601,6 +617,12 @@ def _reconcile_existing_state(self, existing):
601617
"need to change the enableRangerRaz, explicitly delete "
602618
"and recreate the Datalake.")
603619

620+
if self.multi_az:
621+
self.module.warn("Updating an existing Datalake's 'multiAz' "
622+
"directly is not supported at this time. If you "
623+
"need to change the multiAz, explicitly delete "
624+
"and recreate the Datalake.")
625+
604626
return mismatched
605627

606628
def _validate_datalake_name(self):
@@ -629,7 +651,8 @@ def main():
629651
wait=dict(required=False, type='bool', default=True),
630652
delay=dict(required=False, type='int', aliases=['polling_delay'], default=15),
631653
timeout=dict(required=False, type='int', aliases=['polling_timeout'], default=3600),
632-
raz=dict(required=False, type="bool", default=False)
654+
raz=dict(required=False, type="bool", default=False),
655+
multi_az=dict(required=False, type="bool", default=False)
633656
),
634657
supports_check_mode=True
635658
)

0 commit comments

Comments
 (0)