@@ -59,6 +59,7 @@ def can_support_v2(provider_type: "IamHelper.IAMAuthenticationType") -> bool:
59
59
IamHelper .IAMAuthenticationType .PROFILE ,
60
60
IamHelper .IAMAuthenticationType .IAM_KEYS ,
61
61
IamHelper .IAMAuthenticationType .IAM_KEYS_WITH_SESSION ,
62
+ IamHelper .IAMAuthenticationType .PLUGIN ,
62
63
)
63
64
) and IdpAuthHelper .get_pkg_version ("boto3" ) >= Version ("1.24.5" )
64
65
@@ -72,6 +73,11 @@ def get_cluster_credentials_api_type(
72
73
Returns an enum representing the Python SDK method to use for getting temporary IAM credentials.
73
74
"""
74
75
_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
+ )
75
81
76
82
if not info ._is_serverless :
77
83
_logger .debug ("Redshift provisioned" )
@@ -82,7 +88,7 @@ def get_cluster_credentials_api_type(
82
88
_logger .debug ("Provisioned cluster GetClusterCredentialsAPIType.IAM_V2" )
83
89
return IamHelper .GetClusterCredentialsAPIType .IAM_V2
84
90
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" ) )
86
92
elif not info .group_federation :
87
93
_logger .debug ("Serverless cluster GetClusterCredentialsAPIType.SERVERLESS_V1" )
88
94
return IamHelper .GetClusterCredentialsAPIType .SERVERLESS_V1
@@ -93,7 +99,7 @@ def get_cluster_credentials_api_type(
93
99
_logger .debug ("Serverless cluster GetClusterCredentialsAPIType.IAM_V2" )
94
100
return IamHelper .GetClusterCredentialsAPIType .IAM_V2
95
101
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" ) )
97
103
98
104
@staticmethod
99
105
def set_iam_properties (info : RedshiftProperty ) -> RedshiftProperty :
0 commit comments