Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.enterprise_search: was cty.ObjectVal([...]), but now null. #832

Open
4 tasks done
ckauf opened this issue Aug 6, 2024 · 0 comments
Open
4 tasks done

.enterprise_search: was cty.ObjectVal([...]), but now null. #832

ckauf opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ckauf
Copy link

ckauf commented Aug 6, 2024

Readiness Checklist

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I am reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

The provider should be able to handle removing instance configurations by setting size: 0g

Current Behavior

The provider exists with an error message:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to ec_deployment.example_minimal, provider "provider[\"registry.terraform.io/elastic/ec\"]" produced an unexpected new value: .enterprise_search: was
│ cty.ObjectVal(map[string]cty.Value{"config":cty.NullVal(cty.Object(map[string]cty.Type{"docker_image":cty.String, "user_settings_json":cty.String, "user_settings_override_json":cty.String,
│ "user_settings_override_yaml":cty.String, "user_settings_yaml":cty.String})), "elasticsearch_cluster_ref_id":cty.StringVal("main-elasticsearch"),
│ "http_endpoint":cty.StringVal("http://1784f4c8fd344a26a2e2aeaefad4cae3.ent-search.westeurope.azure.elastic-cloud.com:9200"),
│ "https_endpoint":cty.StringVal("https://1784f4c8fd344a26a2e2aeaefad4cae3.ent-search.westeurope.azure.elastic-cloud.com:443"), "instance_configuration_id":cty.StringVal("azure.enterprisesearch.fsv2"),
│ "instance_configuration_version":cty.NumberIntVal(1), "latest_instance_configuration_id":cty.StringVal("azure.enterprisesearch.fsv2"), "latest_instance_configuration_version":cty.NumberIntVal(1),
│ "node_type_appserver":cty.True, "node_type_connector":cty.True, "node_type_worker":cty.True, "ref_id":cty.StringVal("main-enterprise_search"), "region":cty.StringVal("azure-westeurope"),
│ "resource_id":cty.StringVal("1784f4c8fd344a26a2e2aeaefad4cae3"), "size":cty.StringVal("0g"), "size_resource":cty.StringVal("memory"), "zone_count":cty.NumberIntVal(1)}), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

## Terraform definition

terraform {
  required_providers {
    ec = {
      source = "elastic/ec"
      version = "0.10.0"
    }
  }
}

provider "ec" {
  apikey = "<API_KEY_HERE>"
}

resource "ec_deployment" "example_minimal" {
  # Optional name.
  name = "var_test"

  region                 = "azure-westeurope"
  version                = "8.14.3"
  deployment_template_id = "azure-general-purpose"

  elasticsearch = {
    hot = {
      autoscaling = {}
    }

    frozen = {
      size = "4g"
      zone_count = var.zone_count
      autoscaling = {}
    }
  }

  kibana = {}

  enterprise_search = {
    size = "${var.size}"
    zone_count = "${var.zone_count}"
  }

  integrations_server = {}
}

variable "zone_count" {
  type = number
  default = 1
}

variable "size" {
  type = string
  default = "2g"
}

Steps to Reproduce

  1. Create deployment with definition above
  2. Set size variable to 0g
  3. Apply changes

Context

This will prevent using the ec-terraform provider in a module. The module should be able to configure deployment with different instance types and sizes via variable.

Possible Solution

none

Your Environment

  • Version used: 0.10.0
  • Running against Elastic Cloud SaaS
@ckauf ckauf added the bug Something isn't working label Aug 6, 2024
@ckauf ckauf changed the title .enterprise_search: was cty.ObjectVal([...] but now null. .enterprise_search: was cty.ObjectVal([...]), but now null. Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant