diff --git a/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts b/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts new file mode 100644 index 000000000000..81cd74f86364 --- /dev/null +++ b/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts @@ -0,0 +1,28 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { SavedObjectAttributes } from 'src/core/types'; + +export const DATA_CONNECTION_SAVED_OBJECT_TYPE = 'data-connection'; + +/** + * Represents the attributes of a data connection saved object. + * @property connectionId: The unique identifier of the data connection. + * @property type: The type of the data connection. + * @property meta: Additional metadata associated with the data connection. + */ +export interface DataConnectionSavedObjectAttributes extends SavedObjectAttributes { + connectionId: string; + type: DataConnectionType; + meta?: string; +} + +export enum DataConnectionType { + CloudWatch = 'AWS CloudWatch', + SecurityLake = 'AWS Security Lake', + NA = 'None', +} + +export const DATA_CONNECTION_ID_LENGTH_LIMIT = 32; diff --git a/src/plugins/data_source/common/data_connections/index.ts b/src/plugins/data_source/common/data_connections/index.ts new file mode 100644 index 000000000000..9d1259d8692d --- /dev/null +++ b/src/plugins/data_source/common/data_connections/index.ts @@ -0,0 +1,6 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export * from './data_connection_saved_object_attributes'; diff --git a/src/plugins/data_source/server/plugin.ts b/src/plugins/data_source/server/plugin.ts index bbf5a89d1b53..a2e2f51d6323 100644 --- a/src/plugins/data_source/server/plugin.ts +++ b/src/plugins/data_source/server/plugin.ts @@ -22,7 +22,7 @@ import { DataSourcePluginConfigType } from '../config'; import { LoggingAuditor } from './audit/logging_auditor'; import { CryptographyService, CryptographyServiceSetup } from './cryptography_service'; import { DataSourceService, DataSourceServiceSetup } from './data_source_service'; -import { DataSourceSavedObjectsClientWrapper, dataSource } from './saved_objects'; +import { dataConnection, dataSource, DataSourceSavedObjectsClientWrapper } from './saved_objects'; import { AuthenticationMethod, DataSourcePluginSetup, DataSourcePluginStart } from './types'; import { DATA_SOURCE_SAVED_OBJECT_TYPE } from '../common'; @@ -55,6 +55,7 @@ export class DataSourcePlugin implements Plugin