Amazon OpenSearch CDK for index rollup是针对Elasticsearch Open Distro for Elasticsearch的CDK,用于构建rollup的索引和查询它们的分布式系统。通过使用CDK的API,可以轻松地管理Index Rollups。可以通过以下方式在CDK中定义一个Index Rollup:
import * as cdk from 'aws-cdk-lib';
import * as ElasticsearchIndexRollup from 'amazon-elasticsearch-cdk-constructs/lib/elasticsearch-index-rollup-stack';
export class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const indexRollupStack = new ElasticsearchIndexRollup.IndexRollupStack(this, 'MyIndexRollup', {
sourceIndex: 'sourceIndexName',
targetIndex: 'targetIndexName',
rollupSchedule: '0 0 0 1/1 * ? *',
dimensions: [{ fieldName: 'termField', fieldValue: 'fieldValue' }]
});
}
}
此代码段创建一个名为“ MyIndexRollup”的IndexRollupStack,该Stack包含一个名为“sourceIndexName”的标准索引作为数据源索引,一个名为“targetIndexName”的索引作为聚合索引,并且以“ 0 0 0 1/1 *? *”定时运行job。转换的文档将保存在聚合索引中。
更多关于Amazon OpenSearch CDK for index rollup的信息可以在官方文档中找到。
上一篇:AmazonOnDemand实例和On-DemandCapacityReservation实例之间的区别是什么?
下一篇:AmazonOpenSearch服务(之前称为ElasticSearch)启动时出现“Toomanyopenfiles错误提示。