hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Support for version field in azurerm_elastic_cloud_elasticsearch module #23243

Open ezienecker opened 1 year ago

ezienecker commented 1 year ago

Is there an existing issue for this?

Community Note

Description

I have a requirement to first create an Elastic Cloud type resource in Azure. I then need to customize the deployment via another module and set the correct scaling and deployment type.

Unfortunately, Elastic Cloud has the limitation to set either the Elastic Version or the Scaling/Deployment Type. This means I would have to first create the deployment using this module and then customize this deployment twice.

It would be easier if I could set the version of Elastic when I create it in Azure, which I can also do through the UI. To achieve this I currently have to use a workaround:

resource "azapi_resource" "ec" {
  type      = "Microsoft.Elastic/monitors@2022-07-01-preview"
  name      = var.deployment_name
  location  = var.location
  parent_id = data.azurerm_resource_group.main.id

  tags      = var.tags

  body = jsonencode({
    properties = {
      userInfo = {
        emailAddress = "max.muster@muster.invalid"
      }
      version = data.ec_stack.latest.version
    }
    sku = {
      name = "ess-monthly-consumption_Monthly"
    }
  })

  response_export_values = ["*"]
}

However, I would rather use the azurerm_elastic_cloud_elasticsearch module at this point.

New or Affected Resource(s)/Data Source(s)

azurerm_elastic_cloud_elasticsearch

Potential Terraform Configuration

resource "azurerm_elastic_cloud_elasticsearch" "test" {
  name                        = "example-elasticsearch"
  resource_group_name         = azurerm_resource_group.test.name
  location                    = azurerm_resource_group.test.location
  sku_name                    = "ess-monthly-consumption_Monthly"
  elastic_cloud_email_address = "user@example.com"
  version                     = "7.17.13"
}

References

No response

rcskosir commented 1 year ago

@ezienecker Thank you for taking the time to open this feature request!

x-dean commented 8 months ago

Waiting for any update on this!

slideroh commented 7 months ago

Any update?