File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,17 @@ def get_api_key() -> str:
101101 elif DD_API_KEY_SSM_NAME :
102102 # SSM endpoints: https://docs.aws.amazon.com/general/latest/gr/ssm.html
103103 fips_endpoint = None
104- if config .fips_mode_enabled and LAMBDA_REGION in SSM_FIPS_SUPPORTED_REGIONS :
105- fips_endpoint = f"https://ssm-fips.{ LAMBDA_REGION } .amazonaws.com"
106- else :
107- if not config .is_gov_region :
108- # Log warning if FIPS is enabled for a commercial region that does not support SSM FIPS endpoints
109- logger .warning (
110- "FIPS mode is enabled but region '%s' does not support SSM FIPS endpoints. Using standard SSM endpoint." ,
111- LAMBDA_REGION ,
112- )
104+ if config .fips_mode_enabled :
105+ if LAMBDA_REGION in SSM_FIPS_SUPPORTED_REGIONS :
106+ fips_endpoint = f"https://ssm-fips.{ LAMBDA_REGION } .amazonaws.com"
107+ else :
108+ # Log warning if SSM FIPS endpoint is not supported for commercial region
109+ if not config .is_gov_region :
110+ logger .warning (
111+ "FIPS mode is enabled, but '%s' does not support SSM FIPS endpoints. "
112+ "Using standard SSM endpoint." ,
113+ LAMBDA_REGION ,
114+ )
113115 ssm_client = _boto3_client ("ssm" , endpoint_url = fips_endpoint )
114116 api_key = ssm_client .get_parameter (
115117 Name = DD_API_KEY_SSM_NAME , WithDecryption = True
You can’t perform that action at this time.
0 commit comments