Skip to content

Commit

Permalink
Use dsv_role and dsv_client in the example.
Browse files Browse the repository at this point in the history
  • Loading branch information
amigus committed Jan 16, 2020
1 parent 6479e78 commit 3e65b1f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ variable "dsv_tenant" {
type = string
}

variable "dsv_role_name" {
type = "string"
}

variable "dsv_secret_path" {
type = "string"
}
Expand All @@ -20,11 +24,36 @@ provider "dsv" {
tenant = var.dsv_tenant
}

data "dsv_secret" "username" {
path = var.dsv_secret_path
element = "username"
}

data "dsv_secret" "password" {
path = var.dsv_secret_path
element = "password"
}

data "dsv_role" "existing_role" {
name = var.dsv_role_name
}

resource "dsv_client" "new_client" {
role = data.dsv_role.existing_role.name
}

output "client_id" {
value = dsv_client.new_client.client_id
}

output "client_secret" {
value = dsv_client.new_client.client_secret
}

output "username" {
value = data.dsv_secret.username.contents
}

output "password" {
value = data.dsv_secret.password.contents
}

0 comments on commit 3e65b1f

Please sign in to comment.