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

terraform plan always sees changes when ec_deployment.remote_clusters is set #598

Closed
4 tasks done
pascal-hofmann opened this issue Mar 8, 2023 · 3 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@pascal-hofmann
Copy link
Contributor

pascal-hofmann commented Mar 8, 2023

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

After a successful terraform apply a terraform plan should not display any changes.

Current Behavior

Note: Values have been removed, but they always stay the same and a plan/apply never says "No changes".

$ terraform apply

Terraform will perform the following actions:

  # module.deployment_1.ec_deployment.this will be updated in-place
  ~ resource "ec_deployment" "this" {
      ~ apm_secret_token       = (sensitive value)
      ~ elasticsearch          = {
          ~ cloud_id       = "…" -> (known after apply)
          ~ http_endpoint  = "http://…" -> (known after apply)
          ~ https_endpoint = "https://…" -> (known after apply)
          ~ resource_id    = "…" -> (known after apply)
            # (8 unchanged attributes hidden)
        }
       …
    }

Plan: 0 to add, 1 to change, 0 to destroy.

module.deployment_1.ec_deployment.this: Modifying... [id=…]
module.deployment_1.ec_deployment.this: Still modifying... [id=…, 10s elapsed]
module.deployment_1.ec_deployment.this: Modifications complete after 13s [id=…]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

$ terraform apply


Terraform will perform the following actions:

  # module.deployment_1.ec_deployment.this will be updated in-place
  ~ resource "ec_deployment" "this" {
      ~ apm_secret_token       = (sensitive value)
      ~ elasticsearch          = {
          ~ cloud_id       = "…" -> (known after apply)
          ~ http_endpoint  = "http://…" -> (known after apply)
          ~ https_endpoint = "https://…" -> (known after apply)
          ~ resource_id    = "…" -> (known after apply)
            # (8 unchanged attributes hidden)
        }
       …
    }

Plan: 0 to add, 1 to change, 0 to destroy.

module.deployment_1.ec_deployment.this: Modifying... [id=…]
module.deployment_1.ec_deployment.this: Still modifying... [id=…, 10s elapsed]
module.deployment_1.ec_deployment.this: Modifications complete after 13s [id=…]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

## Terraform definition

locals {
  account_id = "1e05b2a8254c4ce98df2c165683a816a"
  region = "ece-region"
}

resource "ec_deployment" "one" {
  name                   = "issue-598-1"
  region                 = local.region
  version                = "8.6.1"
  deployment_template_id = "default"
  elasticsearch = {
    autoscale = true

    trust_account = [
      {
        account_id = local.account_id
        trust_all  = false
        trust_allowlist = [ec_deployment.two.elasticsearch.resource_id]
      }
    ]

    "remote_cluster" = [{
      alias         = "issue-598-2"
      deployment_id = ec_deployment.two.id
      ref_id        = ec_deployment.two.elasticsearch.ref_id
    }]


    hot = {
      autoscaling = {}
    }
  }
}

resource "ec_deployment" "two" {
  name                   = "issue-598-2"
  region                 = local.region
  version                = "8.6.1"
  deployment_template_id = "default"
  elasticsearch = {
    autoscale = true
    hot = {
      autoscaling = {}
    }
  }
}


Steps to Reproduce

  1. terraform apply
  2. terraform plan

Your Environment

Terraform v1.3.7
on darwin_amd64

  • provider registry.terraform.io/elastic/ec v0.6.0
  • Running against: Elastic Cloud Enterprise 3.5.1
@pascal-hofmann pascal-hofmann added the bug Something isn't working label Mar 8, 2023
@ignaloidas
Copy link

ignaloidas commented Mar 22, 2023

Duplicate with #599

@gvozdetsky
Copy link

A fix for this was released with 0.8.0

@tobio tobio closed this as completed Aug 6, 2023
@tobio
Copy link
Member

tobio commented Aug 6, 2023

You're right, thanks @gvozdetsky

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

4 participants