Skip to content

Commit 3bf8f61

Browse files
authored
fix(AppConfig): Updated AppConfig boto3 Client Timeout (#1870)
* Updated AppConfig boto3 Client Timeout * Reformatted with Black
1 parent 5e2e61b commit 3bf8f61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

samtranslator/feature_toggle/feature_toggle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import boto3
55
import logging
66

7+
from botocore.config import Config
8+
79
my_path = os.path.dirname(os.path.abspath(__file__))
810
sys.path.insert(0, my_path + "/..")
911

@@ -105,8 +107,11 @@ class FeatureToggleAppConfigConfigProvider(FeatureToggleConfigProvider):
105107

106108
def __init__(self, application_id, environment_id, configuration_profile_id):
107109
FeatureToggleConfigProvider.__init__(self)
108-
self.app_config_client = boto3.client("appconfig")
109110
try:
111+
# Lambda function has 120 seconds limit
112+
# (5 + 25) * 2, 60 seconds maximum timeout duration
113+
client_config = Config(connect_timeout=5, read_timeout=25, retries={"total_max_attempts": 2})
114+
self.app_config_client = boto3.client("appconfig", config=client_config)
110115
response = self.app_config_client.get_configuration(
111116
Application=application_id,
112117
Environment=environment_id,

0 commit comments

Comments
 (0)