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

[Bug]: add_address_to_env does not affect local-exec provisioners #2274

Open
mxk opened this issue Jun 13, 2024 · 0 comments
Open

[Bug]: add_address_to_env does not affect local-exec provisioners #2274

mxk opened this issue Jun 13, 2024 · 0 comments
Labels

Comments

@mxk
Copy link

mxk commented Jun 13, 2024

Terraform Core Version

1.8.5

Terraform Vault Provider Version

4.2.0

Vault Server Version

1.10.0

Affected Resource(s)

No response

Expected Behavior

When setting add_address_to_env = true, I expected VAULT_ADDR to be set to the provider's address when running the Vault CLI via local-exec provisioners.

Actual Behavior

If I run VAULT_ADDR=https://... terraform apply, Vault CLI executed by local-exec sees the address on the command line rather than the config.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

terraform {
  required_providers {
    vault = { source = "hashicorp/vault", version = "~> 4.2" }
  }
}

provider "vault" {
  address = "http://localhost:8200"
  add_address_to_env = true
}

resource "null_resource" "test" {
  provisioner "local-exec" {
    command = "echo $VAULT_ADDR"
  }
}

Steps to Reproduce

Run VAULT_ADDR=bad terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@mxk mxk added the bug label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant