mirror of
https://github.com/hanzokms/terraform-provider.git
synced 2026-10-30 20:29:45 +00:00
3.5 KiB
3.5 KiB
page_title, subcategory, description
| page_title | subcategory | description |
|---|---|---|
| kms_project_template Resource - terraform-provider | Projects | Create project templates & save to Hanzo KMS. Only Machine Identity authentication is supported for this resource. |
kms_project_template (Resource)
Create project templates & save to Hanzo KMS. Only Machine Identity authentication is supported for this resource.
Example Usage
terraform {
required_providers {
kms = {
# version = <latest version>
source = "hanzokms/kms"
}
}
}
provider "kms" {
host = "https://kms.hanzo.ai" # Only required if using self hosted instance of Hanzo KMS, default is https://kms.hanzo.ai
auth = {
universal = {
client_id = "<machine-identity-client-id>"
client_secret = "<machine-identity-client-secret>"
}
}
}
resource "kms_project_template" "example-project-template" {
name = "example-project-template"
description = "This is an example project template"
type = "secret-manager"
environments = [{
name = "development",
slug = "dev",
position = 1
}]
roles = [{
name = "Test",
slug = "test",
permissions = [
{
action = ["edit"]
subject = "secret-folders",
inverted = true,
},
{
action = ["read", "edit"]
subject = "secrets",
conditions = jsonencode({
environment = {
"$in" = ["dev", "prod"]
"$eq" = "dev"
}
secretPath = {
"$eq" = "/"
}
})
},
]
}]
}
Schema
Required
name(String) The name of the project templatetype(String) The type of the project template. Refer to the documentation here https://hanzo.ai/docs/api-reference/endpoints/project-templates/create#body-type for the available options
Optional
description(String) The description of the project templateenvironments(Attributes List) The environments for the project template (see below for nested schema)roles(Attributes List) The roles for the project template (see below for nested schema)
Read-Only
id(String) The ID of the project template
Nested Schema for environments
Required:
name(String) The name of the environmentposition(Number) The position of the environmentslug(String) The slug of the environment
Nested Schema for roles
Required:
name(String) The name of the roleslug(String) The slug of the role
Optional:
permissions(Attributes List) The permissions assigned to the role. Refer to the documentation here https://hanzo.ai/docs/api-reference/endpoints/project-templates/create#body-roles-permissions for its usage. (see below for nested schema)
Nested Schema for roles.permissions
Required:
action(Set of String) Describe what actions an entity can take.subject(String) Describe the entity the permission pertains to.
Optional:
conditions(String) When specified, only matching conditions will be allowed to access given resource. Refer to the documentation in https://hanzo.ai/docs/internals/permissions#conditions for the complete list of supported properties and operators.inverted(Boolean) Whether rule forbids. Set this to true if permission forbids.