This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 06b19eb8b0 Fix `RedshiftCreateClusterOperator` to always specify
`PubliclyAccessible` (#40872)
06b19eb8b0 is described below
commit 06b19eb8b099ba192d8bdb9877e784221ca6297d
Author: Vincent <[email protected]>
AuthorDate: Thu Jul 18 15:56:39 2024 -0400
Fix `RedshiftCreateClusterOperator` to always specify `PubliclyAccessible`
(#40872)
---
airflow/providers/amazon/aws/operators/redshift_cluster.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/airflow/providers/amazon/aws/operators/redshift_cluster.py
b/airflow/providers/amazon/aws/operators/redshift_cluster.py
index 107a2cc5d6..f31b7db09a 100644
--- a/airflow/providers/amazon/aws/operators/redshift_cluster.py
+++ b/airflow/providers/amazon/aws/operators/redshift_cluster.py
@@ -256,8 +256,6 @@ class RedshiftCreateClusterOperator(BaseOperator):
params["ClusterVersion"] = self.cluster_version
if self.allow_version_upgrade:
params["AllowVersionUpgrade"] = self.allow_version_upgrade
- if self.publicly_accessible:
- params["PubliclyAccessible"] = self.publicly_accessible
if self.encrypted:
params["Encrypted"] = self.encrypted
if self.hsm_client_certificate_identifier:
@@ -287,6 +285,10 @@ class RedshiftCreateClusterOperator(BaseOperator):
if self.default_iam_role_arn:
params["DefaultIamRoleArn"] = self.default_iam_role_arn
+ # PubliclyAccessible is True by default on Redshift side, hence, we
should always set it regardless
+ # of its value
+ params["PubliclyAccessible"] = self.publicly_accessible
+
cluster = redshift_hook.create_cluster(
self.cluster_identifier,
self.node_type,