Skip to content

ngrok_api_key & ngrok_credential not return anything inside sensitive #42

@parisnakitakejser

Description

@parisnakitakejser

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 alan@example.com"
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions