ThalesGroup / terraform-provider-ciphertrust

The CipherTrust Terraform Provider allows for the incorporation of CipherTrust Cloud Key Manager functionality into a CI/CD pipeline.
Apache License 2.0
6 stars 4 forks source link

ciphertrust_cm_key - Provider produced inconsistent result after apply [Root resource was present, but now absent] #9

Open anuj1366 opened 5 months ago

anuj1366 commented 5 months ago

Hi Team, Currently I am trying to create "ciphertrust_cm_key" using terraform and getting "Provider produced inconsistent result after apply" for sometime which is causing our automation to break.

Terraform Configuration Files

resource "ciphertrust_cm_key" "cm_aes_key" {
  name      = var.keyalias
  algorithm = "AES"
  usage_mask = 60
  unexportable = true
  undeletable = var.undeletable
}

resource "ciphertrust_aws_xks_key" "xks_linked_key_with_cm_as_source_1" {
  local_hosted_params {
    blocked = var.blocked
    custom_key_store_id = data.ciphertrust_aws_custom_keystore.by_resource_id.id
    linked = true
    source_key_id = ciphertrust_cm_key.cm_aes_key.id
    source_key_tier = "local"
  }
  description = "TEST KEY"
  alias = [var.keyalias]
      tags = {
        hosted = "TEST"
      }
  schedule_for_deletion_days = 30  
}

Error Output:

Error: Provider produced inconsistent result after apply
When applying changes to ciphertrust_cm_key.cm_aes_key, provider "provider[\"registry.terraform.io/thalesgroup/ciphertrust\"]" produced an unexpected new value: Root resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own issue tracker.

anuj1366 commented 5 months ago

SarahThompson Could you please look into this issue

SarahThompson commented 5 months ago

Hi Anuj, Can you provide a debug log by adding log_level = "debug" to the provider block? Default log file name is ctp.log. Also, what are the versions of the provider and CipherTrust Manager you are using? Thank-you Sarah

anuj1366 commented 5 months ago

Hi SarahThompson We are using below version for provider and CipherTrust Manager.

terraform {
  required_providers {
    ciphertrust = {
      source = "ThalesGroup/ciphertrust"
      version = "0.10.0-beta"
    }
  }
}
CipherTrust Manager version 2.14.0+10829
crypto version: 1.7.0

We'll generate and share the debug log shortly by replicating the issue again