Skip to content

(elasticsearch): slow logs can't be enabled for some versions of elasticsearch #15532

@joelcox22

Description

@joelcox22

There's conflicting documentation about which versions of elasticsearch support slow logs.

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createdomain-configure-slow-logs.html
says it can be enabled for all versions, and manual testing in the aws console seems to verify this

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-features-by-version.html
says it can only be enabled for versions >= 5.1 - and this is what the validation checks at https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-elasticsearch/lib/domain.ts#L1417 are based on, which means the CDK construct prevents us from enabling slow logs when it would be supported.

Reproduction Steps

import * as cdk from '@aws-cdk/core';
import * as es from '@aws-cdk/aws-elasticsearch';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'app');
new es.Domain(stack, 'elasticsearch', {
  version: es.ElasticsearchVersion.V2_3,
  logging: {
    slowSearchLogEnabled: true,
  },
});

What did you expect to happen?

Slow search logging should be enabled for the cluster.
Note: the same applies for slowIndexLogging property.

What actually happened?

during synth, we recieve a validation error:

Error and slow logs publishing requires Elasticsearch version 5.1 or later.

Environment

  • CDK CLI Version : any
  • Framework Version: 1.113.0
  • Node.js Version: any
  • OS : any
  • Language (Version): all

This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch ServicebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions