File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ def get_api_key() -> str:
6767 REGION = os.environ.get("AWS_REGION", "")
6868 is_gov_region = REGION.startswith("us-gov-")
6969 if is_gov_region:
70- logger.info("Govcloud region detected. Using FIPs endpoints for secrets management.")
70+ logger.info(
71+ "Govcloud region detected. Using FIPs endpoints for secrets management."
72+ )
7173
7274 if DD_API_KEY_SECRET_ARN:
7375 # Secrets manager endpoints: https://docs.aws.amazon.com/general/latest/gr/asm.html
@@ -85,9 +87,7 @@ def get_api_key() -> str:
8587 elif DD_API_KEY_SSM_NAME:
8688 # SSM endpoints: https://docs.aws.amazon.com/general/latest/gr/ssm.html
8789 fips_endpoint = (
88- f"https://ssm-fips.{REGION}.amazonaws.com"
89- if is_gov_region
90- else None
90+ f"https://ssm-fips.{REGION}.amazonaws.com" if is_gov_region else None
9191 )
9292 ssm_client = boto3.client("ssm", endpoint_url=fips_endpoint)
9393 api_key = ssm_client.get_parameter(
@@ -96,9 +96,7 @@ def get_api_key() -> str:
9696 elif DD_KMS_API_KEY:
9797 # KMS endpoints: https://docs.aws.amazon.com/general/latest/gr/kms.html
9898 fips_endpoint = (
99- f"https://kms-fips.{REGION}.amazonaws.com"
100- if is_gov_region
101- else None
99+ f"https://kms-fips.{REGION}.amazonaws.com" if is_gov_region else None
102100 )
103101 kms_client = boto3.client("kms",endpoint_url=fips_endpoint)
104102 api_key = decrypt_kms_api_key(kms_client, DD_KMS_API_KEY)
You can’t perform that action at this time.
0 commit comments