harbor-terraform

Manages Harbor registry infrastructure as code using the goharbor Terraform provider.

4|2|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/Aidas-dev/k8s-agent-skills --skill harbor-terraform-aidas-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: harbor-terraform
Source: https://github.com/Aidas-dev/k8s-agent-skills/tree/main/skills/harbor-terraform
Command: npx skills add https://github.com/Aidas-dev/k8s-agent-skills --skill harbor-terraform-aidas-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Harbor container registry resources (projects, robot accounts, replication, retention policies) through the UI is manual and error-prone. This Skill provides complete reference knowledge for codifying Harbor infrastructure with the goharbor/terraform-provider-harbor. ## Core Features & Use Cases - Full Resource Coverage: Documents all 20 resources including projects, robot accounts, registries, replication rules, retention policies, webhooks, users, groups, and system configuration. - Provider Configuration Guidance: Covers authentication methods (basic auth, bearer token, OIDC session), TLS settings, and version constraints for Harbor 2.13–2.15 with Terraform 1.12–1.14. - Common Mistakes Reference: Documents pitfalls like robot secret state handling, force_destroy requirements, registry_id vs id confusion, and v3.12.0 registry availability gaps. - Use Case: You need to provision a Harbor project with a CI robot account, replication to a DR site, and a retention policy. Use this Skill to generate correct HCL with proper resource references and avoid state management pitfalls. ## Quick Start Ask the agent to write Terraform configuration for a Harbor project with a robot account and replication rule using the goharbor provider.

Frequently Asked Questions about harbor-terraform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage Harbor projects with Terraform?▼

Use the harbor_project resource from the goharbor/harbor provider to define projects with settings like vulnerability scanning, storage quotas, deployment security levels, and content trust. Set force_destroy to true if you need to delete projects that still contain repositories.

How to create Harbor robot accounts in Terraform?▼

Use the harbor_robot_account resource with level set to system or project, and define permissions blocks specifying kind, namespace, and access rules. Store the secret using a random_password resource since the secret field is sensitive and must be captured in state.

What authentication methods does the Harbor Terraform provider support?▼

The provider supports basic auth with username and password, bearer token authentication, and OIDC session_id authentication. Basic auth credentials can also be supplied via HARBOR_USERNAME and HARBOR_PASSWORD environment variables.

Does the Harbor Terraform provider support proxy cache projects?▼

Yes, create a harbor_registry resource pointing to the upstream registry like Docker Hub, then reference its registry_id in a harbor_project resource. Harbor 2.15.1+ also supports proxy_cache_local_on_not_found for fallback behavior.

Why does Harbor Terraform import fail for robot accounts?▼

Robot accounts import using the /robots/<id> format, not the project path. Also note that robot prefix auto-detection requires admin API access; without it, set robot_prefix explicitly in the provider configuration.

What are the limitations of the goharbor Harbor provider?▼

Provider v3.12.0 features like per-project scanner overrides are not yet on the Terraform Registry, which hosts v3.11.6. OIDC session_id auth is experimental and may be deprecated, so prefer bearer token or basic auth for stability.