This terraform provider allows to perform Create ,Read ,Update, Delete, Import and Deactivate Zoom User(s).
- Go 1.16
- Terraform 0.13.x
- Zoom Pro/Premium account
- Zoom API Documentations
This provider can only be successfully tested on a premium paid zoom account.
- Create a zoom account with paid subscription (PRO Plan/Business Account). (https://zoom.us/)
- Go to Zoom Marketplace
- Click on
Develop -> Build App -> Choose your app type as JWT -> Create
. For our purpose we need to make a JWT App. - Follow this Create JWT Zoom App website to make an app.
- This app will provide us with the zoom_api_secret, zoom_api_key, and ZOOM_TOKEN which will be needed to configure our provider and make request.
- Clone the repository, add all the dependencies and create a vendor directory that contains all dependencies. For this, run the following commands:
go mod init terraform-provider-zoom
go mod tidy
go mod vendor
- Run the following command to create a vendor subdirectory which will comprise of all provider dependencies.
%APPDATA%/terraform.d/plugins/${host_name}/${namespace}/${type}/${version}/${target}
Command:
mkdir -p %APPDATA%/terraform.d/plugins/hashicorp.com/edu/zoom/0.2.0/[OS_ARCH]
For eg. mkdir -p %APPDATA%/terraform.d/plugins/hashicorp.com/edu/zoom/0.2.0/windows_amd64
- Run
go build -o terraform-provider-zoom.exe
. This will save the binary (.exe
) file in the main/root directory. - Run this command to move this binary file to appropriate location.
move terraform-provider-zoom.exe %APPDATA%\terraform.d\plugins\hashicorp.com\edu\zoom\0.2.0\[OS_ARCH]
[OR]
- Manually move the file from current directory to destination directory
- Add
terraform
block andprovider
block as shown in example usage. - Get a pair of credentials: zoom_api_secret and zoom_api_secret. For this, visit https://marketplace.zoom.us/.
- Assign the above credentials to the respective field in the
provider
block.
terraform init
- To initialize a working directory containing Terraform configuration files.terraform plan
- To create an execution plan. Displays the changes to be done.terraform apply
- To execute the actions proposed in a Terraform plan. Apply the changes.
- Add the user email, first name, last name, status, license_type, deartment, job_title, location in the respective field as shown in example usage.
- Run the basic terraform commands.
- On successful execution, sends an account setup mail to user.
-
Update the data of the user in the
resource
block as show in example usage and run the basic terraform commands to update user. User is not allowed to updateemail
. -
Update the
status
of User fromactive
todeactivate
or viceversa and run the basic terraform commands.
Add data
and output
blocks as shown in the example usage and run the basic terraform commands.
Delete the resource
block of the user and run terraform apply
.
- Write manually a
resource
configuration block for the user as shown in example usage. Imported user will be mapped to this block. - Run the command
terraform import zoom_user.user1 [EMAIL_ID]
to import user. - Run
terraform plan
, if output shows0 to add, 0 to change and 0 to destroy
user import is successful, otherwise recheck the user data inresource
block with user data in Zoom website.
terraform {
required_providers {
zoomus = {
version = "1.0.1"
source = "chaurasia-namrata/zoomus"
}
}
}
provider "zoomus" {
zoom_api_key = "[ZOOM_API_KEY]"
zoom_api_secret = "[ZOOM_API_SECRET]"
}
resource "zoom_user" "user1" {
email = "[email protected]"
first_name = "Dummyfirst"
last_name = "Dummylast"
status = "active"
license_type = 1
department = "DevOps"
job_title = "Engineer"
location = "India"
}
data "zoom_user" "user1" {
id = "[email protected]"
}
output "user1" {
value = data.zoom_user.user1
}
zoom_api_key
(Required,string) - The Zoom API Key. This may also be set via the"ZOOM_API_KEY"
environment variable.zoom_api_secret
(Required,string) - The Zoom API Secret. This may also be set via the"ZOOM_API_SECRET"
environment variable.email
(Required,string) - The email id associated with the user account.first_name
(Required,string) - First name of the User.last_name
(Required,string) - Last Name / Family Name / Surname of the User.status
(Optional,string) - User account activation status ie.(activate,deactivate).license_type
(Required,integer) - User account type ie.(1=Basic, 2=License, 3=On-prem)job_title
(Optional,string) - Job title of the particular user.department
(Optional,string) - Department of the particular user.location
(Optional,string) - Department of the particular user.id
(Computed,string) - Unique ID of the User which is same as Email ID.pmi
(Computed,integer) - Generated pmi no of the user.role_name
(Computed,string) - Current role of the user ie.(Admin,Member).