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

Secret Referencing not working? #25

Closed
phiilu opened this issue Oct 30, 2023 · 2 comments
Closed

Secret Referencing not working? #25

phiilu opened this issue Oct 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@phiilu
Copy link

phiilu commented Oct 30, 2023

I've been trying to get secret referencing working using the Terraform provider.

I have a Service Token with the scopes set to /** which should be able to access all the secrets.

Next, I have two folders, A and B.
In the folder A I have a secret named FOO with a value of secret.
I reference this secret in folder B like ${dev.A.FOO}.

CleanShot 2023-10-30 at 01 07 59
CleanShot 2023-10-30 at 01 08 21
CleanShot 2023-10-30 at 01 08 58

However, in terraform the output of the secret is not interpolated.

data "infisical_secrets" "test" {
  env_slug    = "dev"
  folder_path = "/B"  
}

output "foo" {
  value = data.infisical_secrets.test.secrets
}
Outputs:

foo = tomap({
  "ANOTHER_FOO" = {
    "comment" = ""
    "secret_type" = "shared"
    "value" = "${dev.A.FOO}"
  }
})

Using the CLI I can verify that it works:

infisical run --env=dev --path=/B -- env | grep foo
ANOTHER_FOO=secret

I simplified the example a bit, in my case folder B would be nested an additional level, but the secret referencing should work no matter the level of nesting 🤔

In the docs, it is stated that secret referencing is working in all the native integrations. Is the terraform provider a native integration?

@maidul98 maidul98 added the enhancement New feature or request label Oct 30, 2023
@maidul98
Copy link
Contributor

Hey @phiilu this is because support for reference in Terraform has not yet been added. As you can see the secrets are parsed as is https://github.com/Infisical/terraform-provider-infisical/blob/main/infisical/provider/secrets_data_source.go#L130

I have marked this as a feature request

@vmatsiiako
Copy link

Secret References are now supported by Terraform Provider

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

No branches or pull requests

3 participants