diff --git a/samtranslator/feature_toggle/feature_toggle.py b/samtranslator/feature_toggle/feature_toggle.py index 510966856..b1dc736e8 100644 --- a/samtranslator/feature_toggle/feature_toggle.py +++ b/samtranslator/feature_toggle/feature_toggle.py @@ -4,6 +4,8 @@ import boto3 import logging +from botocore.config import Config + my_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, my_path + "/..") @@ -105,8 +107,11 @@ class FeatureToggleAppConfigConfigProvider(FeatureToggleConfigProvider): def __init__(self, application_id, environment_id, configuration_profile_id): FeatureToggleConfigProvider.__init__(self) - self.app_config_client = boto3.client("appconfig") try: + # Lambda function has 120 seconds limit + # (5 + 25) * 2, 60 seconds maximum timeout duration + client_config = Config(connect_timeout=5, read_timeout=25, retries={"total_max_attempts": 2}) + self.app_config_client = boto3.client("appconfig", config=client_config) response = self.app_config_client.get_configuration( Application=application_id, Environment=environment_id,