Hanzo

Project Templates

Learn how to manage and apply project templates

Concept

Project Templates streamline your ability to set up projects by providing customizable templates to configure projects quickly with a predefined set of environments and roles.

Project Templates is a paid feature.

Workflow

The typical workflow for using Project Templates consists of the following steps:

  1. Creating a project template: As part of this step, you will configure a set of environments and roles to be created when applying this template to a project.
  2. Using a project template: When creating new projects, optionally specify a project template to provision the project with the configured roles and environments.

Note that this workflow can be executed via the Hanzo KMS UI or through the API.

Guide to Creating a Project Template

In the following steps, we'll explore how to set up a project template.

Navigate to the Project Templates tab on the Feature Settings page for the project type you want to create a template for and tap on the Add Template button. project template add button

Specify your template details. Here's some guidance on each field:

  • Name: A slug-friendly name for the template.
  • Description: An optional description of the intended usage of this template.

project template create modal

Once your template is created, you'll be directed to the configuration section. project template edit form

Customize the environments and roles to your needs. project template customized

Be sure to save your environment and role changes.

To create a project template, make an API request to the Create Project Template API endpoint.

Sample request

curl --request POST \
--url https://app.kms.hanzo.ai/api/v1/project-templates \
--header 'Content-Type: application/json' \
--data '{
    "name": "my-project-template",
    "type": "secret-manager",
    "description": "...",
    "environments": "[...]",
    "roles": "[...]",
}'

Sample response

{
    "projectTemplate": {
        "id": "<template-id>",
        "name": "my-project-template",
        "description": "...",
        "environments": "[...]",
        "roles": "[...]",
        "orgId": "<org-id>",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
    }
}

Guide to Using a Project Template

In the following steps, we'll explore how to use a project template when creating a project.

When creating a new project, select the desired template from the dropdown menu in the create project modal. kms key options

Your project will be provisioned with the configured template roles and environments.

To use a project template, make an API request to the Create Project API endpoint with the specified template name included.

Sample request

curl --request POST \
--url https://app.kms.hanzo.ai/api/v1/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "projectName": "My Project",
    "template": "<template-name>", // defaults to "default"
}'

Sample response

{
    "project": {
        "id": "<project-id>",
        "environments": "[...]", // configured environments
        ...
    }
}

Note that configured roles are not included in the project response.

FAQ

No. Project templates only apply at the time of project creation.

How is this guide?

Last updated on

On this page