@@ -59,6 +59,7 @@ def can_support_v2(provider_type: "IamHelper.IAMAuthenticationType") -> bool:
5959 IamHelper .IAMAuthenticationType .PROFILE ,
6060 IamHelper .IAMAuthenticationType .IAM_KEYS ,
6161 IamHelper .IAMAuthenticationType .IAM_KEYS_WITH_SESSION ,
62+ IamHelper .IAMAuthenticationType .PLUGIN ,
6263 )
6364 ) and IdpAuthHelper .get_pkg_version ("boto3" ) >= Version ("1.24.5" )
6465
@@ -72,6 +73,11 @@ def get_cluster_credentials_api_type(
7273 Returns an enum representing the Python SDK method to use for getting temporary IAM credentials.
7374 """
7475 _logger .debug ("Determining which Redshift API to use for retrieving temporary Redshift instance credentials" )
76+ FAILED_TO_USE_V2_API_ERROR_MSG : str = (
77+ "Environment does not meet requirements to use {} API. "
78+ "This could be due to the connection properties provided or the version of boto3 in use. "
79+ "Please try updating the boto3 version or consider setting group_federation connection parameter to False."
80+ )
7581
7682 if not info ._is_serverless :
7783 _logger .debug ("Redshift provisioned" )
@@ -82,7 +88,7 @@ def get_cluster_credentials_api_type(
8288 _logger .debug ("Provisioned cluster GetClusterCredentialsAPIType.IAM_V2" )
8389 return IamHelper .GetClusterCredentialsAPIType .IAM_V2
8490 else :
85- raise InterfaceError ("Authentication with plugin is not supported for group federation" )
91+ raise InterfaceError (FAILED_TO_USE_V2_API_ERROR_MSG . format ( "GetClusterCredentials V2 API" ) )
8692 elif not info .group_federation :
8793 _logger .debug ("Serverless cluster GetClusterCredentialsAPIType.SERVERLESS_V1" )
8894 return IamHelper .GetClusterCredentialsAPIType .SERVERLESS_V1
@@ -93,7 +99,7 @@ def get_cluster_credentials_api_type(
9399 _logger .debug ("Serverless cluster GetClusterCredentialsAPIType.IAM_V2" )
94100 return IamHelper .GetClusterCredentialsAPIType .IAM_V2
95101 else :
96- raise InterfaceError ("Authentication with plugin is not supported for group federation" )
102+ raise InterfaceError (FAILED_TO_USE_V2_API_ERROR_MSG . format ( "GetClusterCredentials V2 API" ) )
97103
98104 @staticmethod
99105 def set_iam_properties (info : RedshiftProperty ) -> RedshiftProperty :
0 commit comments