@@ -269,7 +269,7 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi
269269 actionExecutor,
270270 actionTypeRegistry,
271271 taskRunnerFactory,
272- kibanaIndex ,
272+ kibanaIndexConfig ,
273273 isESOUsingEphemeralEncryptionKey,
274274 preconfiguredActions,
275275 instantiateAuthorization,
@@ -297,10 +297,12 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi
297297 request
298298 ) ;
299299
300+ const kibanaIndex = ( await kibanaIndexConfig . pipe ( first ( ) ) . toPromise ( ) ) . kibana . index ;
301+
300302 return new ActionsClient ( {
301303 unsecuredSavedObjectsClient,
302304 actionTypeRegistry : actionTypeRegistry ! ,
303- defaultKibanaIndex : await kibanaIndex ,
305+ defaultKibanaIndex : kibanaIndex ,
304306 scopedClusterClient : core . elasticsearch . legacy . client . asScoped ( request ) ,
305307 preconfiguredActions,
306308 request,
@@ -426,7 +428,7 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi
426428
427429 private createRouteHandlerContext = (
428430 core : CoreSetup < ActionsPluginsStart > ,
429- defaultKibanaIndex : string
431+ config : Observable < { kibana : { index : string } } >
430432 ) : IContextProvider < RequestHandler < unknown , unknown , unknown > , 'actions' > => {
431433 const {
432434 actionTypeRegistry,
@@ -438,6 +440,8 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi
438440
439441 return async function actionsRouteHandlerContext ( context , request ) {
440442 const [ { savedObjects } , { taskManager } ] = await core . getStartServices ( ) ;
443+ const defaultKibanaIndex = ( await config . pipe ( first ( ) ) . toPromise ( ) ) . kibana . index ;
444+
441445 return {
442446 getActionsClient : ( ) => {
443447 if ( isESOUsingEphemeralEncryptionKey === true ) {
0 commit comments