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

ngrok_api_key & ngrok_credential not return anything inside sensitive #42

Open
parisnakitakejser opened this issue Nov 30, 2024 · 0 comments

Comments

@parisnakitakejser
Copy link

parisnakitakejser commented Nov 30, 2024

I trying to use 2 types to auto create API and Auth both part never return the token i need back, its return into "sensitive" but trying any thing to convert it to string and recreate the token but never receive the token i know its will be null after the first are created, its just look like its not set even not on the first try.

my sample code

resource "ngrok_api_key" "edge" {
  description = "ad-hoc dev testing"
  metadata    = "{\"environment\":\"dev\"}"
}

resource "ngrok_credential" "edge" {
  description = "development cred for [email protected]"
}

and i just trying to use it in different ways to confirms.

output "nonsensitive" {
  value = nonsensitive(ngrok_api_key.edge.token)
}
output "sensitive" {
  value =ngrok_api_key.edge.token
sensitive = true
}
output "as_string" {
  value = "${ngrok_api_key.edge.token}"
sensitive = true
}

and the state snippet returned like this

{
      "mode": "managed",
      "type": "ngrok_api_key",
      "name": "edge",
      "provider": "provider[\"registry.terraform.io/ngrok/ngrok\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "description": "ad-hoc dev testing",
            "id": "ak_2paXUgxfNxzElZ8XZucIT0SOxY6",
            "metadata": "{\"environment\":\"dev\"}",
            "owner_id": "usr_1yaQGRoe6VjrqaXWvLeEKHfp4vV",
            "token": ""
          },
          "sensitive_attributes": [
            [
              {
                "type": "get_attr",
                "value": "token"
              }
            ]
          ],
          "private": "bnVsbA=="
        }
      ]
    },

as you can see the private is base64 and return null, the tokens are recreted in any terraform request but never return the token back.

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