Skip to content

Commit 9dec15f

Browse files
authored
Add support for endpointaccessgateway for AWS (#15)
* Add support for endpointaccessgateway for AWS Signed-off-by: guruchai <ggchaitanya@gmail.com> * Fixing the error. Signed-off-by: guruchai <ggchaitanya@gmail.com> * Improved documentation Signed-off-by: guruchai <ggchaitanya@gmail.com>
1 parent 259e160 commit 9dec15f

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

plugins/modules/env.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,21 @@
248248
aliases:
249249
- s3_guard
250250
- s3_guard_table_name
251+
endpoint_access_scheme:
252+
description:
253+
- (AWS)The scheme for the workload endpoint gateway. PUBLIC creates an external endpoint that can be accessed over the Internet.
254+
Defaults to PRIVATE which restricts the traffic to be internal to the VPC / Vnet. Relevant in Private Networks.
255+
type: str
256+
choices:
257+
- PRIVATE
258+
- PUBLIC
259+
required: False
260+
endpoint_access_subnets:
261+
description:
262+
- (AWS) The list of subnet IDs to use for endpoint access gateway.
263+
type: list
264+
elements: str
265+
required: False
251266
extends_documentation_fragment:
252267
- cloudera.cloud.cdp_sdk_options
253268
- cloudera.cloud.cdp_auth_options
@@ -655,6 +670,9 @@ def __init__(self, module):
655670
self.cascade = self._get_param('cascade', False)
656671
self.wait = self._get_param('wait', False)
657672

673+
self.endpoint_access_scheme = self._get_param('endpoint_access_scheme')
674+
self.endpoint_access_subnets = self._get_param('endpoint_access_subnets')
675+
658676
# Initialize the return values
659677
self.environment = dict()
660678

@@ -861,6 +879,10 @@ def _configure_payload(self):
861879
else:
862880
payload['securityAccess'] = dict(defaultSecurityGroupId=self.default_sg,
863881
securityGroupIdForKnox=self.knox_sg)
882+
883+
if self.endpoint_access_scheme == 'PUBLIC':
884+
payload['endpointAccessGatewayScheme'] = self.endpoint_access_scheme
885+
payload['endpointAccessGatewaySubnetIds'] = self.endpoint_access_subnets
864886
elif self.cloud == 'gcp':
865887
payload['publicKey'] = self.public_key_text
866888
payload['existingNetworkParams'] = dict(
@@ -999,7 +1021,10 @@ def main():
9991021
force=dict(required=False, type='bool', default=False),
10001022
wait=dict(required=False, type='bool', default=True),
10011023
delay=dict(required=False, type='int', aliases=['polling_delay'], default=15),
1002-
timeout=dict(required=False, type='int', aliases=['polling_timeout'], default=3600)
1024+
timeout=dict(required=False, type='int', aliases=['polling_timeout'], default=3600),
1025+
endpoint_access_subnets=dict(required=False, type='list', elements='str'),
1026+
endpoint_access_scheme=dict(required=False, type='str', choices=['PUBLIC', 'PRIVATE'])
1027+
10031028
),
10041029
# TODO: Update for Azure
10051030
required_if=[

0 commit comments

Comments
 (0)