@@ -86,23 +86,33 @@ def populate_config(cls, values: Dict[str, Any]) -> Dict[str, Any]:
86
86
"""
87
87
# Search for legacy attributes and populate the connector configuration
88
88
# from them, if they exist.
89
- if (
90
- values .get ("aws_access_key_id" )
91
- and values .get ("aws_secret_access_key" )
92
- and values .get ("region_name" )
93
- ):
94
- logger .warning (
95
- "The `aws_access_key_id`, `aws_secret_access_key` and "
96
- "`region_name` AWS secrets store attributes are deprecated and "
97
- "will be removed in a future version of ZenML. Please use the "
98
- "`auth_method` and `auth_config` attributes instead."
99
- )
100
- values ["auth_method" ] = AWSAuthenticationMethods .SECRET_KEY
101
- values ["auth_config" ] = dict (
102
- aws_access_key_id = values .get ("aws_access_key_id" ),
103
- aws_secret_access_key = values .get ("aws_secret_access_key" ),
104
- region = values .get ("region_name" ),
105
- )
89
+ if values .get ("region_name" ):
90
+ if not values .get ("aws_access_key_id" ) or not values .get (
91
+ "aws_secret_access_key"
92
+ ):
93
+ logger .warning (
94
+ "The `region_name` AWS secrets store attribute is deprecated "
95
+ "and will be removed in a future version of ZenML. Please use "
96
+ "the `auth_method` and `auth_config` attributes instead. "
97
+ "Using an implicit authentication method for AWS Secrets."
98
+ )
99
+ values ["auth_method" ] = AWSAuthenticationMethods .IMPLICIT
100
+ values ["auth_config" ] = dict (
101
+ region = values .get ("region_name" ),
102
+ )
103
+ else :
104
+ logger .warning (
105
+ "The `aws_access_key_id`, `aws_secret_access_key` and "
106
+ "`region_name` AWS secrets store attributes are deprecated and "
107
+ "will be removed in a future version of ZenML. Please use the "
108
+ "`auth_method` and `auth_config` attributes instead."
109
+ )
110
+ values ["auth_method" ] = AWSAuthenticationMethods .SECRET_KEY
111
+ values ["auth_config" ] = dict (
112
+ aws_access_key_id = values .get ("aws_access_key_id" ),
113
+ aws_secret_access_key = values .get ("aws_secret_access_key" ),
114
+ region = values .get ("region_name" ),
115
+ )
106
116
107
117
return values
108
118
0 commit comments