AWS Parameter Store
Bases: PluginResolver
, AWSParameterStoreMixin
Resolver for AWS Systems Manager Parameter Store
Methods:
Name | Description |
---|---|
__init__ |
Initializes the resolver with a boto3 Session. If no Session is provided, it'll be infered from the default credentials, if configured. |
__call__ |
Resolves the secret by its name and returns the decoded secret data. |
Example
Example 1: Retrieve a secret as a string providing a custom session
>>> resolver = AWSParameterStoreResolver(session=boto3_session)
>>> parameter_value = resolver('my/parameter/name') # Contains 1 value
>>> print(parameter_value)
>>> resolver = AWSParameterStoreResolver(infer_types=True)
>>> parameter_value = resolver('my/parameter/list/name') # Contains 1 value
>>> print(parameter_value)
>>> resolver = AWSParameterStoreResolver()
>>> parameter_value = resolver('my/parameter/family/*')
>>> print(parameter_value)
>>> resolver = AWSParameterStoreResolver()
>>> parameter_value = resolver('my/parameter/family/**')
>>> print(parameter_value)
Source code in omegaconf_cloud_resolvers/resolvers/aws/parameterstore.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
__call__(name)
Retrieves a parameter from AWS Systems Manager Parameter Store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the parameter to retrieve. Retrieve a single parameter, |
required |
Returns:
Type | Description |
---|---|
JsonType
|
The parameter value. If the parameter is a StringList and _decrypt is False, it returns a list of strings or numbers (if _infer_types is True). Otherwise, it returns the parameter value as a string, int, or float depending on the type inference. |
Source code in omegaconf_cloud_resolvers/resolvers/aws/parameterstore.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
__init__(session=None, decrypt=True, infer_types=False, *args, **kwargs)
Initializes the AWSParameterStoreResolver.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session |
Session
|
An optional boto3 session to use for AWS interactions. |
None
|
decrypt |
bool
|
If True, attempts to decrypt SecureString parameters. |
True
|
infer_types |
bool
|
If True, attempts to infer the type of the parameter value, it might be more useful when the parameter is of type StringList if mixed types are found. |
False
|
Source code in omegaconf_cloud_resolvers/resolvers/aws/parameterstore.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|