Configuring Terraform
The Terraform configuration files, such as .tf
files, are typically located within the executable directory or subdirectories. Therefore, executing the Terraform configuration commands in the specific directory is necessary.
To make an executable directory:
-
Create an
example.tf
file in the directory containing the Terraform executable. -
Place the content into the
example.tf
file from:-
secrets_get.tf
file: for retrieving a multiple secret. -
secret_create.tf
file: for creating or updating a secret.You can find these files in the terraform-provider-tss>examples>secrets directory.
These files are only for reference on how to fetch or create secrets. You can use the content of the files as a guide to make your actual .tf file. -
-
Update the Terraform and the
terraform-provider-tss
versions in the terraform block of theexample.tf
file according to your terraform and yourterraform-provider-tss
versions: -
Create a terraform.tfvars file in the directory containing the Terraform executable.
-
Place the variables into the file with the appropriate values corresponding to getting, creating, or updating a secret.
You can find the list of variables in the terraform-provider-ts>vars>secrets directory. -
Variables for getting a secret via the Platform by ID:
-
Variables for creating/updating a secret via the Platform:
terraform {
required_version = "1.12.1"
required_providers {
tss = {
source = "DelineaXPM/tss"
version = "3.0.0"
}
}
}
To access the Secret Server via the platform, provide the platform URL as input to tss_server_url and the platform user credentials to tss_username and tss_password.
tss_username = "my_platform_app_user"
tss_password = "password"
tss_server_url = "https://platform.delinea.app"
tss_secret_id = ["1", "2", "3"]
tss_username = "my_platform_app_user "
tss_password = "password"
tss_server_url = "https://platform.delinea.app"
tss_secret_name = "Windows Account"
tss_secret_siteid = 1
tss_secret_folderid = 0
tss_secret_templateid = 6003
fields = [
{
fieldname = "Machine"
itemvalue = "enter the hostname/ip of the machine"
},
{
fieldname = "Username"
itemvalue = "enter my_app_user"
},
{
fieldname = "Password"
itemvalue = "enter the password"
},
{
fieldname = "Notes"
itemvalue = "enter additional notes for your secret"
}
]
To create variables for supporting the different secret template:
-
In the Delinea Platform, go to Settings > Administrator > Secret template. The Secret templates page opens.
-
Replace the
tss_secret_templateid
value with the template ID. You can see the ID in the URL when you select any template in the Delinea Platform. -
Select the Fields tab.
-
Select Add field to add a new field or select each field to edit it.
The above example has four fields in the template, but the number of fields can vary from template to template.
After completing the configuration instructions above, the Terraform executable directory should look like this: