@@ -71,29 +71,22 @@ def get_api_key() -> str:
7171 # Secrets manager endpoints: https://docs.aws.amazon.com/general/latest/gr/asm.html
7272 fips_endpoint = f"https://secretsmanager-fips.{ REGION } .amazonaws.com" if is_gov_region else None
7373 secrets_manager_client = boto3 .client (
74- "secretsmanager" ,
75- endpoint_url = fips_endpoint
74+ "secretsmanager" , endpoint_url = fips_endpoint
7675 )
7776 api_key = secrets_manager_client .get_secret_value (
7877 SecretId = DD_API_KEY_SECRET_ARN
7978 )["SecretString" ]
8079 elif DD_API_KEY_SSM_NAME :
8180 # SSM endpoints: https://docs.aws.amazon.com/general/latest/gr/ssm.html
8281 fips_endpoint = f"https://ssm-fips.{ REGION } .amazonaws.com" if is_gov_region else None
83- ssm_client = boto3 .client (
84- "ssm" ,
85- endpoint_url = fips_endpoint
86- )
82+ ssm_client = boto3 .client ("ssm" , endpoint_url = fips_endpoint )
8783 api_key = ssm_client .get_parameter (
8884 Name = DD_API_KEY_SSM_NAME , WithDecryption = True
8985 )["Parameter" ]["Value" ]
9086 elif DD_KMS_API_KEY :
9187 # KMS endpoints: https://docs.aws.amazon.com/general/latest/gr/kms.html
9288 fips_endpoint = f"https://kms-fips.{ REGION } .amazonaws.com" if is_gov_region else None
93- kms_client = boto3 .client (
94- "kms" ,
95- endpoint_url = fips_endpoint
96- )
89+ kms_client = boto3 .client ("kms" ,endpoint_url = fips_endpoint )
9790 api_key = decrypt_kms_api_key (kms_client , DD_KMS_API_KEY )
9891 else :
9992 api_key = DD_API_KEY
0 commit comments