@@ -92,6 +92,7 @@ def get(
9292 max_age : int = DEFAULT_MAX_AGE_SECS ,
9393 transform : Optional [str ] = None ,
9494 decrypt : bool = False ,
95+ force_fetch : bool = False ,
9596 ** sdk_options
9697 ) -> Union [str , list , dict , bytes ]:
9798 """
@@ -109,6 +110,8 @@ def get(
109110 values.
110111 decrypt: bool, optional
111112 If the parameter value should be decrypted
113+ force_fetch: bool, optional
114+ Force update even before a cached item has expired, defaults to False
112115 sdk_options: dict, optional
113116 Arguments that will be passed directly to the underlying API call
114117
@@ -124,7 +127,7 @@ def get(
124127 # Add to `decrypt` sdk_options to we can have an explicit option for this
125128 sdk_options ["decrypt" ] = decrypt
126129
127- return super ().get (name , max_age , transform , ** sdk_options )
130+ return super ().get (name , max_age , transform , force_fetch , ** sdk_options )
128131
129132 def _get (self , name : str , decrypt : bool = False , ** sdk_options ) -> str :
130133 """
@@ -185,7 +188,7 @@ def _get_multiple(self, path: str, decrypt: bool = False, recursive: bool = Fals
185188
186189
187190def get_parameter (
188- name : str , transform : Optional [str ] = None , decrypt : bool = False , ** sdk_options
191+ name : str , transform : Optional [str ] = None , decrypt : bool = False , force_fetch : bool = False , ** sdk_options
189192) -> Union [str , list , dict , bytes ]:
190193 """
191194 Retrieve a parameter value from AWS Systems Manager (SSM) Parameter Store
@@ -198,6 +201,8 @@ def get_parameter(
198201 Transforms the content from a JSON object ('json') or base64 binary string ('binary')
199202 decrypt: bool, optional
200203 If the parameter values should be decrypted
204+ force_fetch: bool, optional
205+ Force update even before a cached item has expired, defaults to False
201206 sdk_options: dict, optional
202207 Dictionary of options that will be passed to the Parameter Store get_parameter API call
203208
@@ -237,11 +242,16 @@ def get_parameter(
237242 # Add to `decrypt` sdk_options to we can have an explicit option for this
238243 sdk_options ["decrypt" ] = decrypt
239244
240- return DEFAULT_PROVIDERS ["ssm" ].get (name , transform = transform , ** sdk_options )
245+ return DEFAULT_PROVIDERS ["ssm" ].get (name , transform = transform , force_fetch = force_fetch , ** sdk_options )
241246
242247
243248def get_parameters (
244- path : str , transform : Optional [str ] = None , recursive : bool = True , decrypt : bool = False , ** sdk_options
249+ path : str ,
250+ transform : Optional [str ] = None ,
251+ recursive : bool = True ,
252+ decrypt : bool = False ,
253+ force_fetch : bool = False ,
254+ ** sdk_options
245255) -> Union [Dict [str , str ], Dict [str , dict ], Dict [str , bytes ]]:
246256 """
247257 Retrieve multiple parameter values from AWS Systems Manager (SSM) Parameter Store
@@ -256,6 +266,8 @@ def get_parameters(
256266 If this should retrieve the parameter values recursively or not, defaults to True
257267 decrypt: bool, optional
258268 If the parameter values should be decrypted
269+ force_fetch: bool, optional
270+ Force update even before a cached item has expired, defaults to False
259271 sdk_options: dict, optional
260272 Dictionary of options that will be passed to the Parameter Store get_parameters_by_path API call
261273
@@ -295,4 +307,4 @@ def get_parameters(
295307 sdk_options ["recursive" ] = recursive
296308 sdk_options ["decrypt" ] = decrypt
297309
298- return DEFAULT_PROVIDERS ["ssm" ].get_multiple (path , transform = transform , ** sdk_options )
310+ return DEFAULT_PROVIDERS ["ssm" ].get_multiple (path , transform = transform , force_fetch = force_fetch , ** sdk_options )
0 commit comments