Util (secret_config v1.0.0)
Utility functions for processing configuration data, including parsing YAML strings, applying local imports, and handling AWS SSM parameters.
Link to this section Summary
Functions
Applies imports from SSM parameters into the initial configuration map.
Applies local import rules to a configuration map, handling special keys for import directives.
Constructs a full key by combining the environment prefix and the specific key.
Recursively constructs a map from YAML data, transforming nested structures into a flattened path map.
Converts a YAML string into a nested map, applying EEx evaluation with bindings from the application configuration.
Link to this section Functions
apply_imports(init_map, app_prefix)
Specs
Applies imports from SSM parameters into the initial configuration map.
Parameters
- init_map: The initial configuration map before imports.
- app_prefix: A prefix used to scope the SSM parameter imports.
Returns
- A configuration map with SSM imports applied.
apply_local_imports(map)
Specs
Applies local import rules to a configuration map, handling special keys for import directives.
Parameters
- map: The initial configuration map.
Returns
- A modified map with local imports applied.
full_key(env, key)
Specs
Constructs a full key by combining the environment prefix and the specific key.
Parameters
- env: The environment name or prefix.
- key: The specific configuration key.
Returns
- A string representing the full key path.
pathize_map(yaml_map, prefix, path_map)
Specs
Recursively constructs a map from YAML data, transforming nested structures into a flattened path map.
Parameters
- yaml_map: The nested map obtained from YAML parsing.
- prefix: The current path prefix, used for recursion.
- path_map: The accumulator for the flattened path map.
Returns
- A flattened path map representing the YAML structure.
ssm_parameter_map(map, next_token, first_run, path)
Specs
yaml_str_to_map(yaml_str)
Specs
Converts a YAML string into a nested map, applying EEx evaluation with bindings from the application configuration.
Parameters
- yaml_str: The YAML string to be converted.
Returns
- A map representing the YAML structure with paths as keys.