Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security solution] Rename connector from AWS Bedrock to Amazon Bedrock #169025

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ import {
import { ActionType } from '@kbn/actions-plugin/common';
import { ActionTypeRegistryContract } from '@kbn/triggers-actions-ui-plugin/public';
import * as i18n from '../translations';
import {css} from "@emotion/css/dist/emotion-css.cjs";

interface Props {
actionTypes?: ActionType[];
actionTypeRegistry: ActionTypeRegistryContract;
onClose: () => void;
onSelect: (actionType: ActionType) => void;
}
const itemClassName = css`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without the extra CSS:
Screenshot 2023-10-16 at 1 52 28 PM

white-space property puts it on one line and aligns the icons
Screenshot 2023-10-16 at 1 53 46 PM

.euiKeyPadMenuItem__label {
white-space: nowrap;
overflow: hidden;
}
`;

export const ActionTypeSelectorModal = ({
actionTypes,
Expand All @@ -46,6 +53,7 @@ export const ActionTypeSelectorModal = ({
return (
<EuiFlexItem data-test-subj="action-option" key={actionType.id} grow={false}>
<EuiKeyPadMenuItem
className={itemClassName}
key={actionType.id}
isDisabled={!actionType.enabled}
label={actionType.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const WELCOME_GENERAL_2 = i18n.translate(
'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt',
{
defaultMessage:
"First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an AWS Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉",
"First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an Amazon Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉",
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getLlmType = (connectorId: string, connectors: ActionResult[]): str
// See: https://github.com/langchain-ai/langchainjs/blob/fb699647a310c620140842776f4a7432c53e02fa/langchain/src/agents/openai/index.ts#L185
return 'openai';
}
// TODO: Add support for AWS Bedrock Connector once merged
// TODO: Add support for Amazon Bedrock Connector once merged
spong marked this conversation as resolved.
Show resolved Hide resolved
// Note: Doesn't appear to be a difference between Azure and OpenAI LLM types, so TBD for functions agent on Azure
// See: https://github.com/langchain-ai/langchainjs/blob/fb699647a310c620140842776f4a7432c53e02fa/langchain/src/llms/openai.ts#L539

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
export const BEDROCK_TITLE = i18n.translate(
'xpack.stackConnectors.components.bedrock.connectorTypeTitle',
{
defaultMessage: 'AWS Bedrock',
defaultMessage: 'Amazon Bedrock',
}
);
export const BEDROCK_CONNECTOR_ID = '.bedrock';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function getConnectorType(): BedrockConnector {
id: BEDROCK_CONNECTOR_ID,
iconClass: lazy(() => import('./logo')),
selectMessage: i18n.translate('xpack.stackConnectors.components.bedrock.selectMessageText', {
defaultMessage: 'Send a request to AWS Bedrock.',
defaultMessage: 'Send a request to Amazon Bedrock.',
}),
actionTypeTitle: BEDROCK_TITLE,
validateParams: async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const bedrockConfig: ConfigFieldSchema[] = [
defaultValue: DEFAULT_BEDROCK_URL,
helpText: (
<FormattedMessage
defaultMessage="The AWS Bedrock API endpoint URL. For more information on the URL, refer to the {bedrockAPIUrlDocs}."
defaultMessage="The Amazon Bedrock API endpoint URL. For more information on the URL, refer to the {bedrockAPIUrlDocs}."
id="xpack.stackConnectors.components.bedrock.bedrockDocumentation"
values={{
bedrockAPIUrlDocs: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const SECRET = i18n.translate('xpack.stackConnectors.components.bedrock.s
});

export const BEDROCK = i18n.translate('xpack.stackConnectors.components.bedrock.title', {
defaultMessage: 'AWS Bedrock',
defaultMessage: 'Amazon Bedrock',
});

export const DOCUMENTATION = i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const configValidator = (configObject: Config, validatorServices: Validat
} catch (err) {
throw new Error(
i18n.translate('xpack.stackConnectors.bedrock.configurationErrorApiProvider', {
defaultMessage: 'Error configuring AWS Bedrock action: {err}',
defaultMessage: 'Error configuring Amazon Bedrock action: {err}',
values: {
err,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) {
statusCode: 400,
error: 'Bad Request',
message:
'error validating action type config: Error configuring AWS Bedrock action: Error: error validating url: target url "http://bedrock.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts',
'error validating action type config: Error configuring Amazon Bedrock action: Error: error validating url: target url "http://bedrock.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts',
});
});
});
Expand Down Expand Up @@ -280,7 +280,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) {
status: 'error',
retry: true,
message: 'an error occurred while running the action',
service_message: `Sub action "invalidAction" is not registered. Connector id: ${bedrockActionId}. Connector name: AWS Bedrock. Connector type: .bedrock`,
service_message: `Sub action "invalidAction" is not registered. Connector id: ${bedrockActionId}. Connector name: Amazon Bedrock. Connector type: .bedrock`,
});
});
});
Expand Down