in source/state_machine_handler.py [0:0]
def _save_ssm_parameters(self, key, value, ssm_value):
"""Saves new paramter keys and values in the state machines input
to SSM Parameter Store
Args:
key: string. ssm parametr key
value: string. ssm parametr value
ssm_value: string. default to 'NotFound'
Return:
None
"""
if value.startswith('$[') and value.endswith(']'):
value = value[2:-1]
# Iterate through all the keys in the event
# (includes the nested keys)
for k, v in self.nested_dictionary_iteration(self.event):
if value.lower() == k.lower():
ssm_value = v
break
else:
ssm_value = 'NotFound'
if ssm_value == 'NotFound':
# Print error if the key is not found in the State Machine output.
# Handle scenario if only StackSet is created not stack instances.
self.logger.error("Unable to find the key: {} in the"
" State Machine Output".format(value))
else:
self.logger.info("Adding value for SSM Parameter Store"
" Key: {}".format(key))
self.ssm.put_parameter(key, ssm_value)