techBeck03 / terraform-provider-guacamole

Terraform provider for apache gaucamole
Apache License 2.0
15 stars 10 forks source link

`guacamole_user` resource does not take a password field #1

Closed brainplot closed 3 years ago

brainplot commented 3 years ago

Terraform Version

Terraform v1.0.1
on darwin_arm64
+ provider registry.terraform.io/techbeck03/guacamole v1.2.4

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

provider "guacamole" {
  url      = var.guacamole_url
  username = var.guacamole_username
  password = var.guacamole_password
}

resource "random_string" "username_salts" {
  count   = var.lab_environments
  length  = 5
  special = false
  lower   = true
  upper   = false
}

resource "random_password" "student_passwords" {
  count            = var.lab_environments
  length           = 10
  special          = true
  override_special = "_%@"
}

locals {
  guacamole_user_usernames = [for i in range(var.lab_environments) : "student-${random_string.username_salts[i].result}-${i + 1}"]
}

resource "guacamole_connection_vnc" "vnc_connections" {
  count             = var.lab_environments
  name              = "${local.guacamole_user_usernames[count.index]}-vnc"
  parent_identifier = "ROOT"
  parameters {
    hostname = local.student_ipv4_addresses[count.index]
    username = "<REDACTED>"
    password = "<REDACTED>"
  }
}

resource "guacamole_user" "users" {
  count    = var.lab_environments
  username = local.guacamole_user_usernames[count.index]
  password = random_password.student_passwords[count.index].result
  attributes {
    full_name   = "${var.customer}-${var.course_code}"
    valid_from  = var.date_start
    valid_until = var.date_end
  }
  connections = [
    guacamole_connection_vnc.vnc_connections[count.index]
  ]
}

Expected Behavior

guacamole_user to take a password argument, as shown in the example here.

Actual Behavior

│ Error: Unsupported argument
│
│   on guacamole.tf line 40, in resource "guacamole_user" "users":
│   40:   password = random_password.student_passwords[count.index].result
│
│ An argument named "password" is not expected here.
techBeck03 commented 3 years ago

Sorry this issue completely missed me. I've pushed an update to hopefully address setting a password starting with version 1.2.7. Thank you for opening this issue @brainplot !