SSM¶
Utilities for working with AWS Systems Manager.
get_ssm_parameter ¶
get_ssm_parameter(
param_name: str, as_dict: Literal[True]
) -> Dict[str, Any]
get_ssm_parameter(
param_name: str, as_dict: Literal[False] = False
) -> str
get_ssm_parameter(param_name, as_dict=False)
Retrieves a SSM parameter value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
param_name
|
str
|
the SSM parameter key name |
required |
as_dict
|
bool
|
Return as dict. Defaults to False. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If there is no such key |
Returns:
| Type | Description |
|---|---|
Union[str, Dict[str, Any]]
|
The parameter value stored at the key name |
Source code in src/aibs_informatics_aws_utils/ssm.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
has_ssm_parameter ¶
has_ssm_parameter(param_name)
Check if an SSM parameter exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
param_name
|
str
|
The SSM parameter key name to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the parameter exists, False otherwise. |
Source code in src/aibs_informatics_aws_utils/ssm.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
put_ssm_parameter ¶
put_ssm_parameter(
param_name,
param_value,
param_type="String",
exists_ok=True,
)
Put or update parameter
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
param_name
|
str
|
Name of parameter |
required |
param_value
|
str
|
New value of parameter |
required |
param_type
|
ParameterTypeType
|
Type of parameter. Defaults to "String". |
'String'
|
exists_ok
|
bool
|
Allow overwrite if value exists. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
int
|
The version of the parameter |
Source code in src/aibs_informatics_aws_utils/ssm.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |