@@ -125,6 +125,63 @@ def __init__(
125125 config = config ,
126126 )
127127
128+ def get_multiple ( # type: ignore[override]
129+ self ,
130+ path : str ,
131+ max_age : Optional [int ] = None ,
132+ transform : TransformOptions = None ,
133+ raise_on_transform_error : bool = False ,
134+ decrypt : Optional [bool ] = None ,
135+ force_fetch : bool = False ,
136+ recursive : bool = False ,
137+ ** sdk_options ,
138+ ) -> Union [Dict [str , str ], Dict [str , dict ], Dict [str , bytes ]]:
139+ """
140+ Retrieve multiple parameters based on a path prefix
141+
142+ Parameters
143+ ----------
144+ path: str
145+ Parameter path used to retrieve multiple parameters
146+ max_age: int, optional
147+ Maximum age of the cached value
148+ transform: str, optional
149+ Optional transformation of the parameter value. Supported values
150+ are "json" for JSON strings, "binary" for base 64 encoded
151+ values or "auto" which looks at the attribute key to determine the type.
152+ raise_on_transform_error: bool, optional
153+ Raises an exception if any transform fails, otherwise this will
154+ return a None value for each transform that failed
155+ force_fetch: bool, optional
156+ Force update even before a cached item has expired, defaults to False
157+ recursive: bool, optional
158+ If this should retrieve the parameter values recursively or not
159+ sdk_options: dict, optional
160+ Arguments that will be passed directly to the underlying API call
161+
162+ Raises
163+ ------
164+ GetParameterError
165+ When the parameter provider fails to retrieve parameter values for
166+ a given path.
167+ TransformParameterError
168+ When the parameter provider fails to transform a parameter value.
169+ """
170+
171+ # If max_age is not set, resolve it from the environment variable, defaulting to DEFAULT_MAX_AGE_SECS
172+ max_age = resolve_max_age (env = os .getenv (constants .PARAMETERS_MAX_AGE_ENV , DEFAULT_MAX_AGE_SECS ), choice = max_age )
173+
174+ # If decrypt is not set, resolve it from the environment variable, defaulting to False
175+ decrypt = resolve_truthy_env_var_choice (
176+ env = os .getenv (constants .PARAMETERS_SSM_DECRYPT_ENV , "false" ),
177+ choice = decrypt ,
178+ )
179+
180+ sdk_options ["decrypt" ] = decrypt
181+ sdk_options ["recursive" ] = recursive
182+
183+ return super ().get_multiple (path , max_age , transform , force_fetch , raise_on_transform_error , ** sdk_options )
184+
128185 # We break Liskov substitution principle due to differences in signatures of this method and superclass get method
129186 # We ignore mypy error, as changes to the signature here or in a superclass is a breaking change to users
130187 def get ( # type: ignore[override]
@@ -341,12 +398,6 @@ def _get_multiple(
341398 Dictionary of options that will be passed to the Parameter Store get_parameters_by_path API call
342399 """
343400
344- # If decrypt is not set, resolve it from the environment variable, defaulting to False
345- decrypt = resolve_truthy_env_var_choice (
346- env = os .getenv (constants .PARAMETERS_SSM_DECRYPT_ENV , "false" ),
347- choice = decrypt ,
348- )
349-
350401 # Explicit arguments will take precedence over keyword arguments
351402 sdk_options ["Path" ] = path
352403 sdk_options ["WithDecryption" ] = decrypt
@@ -788,14 +839,12 @@ def get_parameter(
788839 choice = decrypt ,
789840 )
790841
791- # Add to `decrypt` sdk_options to we can have an explicit option for this
792- sdk_options ["decrypt" ] = decrypt
793-
794842 return DEFAULT_PROVIDERS ["ssm" ].get (
795- name ,
843+ name = name ,
796844 max_age = max_age ,
797845 transform = transform ,
798846 force_fetch = force_fetch ,
847+ decrypt = decrypt ,
799848 ** sdk_options ,
800849 )
801850
@@ -928,15 +977,14 @@ def get_parameters(
928977 choice = decrypt ,
929978 )
930979
931- sdk_options ["recursive" ] = recursive
932- sdk_options ["decrypt" ] = decrypt
933-
934980 return DEFAULT_PROVIDERS ["ssm" ].get_multiple (
935- path ,
981+ path = path ,
936982 max_age = max_age ,
937983 transform = transform ,
938984 raise_on_transform_error = raise_on_transform_error ,
939985 force_fetch = force_fetch ,
986+ recursive = recursive ,
987+ decrypt = decrypt ,
940988 ** sdk_options ,
941989 )
942990
0 commit comments