rickardgranberg / terraform-provider-vaultoperator

Terraform Provider for Vault Operator operations
Mozilla Public License 2.0
19 stars 11 forks source link

Possibility to return keys and root token from provider #18

Closed thomaspetit closed 1 year ago

thomaspetit commented 1 year ago

Is there a clean way to retrieve the keys and root token so that you can use it in consecutive resources? Currently only the ID seems to be returned.

Example on what is currently returned:

Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

Outputs:

vaultoperator_init = {
  "id" = "url_goes_here_off_course"
  "initialized" = true
}

I'd like to have following:

Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

Outputs:

vaultoperator_init = {
  "id" = "https://vault.tpcservices.be"
  "initialized" = true
  "keys" = ["key1","key2"]
  "root_token" = "goes_here"
}
thomaspetit commented 1 year ago

Nevermind just noticed they're not under data but under resource: https://registry.terraform.io/providers/rickardgranberg/vaultoperator/latest/docs/resources/init#read-only