Skip to main content

Terraform provider

Last updated on

Use the official Harness Terraform provider to manage Harness resources as code. The provider supports creating and managing environments, traffic types, segments, feature flags, flag sets, and API keys.

Resources

The following Harness FME resources are available in the Harness Terraform provider.

Feature flags

ResourceDescription
harness_fme_feature_flagCreate and manage a feature flag.
harness_fme_feature_flag_definitionCreate and manage a feature flag definition, including treatments and targeting rules.
harness_fme_flag_setCreate and manage a flag set for grouping related feature flags.

Environments

ResourceDescription
harness_fme_environmentCreate and manage an environment within a project.

Segments

ResourceDescription
harness_fme_segmentCreate and manage a standard segment.
harness_fme_segment_environment_associationAssociate a standard segment with an environment.
harness_fme_environment_segment_keysManage the list of keys within a segment for a specific environment.
harness_fme_rule_based_segmentCreate and manage a rule-based segment using attribute-based targeting rules.
harness_fme_rule_based_segment_environment_associationAssociate a rule-based segment with an environment.
harness_fme_large_segmentCreate and manage a large segment optimized for high-volume key lists.
harness_fme_large_segment_environment_associationAssociate a large segment with an environment.

Traffic types

ResourceDescription
harness_fme_traffic_typeCreate and manage a traffic type within a project.
harness_fme_traffic_type_attributeManage custom attributes and suggested values for a traffic type.

API keys

ResourceDescription
harness_fme_api_keyCreate and manage API keys for authenticating with the Harness FME API.

Data sources

Data sourceDescription
harness_fme_workspaceLook up a Harness FME project by the workspace name, or by Harness organization and project identifiers.

Example usage

# Look up by Harness organization and project identifiers
data "harness_fme_workspace" "by_project" {
org_id = "organization_id"
project_id = "project_id"
}

# Look up by exact workspace name
data "harness_fme_workspace" "by_name" {
name = "my-workspace-name"
}

Use the Harness Terraform provider

Go to the Harness provider on the Terraform Registry to review full provider documentation, configuration options, and examples.