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

Idempotency with terraform #654

Open
Nainterceptor opened this issue Oct 30, 2020 · 0 comments
Open

Idempotency with terraform #654

Nainterceptor opened this issue Oct 30, 2020 · 0 comments

Comments

@Nainterceptor
Copy link

Hello,

This issue is maybe related to hashicorp/terraform-provider-kubernetes-alpha#41, I create an issue here to track this behavior and share information.

We manage our kubernetes cluster via terraform, to enforce maintenability and collaboration (using gitlab and Merge requests).
To deploy CRD we are using kubernetes-alpha provider from hashicorp.
Some parameters are not idempotents, and when we run apply two times, the second one is failing cause of dry-run failure.

resource "kubernetes_manifest" "arangodb-db" {
  provider = kubernetes-alpha

  manifest = {
    "apiVersion" = "database.arangodb.com/v1alpha"
    "kind" = "ArangoDeployment"
    "metadata" = {
      "name" = "test"
    }
    "spec" = {
      "mode" = "Single"
      "bootstrap" = {
        "passwordSecretNames" = {
          "root" = "Auto"
        }
      }
    }
  }
}

Some other behaviors results to a failure, first time apply the previous hcl, then change it to

resource "kubernetes_manifest" "arangodb-db" {
  provider = kubernetes-alpha

  manifest = {
    "apiVersion" = "database.arangodb.com/v1alpha"
    "kind" = "ArangoDeployment"
    "metadata" = {
      "name" = "test"
    }
    "spec" = {
      "mode" = "Single"
      "bootstrap" = {
        "passwordSecretNames" = {
          "root" = "Auto"
        }
      }
      "tls" = {
        "caSecretName" = "None"
      }
    }
  }
}

It's failure, but expected to have a force replace scenario

Best regards,
Gaël

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant