Connector Configuration Reference
Complete configuration examples for common connector types, including YAML definitions, Terraform HCL, and REST API endpoints.
This reference collects complete configuration examples for the most common connector types, in YAML, Terraform HCL, and REST API form. Use it when you define connectors as code rather than through the UI, or when you need to confirm the exact field names and secret reference syntax that Harness expects.
Credential reference
Connectors reference secrets stored in Harness Secret Manager or an external vault. Secret references follow a scoped naming convention that determines where the secret is resolved from.
Secret reference format
account.SecretName
Account-level secret
account.github_pat
org.SecretName
Organization-level secret
org.aws_access_key
SecretName
Project-level secret (default)
docker_password
Authentication methods
The authentication method determines how credentials are presented to the external service.
Username and token
A username paired with a personal access token or password, stored as separate secrets.
SSH key
An SSH private key stored as a Harness SSH secret, used for Git SSH connections.
OAuth
An OAuth 2.0 flow that uses a configured OAuth app. The platform manages token refresh automatically.
IAM role (AWS)
Assume an Identity and Access Management (IAM) role using Security Token Service (STS). Requires a trust relationship with the Harness delegate or a cross-account role ARN.
Service account key (GCP)
A JSON key file for a GCP service account, stored as a Harness file secret.
Inherit from delegate
Use the credentials available on the delegate host, for example, an instance profile or workload identity.
Delegate selectors
Delegate selectors route connector operations to specific delegates. Use them when the target service is in a private network, or when only certain delegates have the required network access or credentials.
GitHub connector examples
The following examples show Git provider connector configuration for both HTTP and SSH connection types.
GitHub HTTP connector
GitLab SSH connector
The type: Account field at the end of the spec indicates that the URL points to the organization or account level, for example, https://github.com/my-org. Set this field to Repo when the URL points to a specific repository. Use account-level URLs where possible, because a single connector can then access all repositories in the organization.
AWS connector example
AWS connectors support multiple credential types, including access keys, IAM roles, and delegate-inherited credentials. The following example uses IAM role-based authentication with cross-account access.
AWS IAM role inherited from the delegate
Kubernetes connector example
Kubernetes connectors provide access to clusters for deployment operations. The following example uses a service account token for authentication.
Kubernetes via delegate (in-cluster)
When the Harness Delegate runs inside the target Kubernetes cluster, use the Inherit from Delegate credential type. The delegate uses its own service account token and the in-cluster API endpoint, so no additional credentials are required. Confirm that the delegate's service account holds the Kubernetes RBAC permissions required for deployment operations.
HashiCorp Vault connector example
The Vault connector integrates with HashiCorp Vault for centralized secrets management. The following example configures Vault with token authentication and the KV v2 secrets engine.
Vault with AppRole authentication
For more information on generating the role ID and secret ID, see AppRole authentication.
When you use token authentication, confirm that the token has a sufficient time to live (TTL) and that renewalIntervalMinutes is set to a value lower than the token TTL. Harness renews the token automatically at this interval. If the token expires, all secrets stored in Vault become inaccessible until you configure a new token.
Terraform provider
The Harness Terraform provider enables infrastructure-as-code management of connectors. The following examples create connectors using HCL.
API reference
Manage connectors programmatically through the Harness REST API when you automate onboarding or synchronize connectors from an external system. The following endpoints are available for connector CRUD operations.
POST
/v1/connectors
Create a new connector.
GET
/v1/connectors
List connectors with optional filters.
GET
/v1/connectors/{identifier}
Get a specific connector by identifier.
PUT
/v1/connectors/{identifier}
Update an existing connector.
DELETE
/v1/connectors/{identifier}
Delete a connector.
POST
/v1/connectors/test-connection/{identifier}
Test the connectivity of an existing connector.
POST
/v1/connectors/test-connection
Test a connector configuration without saving it.
All API requests require an x-api-key header with a valid Harness API key and a Harness-Account header with your account identifier. For Organization-scoped or Project-scoped connectors, include the org and project query parameters.
Related articles
Manage connectors: To test, edit, and audit connectors in the Harness UI.
Connector troubleshooting: To resolve authentication, network, and scope resolution failures.
Pipeline YAML v1 overview: To reference a connector from a pipeline stage.
Last updated
Was this helpful?