No description
Find a file
Mirko Teodorović 7557becbdf fix: [CDS-116912]: Fix some missing fields ignore_application_differences, strategy, sync_policy, path_param_prefix (#1318)
* 1b2dde fix: [CDS-116912]: Fix app tst

* 6b8324 fix tests

* f1b8d4 prevent destroy of approject as there are child apps of applications not cleaned up timely

* 05f69d fix: [CDS-116912]: Fix some missing fields ignore_application_differences, strategy, sync_policy, path_param_prefix
2025-12-08 10:53:06 +00:00
.changelog fix: [CDS-115446]: Fix matrix generator (#1309) 2025-11-06 08:32:05 +00:00
.github Update CODEOWNERS 2025-08-04 14:51:51 +05:30
.harness Update Pull Request Template 2025-08-05 16:12:08 +05:30
docs feat: [CCM-27683]: Call Delete Cluster Orchestrator API on terraform destroy (#1317) 2025-11-24 10:18:54 +00:00
examples Revert Pull Request #1312 "feat: [PL-66266]: KmsKeyId addition for AWS secret manager secrets" (#1315) 2025-11-20 07:09:44 +00:00
helpers feat: improve policy API error handling (#1283) 2025-07-31 16:34:19 +05:30
internal fix: [CDS-116912]: Fix some missing fields ignore_application_differences, strategy, sync_policy, path_param_prefix (#1318) 2025-12-08 10:53:06 +00:00
scripts Update Issue Links in Changelog (#172) 2022-07-27 08:50:31 -04:00
templates Update title on main page 2023-01-09 19:21:44 +05:30
tools fix: [PL-61598]: Resolved Vulnerabilities for ABSA (#1212) 2025-03-29 00:40:07 +05:30
.envrc Added cloud provider support 2021-08-10 13:31:27 -04:00
.gitignore fix: [PL-61433]: Update Go Image and Vulnerabilities (#1209) 2025-03-27 15:54:16 +05:30
.gitleaksignore Added security exception to exclude false alarm raised on key in branch CCM-12839 (#695) 2023-09-15 11:34:57 +05:30
.goreleaser.yml fix: [PL-61433]: Update Go Image and Vulnerabilities (#1209) 2025-03-27 15:54:16 +05:30
.tool-versions nextgen code split 2022-03-13 20:19:30 -04:00
CENTRAL_NOTIFICATIONS_TEST_PLAN.md feat: [PL-65602]: Automation for Central Notification System (Channels, Rules, Templates) (#1300) 2025-10-23 05:12:51 +00:00
CHANGELOG.md Update CHANGELOG file 2025-08-22 15:35:29 +05:30
go.mod feat: [CCM-27683]: Call Delete Cluster Orchestrator API on terraform destroy (#1317) 2025-11-24 10:18:54 +00:00
go.sum feat: [CCM-27683]: Call Delete Cluster Orchestrator API on terraform destroy (#1317) 2025-11-24 10:18:54 +00:00
LICENSE.md Added license and updated readme 2021-09-30 08:53:45 -04:00
main.go Moved from harness-io to harness github org 2022-02-28 19:24:34 -06:00
Makefile Moved from harness-io to harness github org 2022-02-28 19:24:34 -06:00
README.md Enhance README with comprehensive documentation 2025-08-23 00:02:49 +05:30

Harness Terraform Provider

GitHub release License Website

Overview

The Terraform provider for Harness allows you to manage resources in Harness CD and NextGen platforms using infrastructure as code. This provider enables you to automate the provisioning and management of Harness resources such as applications, pipelines, environments, services, connectors, and more.

Features

  • First Generation & NextGen Support: Manage resources in both Harness First Generation and NextGen platforms
  • Comprehensive Resource Management: Create and manage applications, pipelines, environments, services, connectors, and more
  • GitOps Integration: Configure GitOps applications, repositories, and clusters
  • Policy Management: Define and enforce governance policies and policy sets
  • Feature Flag Management: Configure and manage feature flags for your applications
  • AutoStopping Rules: Set up cost optimization with AutoStopping rules for various cloud providers

Documentation

Full, comprehensive documentation is available on the Terraform Registry website:

Requirements

Usage

Provider Configuration

terraform {
  required_providers {
    harness = {
      source = "harness/harness"
      version = "0.38.5"
    }
  }
}

# Configure the Harness provider for First Gen resources
provider "harness" {
  endpoint   = "https://app.harness.io/gateway"
  account_id = "YOUR_HARNESS_ACCOUNT_ID"
  api_key    = "YOUR_HARNESS_API_KEY"
}

# Configure the Harness provider for Next Gen resources
provider "harness" {
  endpoint         = "https://app.harness.io/gateway"
  account_id       = "YOUR_HARNESS_ACCOUNT_ID"
  platform_api_key = "YOUR_HARNESS_PLATFORM_API_KEY"
}

Installation

The provider is available on the Terraform Registry and will be automatically downloaded when you run terraform init in a configuration that requires it.

Building and Testing Locally

  1. Clone the repository:

    git clone https://github.com/harness/terraform-provider-harness.git
    cd terraform-provider-harness
    
  2. Install dependencies:

    go mod tidy
    
  3. Build the provider:

    go build -o terraform-provider-harness
    
  4. Create a file called local.sh in the root directory with the following content:

    #!/bin/sh
    
    version=0.40.2 # Specify in this format
    source=registry.terraform.io/harness/harness
    platform=darwin_amd64 # Use darwin_arm64 for Apple Silicon based Mac
    
    mkdir -p ~/.terraform.d/plugins/$source/$version/$platform/
    
    cp terraform-provider-harness ~/.terraform.d/plugins/$source/$version/$platform/terraform-provider-harness
    
  5. Make the script executable and run it:

    chmod +x local.sh
    ./local.sh
    

Configure Terraform to Use Local Build

  1. Update the Terraform CLI configuration file (.terraformrc on macOS/Linux, terraform.rc on Windows):
    provider_installation {
      dev_overrides {
        "registry.terraform.io/harness/harness" = "/path/to/terraform-provider-harness"
      }
      direct {}
    }
    

Note: Ensure the terraform provider version in your configuration matches the version in the local.sh script.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you have any questions or need assistance:

License

This project is licensed under the terms of the LICENSE file.