Skip to content

Commit 0c4fdc4

Browse files
committed
lint
1 parent bbf8042 commit 0c4fdc4

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

datadog_lambda/api.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)