@@ -29,7 +29,7 @@ def test_secrets_manager_fips_endpoint(self, mock_boto3_client):
2929 mock_boto3_client .return_value = mock_client
3030
3131 os .environ ["AWS_REGION" ] = "us-gov-east-1"
32- os .environ ["DD_API_KEY_SECRET_ARN" ] = "test-secrets-arn "
32+ os .environ ["DD_API_KEY_SECRET_ARN" ] = "arn:aws:secretsmanager:us-gov-east-1:1234567890:secret:key-name-123ABC "
3333
3434 api_key = api .get_api_key ()
3535
@@ -39,6 +39,23 @@ def test_secrets_manager_fips_endpoint(self, mock_boto3_client):
3939 )
4040 self .assertEqual (api_key , "test-api-key" )
4141
42+ @patch ("boto3.client" )
43+ def test_secrets_manager_different_region (self , mock_boto3_client ):
44+ mock_client = MagicMock ()
45+ mock_client .get_secret_value .return_value = {"SecretString" : "test-api-key" }
46+ mock_boto3_client .return_value = mock_client
47+
48+ os .environ ["AWS_REGION" ] = "us-east-1"
49+ os .environ ["DD_API_KEY_SECRET_ARN" ] = "arn:aws:secretsmanager:us-west-1:1234567890:secret:key-name-123ABC"
50+
51+ api_key = api .get_api_key ()
52+
53+ mock_boto3_client .assert_called_with (
54+ "secretsmanager" ,
55+ endpoint_url = "https://secretsmanager.us-west-1.amazonaws.com" ,
56+ )
57+ self .assertEqual (api_key , "test-api-key" )
58+
4259 @patch ("boto3.client" )
4360 def test_ssm_fips_endpoint (self , mock_boto3_client ):
4461 mock_client = MagicMock ()
0 commit comments