Skip to content

[Feature] Support for doc_count aggregation without the need for field #1035

Open
@anitahuang-accenture

Description

@anitahuang-accenture

Currently, when using the doc_count aggregation in Elastic Stack to create Service Level Objectives (SLOs), there is no need to provide a field because the doc_count aggregation simply counts documents regardless of any specific field.

However, when trying to configure an SLO in Terraform using the terraform-provider-elasticstack, the configuration requires that the field be filled out, which causes a validation error when using the doc_count aggregation, as this field is not needed for this type of aggregation.

Expected Behavior:
I would like the terraform-provider-elasticstack provider to allow the use of the doc_count aggregation without requiring the field parameter. When the doc_count aggregation is selected, the field should be optional since Elastic Stack does not require this parameter for counting documents.

Proposed Solution:
Update the provider to allow the doc_count aggregation to be used without requiring the field parameter. When doc_count is selected as the aggregation type, the field should be optional and not trigger validation errors. This change would align Terraform's behavior with how doc_count works in Kibana Console and the Elastic Stack API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions