Terraform Provider
In many software development methodologies, there is a need to manage and automate development, testing, and production environments. This need arises from the understanding that all resources deployed in an environment—whether cloud-based or hosted on local servers—eventually reach a stable configuration, often referred to as the "desired state", which primarily includes the configuration of all deployed services.
With tools like Terraform, the manual effort required to maintain this state decreases. Terraform, along with other infrastructure-as-code solutions, streamlines the process by enabling a code-first approach to automating environments. To read more about Terraform and this approach, click here.
Descope provides a terraform provider that allows managing Descope projects and configuration.
Prerequisites
Note
The terraform provider works with "Pro" or "Enterprise" type license. If you are having trouble with licensing, please contant the developer success team.
- Terraform CLI installed.
- A project already created in Descope.
Management Key
. Create One on the Company Settings. If you intend to create a new project, make sure the key is scoped for use in all projects.
Using the Terraform Provider
-
Create a
.tf
file. -
Import the Descope Provider inside the file.
- Initiate the provider with the needed parameters.
Note
Provide an existing project's id (won't be impacted by terraform) and the management key.
- Create a new project resource.
Examples
All of the examples are set inside the Descope project resource we created.
Project Settings
Use the following object to declare and specify the project's settings.
Authorization
Use the following object to declare and specify the project's Authorization.
Authentication
Use the following object to declare and specify the project's Authentication methods.
Attributes
Connectors
Note
This section uses terraform variables.
Applications
Combined
Using the terraform in environments
The state file stores the relevant information for each descope project created as a resource in the tf file.
-
Make sure to have the ability to store and access the state file.
-
Use
terraform plan
to make sure the project resource has the right changes. -
Use
terraform apply
to apply the changes.