Skip to content

Commit 67467d6

Browse files
committed
fix(credentials): user, password are not required when using AWS credentials or AWS profile
1 parent 4d4dba7 commit 67467d6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

redshift_connector/iam_helper.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,12 @@ def set_iam_properties(
185185
)
186186

187187
if not all((user, host, database, port, password)):
188-
raise InterfaceError(
189-
"Invalid connection property setting. "
190-
"user, password, host, database, port, and password are required."
191-
)
188+
if (profile is None) and (access_key_id is None):
189+
raise InterfaceError(
190+
"Invalid connection property setting. "
191+
"user, password, host, database and port are required "
192+
"when not using AWS credentials and AWS profile"
193+
)
192194

193195
if client_protocol_version not in ClientProtocolVersion.list():
194196
raise InterfaceError(

0 commit comments

Comments
 (0)