Skip to content

Terraform Provider

The Shoehorn Terraform provider lets you manage Shoehorn resources as code. Use it for catalog entities, teams, tenant settings, integrations, Kubernetes agents, governance actions, Forge resources, and marketplace installations.

The provider is API-only. Deploy Shoehorn itself with Helm, then manage the platform state with Terraform.

Use the Terraform Registry provider source:

terraform {
required_providers {
shoehorn = {
source = "shoehorn-dev/shoehorn"
version = "~> 0.1"
}
}
}
provider "shoehorn" {
host = "https://shoehorn.example.com"
api_key = var.shoehorn_api_key
timeout = 30
}

You can also provide credentials through environment variables:

  • SHOEHORN_HOST
  • SHOEHORN_API_KEY

Use a service API key with the scopes required for the resources you manage.

resource "shoehorn_team" "platform" {
name = "Platform Engineering"
slug = "platform-team"
description = "Owns shared developer infrastructure"
}
resource "shoehorn_entity" "portal" {
service_id = "developer-portal"
name = "Developer Portal"
type = "service"
entity_lifecycle = "production"
owner = shoehorn_team.platform.slug
description = "Internal developer portal"
tags = ["platform", "internal"]
}
resource "shoehorn_k8s_agent" "prod" {
cluster_id = "prod-us-east-1"
name = "Production US East 1"
}
ResourcePurpose
shoehorn_entityCatalog entities
shoehorn_teamTeams and metadata
shoehorn_feature_flagTenant feature flags
shoehorn_tenant_settingsBranding, hidden pages, Forge settings
shoehorn_integrationExternal integrations
shoehorn_api_keyService API keys
shoehorn_user_roleUser RBAC assignments
shoehorn_group_role_mappingIdP group to role mappings
shoehorn_k8s_agentCluster registration and agent tokens
shoehorn_platform_policyConfigure seeded platform policies
shoehorn_governance_actionGovernance action items
shoehorn_forge_moldForge mold definitions
shoehorn_forge_approval_policyForge approval chains
shoehorn_marketplace_installationMarketplace addon lifecycle
Data SourcePurpose
shoehorn_entitiesList and filter entities
shoehorn_teamsList teams
shoehorn_feature_flagsList feature flags
shoehorn_integrationsList integrations
shoehorn_api_keysList API keys without returning secrets
shoehorn_k8s_agentsList registered K8s agents
shoehorn_platform_policiesList platform policies
shoehorn_usersList users
shoehorn_groupsList groups and group-role assignments
shoehorn_governance_actionsList governance actions with filters
shoehorn_forge_moldsList Forge molds
shoehorn_marketplace_itemsList marketplace catalog items
shoehorn_gitops_resourcesRead GitOps resources discovered from clusters
resource "shoehorn_team" "payments" {
name = "Payments"
slug = "payments-team"
description = "Payments and billing team"
}
resource "shoehorn_entity" "payment_api" {
service_id = "payment-api"
name = "Payment API"
type = "service"
entity_lifecycle = "production"
owner = shoehorn_team.payments.slug
}
resource "shoehorn_tenant_settings" "main" {
platform_name = "Acme Portal"
highlight_color = "#0f766e"
hidden_pages = ["insights"]
forge = {
allowed_orgs = ["acme-platform", "acme-services"]
default_org = "acme-platform"
}
}
data "shoehorn_gitops_resources" "argocd" {
tool = "argocd"
}

The provider uses the same API and RBAC model as the UI and CLI. In practice:

  • Use read-only scopes for data sources.
  • Add write scopes for any managed resources.
  • Use admin-capable keys for tenant settings, policies, API keys, or organization-wide automation.

If you are unsure, create a dedicated service API key for Terraform and start with the narrowest set of scopes needed for your plan.

  • shoehorn_entity uses entity_lifecycle instead of lifecycle because lifecycle is reserved by Terraform.
  • API keys and K8s agent tokens are only returned on creation. Treat Terraform state as sensitive.
  • shoehorn_platform_policy manages configuration for existing platform policies. The provider does not create or delete the default policy set.
  • GitOps resources are read-only today. They are discovered from connected clusters.