How to pin elasticsearch version using “ec” Terraform provider?

Hello Everyone, how to pin elasticsearch version using “ec” Terraform provider? I am using the following

data "ec_stack" "latest" {
version_regex = "8.2.1"
region = var.region
}

but it throws “Error: failed to obtain a stack version matching “8.2.1": please specify a valid version_regex” error. How to solve this issue?

According to the official documentation, you can either specify a "valid" version (but which could become invalid when the version is no longer available) or a "regex" for the version that can match a whole minor release list.
ec_stack | Data Sources | elastic/ec | Terraform Registry
In your case,

data "ec_stack" "latest" {
version_regex = "8.2.?"
region = var.region
}

will give your version 8.2.3 today.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.