Last updated

Frontegg Terraform provider


Prerequisites

Terraform ≥ 1.0.3m
Go ≥ 1.20

Using the provider

See the Terraform Registry - HERE.

Importing existing resources

Workspaces

To import an existing workspace, first add a shim resource definition to your Terraform project:

resource "frontegg_workspace" "example" {}

Then run terraform import, specifying the address of the resource you declared above (frontegg_workspace.example) and your workspace ID (i.e., your API client ID):


$ terraform import frontegg_workspace.example 65e2d503-c187-4d55-8ba5-816bd4a15f96
frontegg_workspace.example: Importing from ID "65e2d503-c187-4d55-8ba5-816bd4a15f96"...
frontegg_workspace.example: Import prepared!
  Prepared frontegg_workspace for import
frontegg_workspace.example: Refreshing state... [id=65e2d503-c187-4d55-8ba5-816bd4a15f96]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

Next, run terraform state show to show the configuration values Terraform has imported:


$ terraform state show frontegg_workspace.example
# frontegg_workspace.example:
resource "frontegg_workspace" "example" {
    allowed_origins     = [
        "https://yourcompany.com",
    ]
    backend_stack       = "Python"
    country             = "US"
    frontegg_domain     = "yourcompany.frontegg.com"
    # ...
}

Finally, you can copy that output back into your main.tf file (or equivalent). Beware that you may need to manually remove some output properties from the resource, like jwt_public_key.

You should verify that terraform plan reports no diffs.

Roles, permissions, and permission categories

The procedure is the same as above, except that the IDs for the role, permission, or permission category are UUIDs.

You can either query the Frontegg API yourself to find these IDs, or you can use your browser's developer tools to get the IDs out of the network requests as you browse the Frontegg Portal.


Functionalities Support

Please note that this provider may not offer full support for all Frontegg capabilities. If you require assistance or support for a specific functionality, please contact us at support@frontegg.com.