# Vault provider Bug

**URL:** <https://discuss.hashicorp.com/t/vault-provider-bug/57160>\
**Category:** Plugin Development\
**Tags:** hcp-terraform, vault\
**Created:** [August 11, 2023, 4:54pm UTC](https://discuss.hashicorp.com/t/vault-provider-bug/57160 "2023-08-11T16:54:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![c-juan.salazar](https://avatars.discourse-cdn.com/v4/letter/c/4af34b/32.png) [@c-juan.salazar](https://discuss.hashicorp.com/u/c-juan.salazar)\
**Post date:** [August 11, 2023, 4:54pm UTC](https://discuss.hashicorp.com/t/vault-provider-bug/57160/1 "2023-08-11T16:54:20Z")

</div>

Hi Everyone

Yesterday I reported a bug about the provider vault for terraform in the next link:

> <https://github.com/hashicorp/terraform-provider-vault/issues/1974>
>
> Hi there,
> 
> I am opening this ticket because I am doing a complex Terraform whe…re I have a Kubernetes cluster in AWS and from there I need to read some Kubernetes secrets and with that I can connect to a vault to then create a new key in the vault. The problem is that today I started getting the next error:
> 
> \`\`\`bash
> ╷
> │ Error: Provider produced inconsistent result after apply
> │ 
> │ When applying changes to module.iam\_vault.vault\_generic\_secret.aws\_s3\_bucket, provider "provider\[\\"registry.terraform.io/hashicorp/vault\\"\]"
> │ 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.
> ╵
> \`\`\`
> 
> \### Terraform Version an provider versions
> 
> Terraform v1.5.5
> on darwin\_amd64
> + provider registry.terraform.io/hashicorp/aws v5.11.0
> + provider registry.terraform.io/hashicorp/kubernetes v2.22.0
> + provider registry.terraform.io/hashicorp/vault v3.19.0
> 
> \### Terraform Provider Files
> 
> \`\`\`hcl
> provider "aws" {
> region = var.region
> # version = "~\> 3.74.0"
> default\_tags {
> tags = {
> Org = "\<Org\>"
> Group = "\<group\>"
> Team = "\<team\>"
> Stack = "\<stack\>"
> }
> }
> }
> 
> provider "kubernetes" {
> host = data.aws\_eks\_cluster.this.endpoint
> cluster\_ca\_certificate = base64decode(data.aws\_eks\_cluster.this.certificate\_authority\[0\].data)
> exec {
> api\_version = var.kubecfg\_client\_apiversion
> args = \["eks", "get-token", "--cluster-name", var.eks\_cluster\_name\]
> command = "aws"
> }
> }
> 
> provider "vault" {
> address=data.kubernetes\_secret.kubernetes\_vault.data.url
> skip\_child\_token=true
> auth\_login {
> path="auth/approle/login"
> namespace = data.kubernetes\_secret.kubernetes\_vault.data.namespace
> parameters={
> role\_id = data.kubernetes\_secret.kubernetes\_vault.data.role\_id
> secret\_id = data.kubernetes\_secret.kubernetes\_vault.data.secret\_id
> }
> }
> }
> \`\`\`
> IAM-vault/main.tf
> \`\`\`hcl
> esource "vault\_generic\_secret" "aws\_s3\_bucket" {
> data\_json = \<\<EOT
> {
> "aws\_iam\_access\_key": "${var.aws\_iam\_access\_key}",
> "aws\_iam\_secret\_access\_key": "${var.aws\_iam\_access\_secret\_key}",
> "s3\_bucket\_arn": "${var.s3\_bucket\_arn}",
> "s3\_bucket\_region": "${var.s3\_bucket\_region}",
> "s3\_bucket\_id": "${var.s3\_bucket\_id}"
> }
> EOT
> path = "${var.vault\_rootdir}/aws\_s3\_bucket\_${var.env}"
> \# namespace = var.vault\_namespace
> }
> \`\`\`
> 
> \### How tho reproduce
> 
> \> terraform apply
> 
> \### Expected Behavior
> 
> I expect that I can apply the terraform plan and it will create a new key in the Vault and don't show any errors.
> 
> \### Actual Behavior
> 
> So when I tried to apply the plan and the vault was able to login but the problem happen when I tried to create a key.

I haven’t get any comment about it and I was wondering is it was better to report it here and to check if any one have had the same error.
