File tree 6 files changed +39
-27
lines changed
aws_lambda_powertools/utilities/parameters
6 files changed +39
-27
lines changed Original file line number Diff line number Diff line change 15
15
resolve_env_var_choice ,
16
16
resolve_max_age ,
17
17
)
18
+ from aws_lambda_powertools .utilities .parameters .base import BaseProvider
19
+ from aws_lambda_powertools .utilities .parameters .constants import DEFAULT_MAX_AGE_SECS , DEFAULT_PROVIDERS
18
20
from aws_lambda_powertools .warnings import PowertoolsDeprecationWarning
19
21
20
- from .base import DEFAULT_MAX_AGE_SECS , DEFAULT_PROVIDERS , BaseProvider
21
-
22
22
if TYPE_CHECKING :
23
23
from botocore .config import Config
24
24
from mypy_boto3_appconfigdata .client import AppConfigDataClient
Original file line number Diff line number Diff line change 4
4
5
5
from __future__ import annotations
6
6
7
- import base64
8
- import json
9
7
import os
10
8
from abc import ABC , abstractmethod
11
9
from datetime import datetime , timedelta
19
17
if TYPE_CHECKING :
20
18
from aws_lambda_powertools .utilities .parameters .types import TransformOptions
21
19
22
- DEFAULT_MAX_AGE_SECS = "300"
23
-
24
- # These providers will be dynamically initialized on first use of the helper functions
25
- DEFAULT_PROVIDERS : dict [str , Any ] = {}
26
- TRANSFORM_METHOD_JSON = "json"
27
- TRANSFORM_METHOD_BINARY = "binary"
28
- SUPPORTED_TRANSFORM_METHODS = [TRANSFORM_METHOD_JSON , TRANSFORM_METHOD_BINARY ]
29
-
30
- TRANSFORM_METHOD_MAPPING = {
31
- TRANSFORM_METHOD_JSON : json .loads ,
32
- TRANSFORM_METHOD_BINARY : base64 .b64decode ,
33
- ".json" : json .loads ,
34
- ".binary" : base64 .b64decode ,
35
- None : lambda x : x ,
36
- }
20
+
21
+ from aws_lambda_powertools .utilities .parameters .constants import (
22
+ DEFAULT_MAX_AGE_SECS ,
23
+ DEFAULT_PROVIDERS ,
24
+ TRANSFORM_METHOD_MAPPING ,
25
+ )
37
26
38
27
39
28
class ExpirableValue (NamedTuple ):
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ import base64
4
+ import json
5
+ from typing import Any , Literal
6
+
7
+ SSM_PARAMETER_TYPES = Literal ["String" , "StringList" , "SecureString" ]
8
+ SSM_PARAMETER_TIER = Literal ["Standard" , "Advanced" , "Intelligent-Tiering" ]
9
+
10
+ DEFAULT_MAX_AGE_SECS = "300"
11
+
12
+ # These providers will be dynamically initialized on first use of the helper functions
13
+ DEFAULT_PROVIDERS : dict [str , Any ] = {}
14
+ TRANSFORM_METHOD_JSON = "json"
15
+ TRANSFORM_METHOD_BINARY = "binary"
16
+ TRANSFORM_METHOD_MAPPING = {
17
+ TRANSFORM_METHOD_JSON : json .loads ,
18
+ TRANSFORM_METHOD_BINARY : base64 .b64decode ,
19
+ ".json" : json .loads ,
20
+ ".binary" : base64 .b64decode ,
21
+ None : lambda x : x ,
22
+ }
Original file line number Diff line number Diff line change 10
10
import boto3
11
11
from boto3 .dynamodb .conditions import Key
12
12
13
+ from aws_lambda_powertools .utilities .parameters .base import BaseProvider
13
14
from aws_lambda_powertools .warnings import PowertoolsDeprecationWarning
14
15
15
- from .base import BaseProvider
16
-
17
16
if TYPE_CHECKING :
18
17
from botocore .config import Config
19
18
from mypy_boto3_dynamodb .service_resource import DynamoDBServiceResource
Original file line number Diff line number Diff line change 15
15
from aws_lambda_powertools .shared import constants
16
16
from aws_lambda_powertools .shared .functions import resolve_max_age
17
17
from aws_lambda_powertools .shared .json_encoder import Encoder
18
- from aws_lambda_powertools .utilities .parameters .base import DEFAULT_MAX_AGE_SECS , DEFAULT_PROVIDERS , BaseProvider
18
+ from aws_lambda_powertools .utilities .parameters .base import BaseProvider
19
+ from aws_lambda_powertools .utilities .parameters .constants import DEFAULT_MAX_AGE_SECS , DEFAULT_PROVIDERS
19
20
from aws_lambda_powertools .utilities .parameters .exceptions import SetSecretError
20
21
from aws_lambda_powertools .warnings import PowertoolsDeprecationWarning
21
22
Original file line number Diff line number Diff line change 18
18
slice_dictionary ,
19
19
)
20
20
from aws_lambda_powertools .utilities .parameters .base import (
21
- DEFAULT_MAX_AGE_SECS ,
22
- DEFAULT_PROVIDERS ,
23
21
BaseProvider ,
24
22
transform_value ,
25
23
)
24
+ from aws_lambda_powertools .utilities .parameters .constants import (
25
+ DEFAULT_MAX_AGE_SECS ,
26
+ DEFAULT_PROVIDERS ,
27
+ SSM_PARAMETER_TIER ,
28
+ SSM_PARAMETER_TYPES ,
29
+ )
26
30
from aws_lambda_powertools .utilities .parameters .exceptions import GetParameterError , SetParameterError
27
31
from aws_lambda_powertools .warnings import PowertoolsDeprecationWarning
28
32
33
37
34
38
from aws_lambda_powertools .utilities .parameters .types import TransformOptions
35
39
36
- SSM_PARAMETER_TYPES = Literal ["String" , "StringList" , "SecureString" ]
37
- SSM_PARAMETER_TIER = Literal ["Standard" , "Advanced" , "Intelligent-Tiering" ]
38
-
39
40
logger = logging .getLogger (__name__ )
40
41
41
42
You can’t perform that action at this time.
0 commit comments