'Creating user(s) in AWS Workspaces SimpleAD via Terraform

Is it possible to use Terraform to create new users and add them to the AWS Workspaces directory? I have looked all over Hashi as well as different forums and I can't seem to find out how to do this or if it is even possible. Thanks in advance!

Pic of the GUI where I am try to add user(s)



Solution 1:[1]

I am able to create an AWS workspace with the username "Administrator" using the below code.

resource "aws_workspaces_workspace" "workspace" {  
  directory_id = aws_workspaces_directory.directory.id
  bundle_id    = data.aws_workspaces_bundle.standard_amazon_linux2.id
  user_name    = "Administrator"

  root_volume_encryption_enabled = true
  user_volume_encryption_enabled = true
  volume_encryption_key          = "alias/aws/workspaces"

  workspace_properties {  
    compute_type_name                         = "VALUE"  
    user_volume_size_gib                      = 10  
    root_volume_size_gib                      = 80  
    running_mode                              = "AUTO_STOP"  
    running_mode_auto_stop_timeout_in_minutes = 60  
 }  
}

I am trying to find a way to add users to SimpleAD in AWS using Terraform. So that I can create a workspace for users.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Karan