File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,11 @@ def get_api_key() -> str:
7171
7272 if DD_API_KEY_SECRET_ARN :
7373 # Secrets manager endpoints: https://docs.aws.amazon.com/general/latest/gr/asm.html
74- fips_endpoint = f"https://secretsmanager-fips.{ REGION } .amazonaws.com" if is_gov_region else None
74+ fips_endpoint = (
75+ f"https://secretsmanager-fips.{ REGION } .amazonaws.com"
76+ if is_gov_region
77+ else None
78+ )
7579 secrets_manager_client = boto3 .client (
7680 "secretsmanager" , endpoint_url = fips_endpoint
7781 )
@@ -80,14 +84,22 @@ def get_api_key() -> str:
8084 )["SecretString" ]
8185 elif DD_API_KEY_SSM_NAME :
8286 # SSM endpoints: https://docs.aws.amazon.com/general/latest/gr/ssm.html
83- fips_endpoint = f"https://ssm-fips.{ REGION } .amazonaws.com" if is_gov_region else None
87+ fips_endpoint = (
88+ f"https://ssm-fips.{ REGION } .amazonaws.com"
89+ if is_gov_region
90+ else None
91+ )
8492 ssm_client = boto3 .client ("ssm" , endpoint_url = fips_endpoint )
8593 api_key = ssm_client .get_parameter (
8694 Name = DD_API_KEY_SSM_NAME , WithDecryption = True
8795 )["Parameter" ]["Value" ]
8896 elif DD_KMS_API_KEY :
8997 # KMS endpoints: https://docs.aws.amazon.com/general/latest/gr/kms.html
90- fips_endpoint = f"https://kms-fips.{ REGION } .amazonaws.com" if is_gov_region else None
98+ fips_endpoint = (
99+ f"https://kms-fips.{ REGION } .amazonaws.com"
100+ if is_gov_region
101+ else None
102+ )
91103 kms_client = boto3 .client ("kms" ,endpoint_url = fips_endpoint )
92104 api_key = decrypt_kms_api_key (kms_client , DD_KMS_API_KEY )
93105 else :
You can’t perform that action at this time.
0 commit comments