diff --git a/common/src/test/java/org/opensearch/ml/common/connector/ConnectorTest.java b/common/src/test/java/org/opensearch/ml/common/connector/ConnectorTest.java index 860ad7caff..93285ec1a6 100644 --- a/common/src/test/java/org/opensearch/ml/common/connector/ConnectorTest.java +++ b/common/src/test/java/org/opensearch/ml/common/connector/ConnectorTest.java @@ -65,7 +65,9 @@ public void validateConnectorURL_Invalid() { HttpConnector connector = createHttpConnector(); connector.validateConnectorURL(Arrays.asList("^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$", "^https://api\\.openai\\.com/.*$", - "^https://api\\.cohere\\.ai/.*$")); + "^https://api\\.cohere\\.ai/.*$", + "^https://bedrock-agent-runtime\\\\..*[a-z0-9-]\\\\.amazonaws\\\\.com/.*$" + )); } @Test @@ -73,6 +75,7 @@ public void validateConnectorURL() { HttpConnector connector = createHttpConnector(); connector.validateConnectorURL(Arrays.asList("^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$", "^https://api\\.openai\\.com/.*$", + "^https://bedrock-agent-runtime\\\\..*[a-z0-9-]\\\\.amazonaws\\\\.com/.*$", "^" + connector.getActions().get(0).getUrl())); } } diff --git a/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java b/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java index 1e7a569a09..1db559ed80 100644 --- a/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java +++ b/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java @@ -144,7 +144,8 @@ private MLCommonsSettings() {} "^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$", "^https://api\\.openai\\.com/.*$", "^https://api\\.cohere\\.ai/.*$", - "^https://bedrock-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$" + "^https://bedrock-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$", + "^https://bedrock-agent-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$" ), Function.identity(), Setting.Property.NodeScope,