@@ -71,29 +71,22 @@ def get_api_key() -> str:
71
71
# Secrets manager endpoints: https://docs.aws.amazon.com/general/latest/gr/asm.html
72
72
fips_endpoint = f"https://secretsmanager-fips.{ REGION } .amazonaws.com" if is_gov_region else None
73
73
secrets_manager_client = boto3 .client (
74
- "secretsmanager" ,
75
- endpoint_url = fips_endpoint
74
+ "secretsmanager" , endpoint_url = fips_endpoint
76
75
)
77
76
api_key = secrets_manager_client .get_secret_value (
78
77
SecretId = DD_API_KEY_SECRET_ARN
79
78
)["SecretString" ]
80
79
elif DD_API_KEY_SSM_NAME :
81
80
# SSM endpoints: https://docs.aws.amazon.com/general/latest/gr/ssm.html
82
81
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 )
87
83
api_key = ssm_client .get_parameter (
88
84
Name = DD_API_KEY_SSM_NAME , WithDecryption = True
89
85
)["Parameter" ]["Value" ]
90
86
elif DD_KMS_API_KEY :
91
87
# KMS endpoints: https://docs.aws.amazon.com/general/latest/gr/kms.html
92
88
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 )
97
90
api_key = decrypt_kms_api_key (kms_client , DD_KMS_API_KEY )
98
91
else :
99
92
api_key = DD_API_KEY
0 commit comments