This terraform provider allows to perform Create ,Read ,Update, Delete and Import docusign User(s).
- Go 1.16
- Terraform 0.13.x
- Docusign Developers account
- Docusign Rest API
This provider can be successfully tested on any dcosign developer account.
- Create a docusign account with your required subscription (PRO Plan/Business Account). (https://www.docusign.com/products-and-pricing)
- Sign in to the docusign account (https://developers.docusign.com/)
- Go to Apps and Keys
- Click on
Add App and integration key
. For our purpose we need to create an Auth Token. - Follow this Generate Auth Token website to make an app.
This app will provide us with the token and accountid which will be needed to configure our provider and make request.
- Clone the repository to $GOPATH/src/github.com/docusign/terraform-provider-docusign
- Add the Refresh token generted in Docusign App to respective fields as shown in example usage
- Run the following command :
go mod init terraform-provider-docusign
go mod tidy
- Run
go mod vendor
to create a vendor directory that contains all the provider's dependencies.
- Run the following command to create a vendor subdirectory which will comprise of all provider dependencies.
~/.terraform.d/plugins/${host_name}/${namespace}/${type}/${version}/${target}
Command:
mkdir -p ~/.terraform.d/plugins/hashicorp.com/edu/docusign/0.2.0/[OS_ARCH]
For eg. mkdir -p ~/.terraform.d/plugins/terraform/provider/docusign/0.2.0/windows_amd64
- Run
go build -o terraform-provider-docusign.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-docusign.exe %APPDATA%\terraform.d\plugins\terraform\provider\docusign\0.2.0\[OS_ARCH]
Otherwise you can manually move the file from current directory to destination directory.
[OR]
- Download required binaries
- move binary
~/.terraform.d/plugins/[architecture name]/
- Add the user email, first name, last name, job_title, company in the respective field in resourcse block refer example usage
- Initialize the terraform provider
terraform init
- Check the changes applicable using
terraform plan
and apply usingterraform apply
- You will see that a user has been successfully created and an account activation mail has been sent to the user.
- Activate the account using the link provided in the mail.
Update the data of the user in the resourcse block and apply using terraform apply
Add data and output blocks and run terraform plan
to read user data
Delete the resource block of the particular user file and run terraform apply
or run terraform destroy
.
- Write manually a resource configuration block for the User(refer resourcse block), to which the imported object will be mapped.
- Run the command
terraform import docusign_user.user1 [EMAIL_ID]
- Check for the attributes in the
.tfstate
file and fill them accordingly in resource block.
terraform {
required_providers {
docusign = {
version = "0.2"
source = "terraform/provider/docusign"
}
}
}
provider "docusign" {
secretkey = "rwetwuytrqweyr"
integrationkey = "gdfjhsdfjdf"
refresh token = "dgfshdgfsdh"
accountid = "dhfhglsdhfljsdh"
}
resource "docusign_user" "user1" {
email = "user@gmail.com"
firstname = "usersfirstname"
lastname = "userslastname"
jobtitle = "engineer"
company = "clevertap"
}
data "docusign_user" "user1" {
email = "user@gmail.com"
}
output "user1" {
value = data.docusign_user.user1
}
secretkey
(Required, String) - The Docusing secret Key from created application. This may also be set via the "DOCUSIGN_SECRET_KEY" environment variable.integrationkey
(Required, String) - The Docusing integration Key from created application. This may also be set via the "DOCUSIGN_INTEGRATION_KEY" environment variable.refreshtoken
(Required, String) - refresh token for generation of new access token. This may also be set via the "DOCUSIGN_REFRESH_TOKEN" environment variable.accountid
(Required, String) - Account id of the Admin. This may also be set via the "DOCUSIGN_ACCOUNT_ID" environment variable.first_name
(Required, String) - First name of the User.last_name
(Required, String) - Last Name / Family Name / Surname of the User.job_title
(Optional, String) - Job title of the particular user.company
(Optional, String) - Company of the particular user.permissionprofilename
(computed, String) - profile of the particular user ie.(DS Admin,DS Sender,DS Viewer)Can be managed only through docusign dashboard.