Skip to content

Instantly share code, notes, and snippets.

@rssnyder
Last active October 20, 2025 14:12
Show Gist options
  • Select an option

  • Save rssnyder/82a2cd762b931fd390df0b7b2bac6adb to your computer and use it in GitHub Desktop.

Select an option

Save rssnyder/82a2cd762b931fd390df0b7b2bac6adb to your computer and use it in GitHub Desktop.
hsf workflow template for custom templates
apiVersion: harness.io/v1
kind: Workflow
name: external-template-test
identifier: external_template_test
type: service
owner: group:account/HSF_Admins
metadata:
tags:
- solutions-factory
spec:
owner: group:default/harness_account_all_users
type: test
parameters:
- title: external-template-test
properties:
name:
title: Template Name
type: string
projectId:
title: Project Identifier
description: Harness Project Identifier
type: string
ui:field: HarnessProjectPicker
orgId:
title: Org Identifier
description: Harness Organization Identifier
type: string
ui:field: HarnessAutoOrgPicker
token:
title: Harness Token
type: string
ui:widget: password
ui:field: HarnessAuthToken
- title: Solutions Factory Connection
properties:
solutions_factory_details:
title: Solutions Factory Details
type: object
description: |
---
Harness URL : <+variable.account.solutions_factory_endpoint>
Harness Account : <+account.identifier>
Solutions Factory Org : <+variable.account.solutions_factory_org>
Solutions Factory Project : <+variable.account.solutions_factory_project>
properties:
harness_account_url:
type: string
default: <+variable.account.solutions_factory_endpoint>
ui:widget: hidden
harness_account_id:
type: string
default: <+account.identifier>
ui:widget: hidden
harness_org_id:
type: string
default: <+variable.account.solutions_factory_org>
ui:widget: hidden
harness_project_id:
type: string
default: <+variable.account.solutions_factory_project>
ui:widget: hidden
template_library_connector:
type: string
default: <+variable.account.solutions_factory_template_library_connector>
ui:widget: hidden
template_library_repo:
type: string
default: <+variable.account.solutions_factory_template_library_repo>
ui:widget: hidden
template_library_branch:
type: string
default: main
ui:widget: hidden
steps:
- id: configure_workspace
name: Configuring Harness Workspace
action: trigger:harness-custom-pipeline
input:
url: ${{ parameters.solutions_factory_details.harness_account_url }}/ng/account/${{ parameters.solutions_factory_details.harness_account_id }}/all/orgs/${{ parameters.solutions_factory_details.harness_org_id }}/projects/${{ parameters.solutions_factory_details.harness_project_id }}/pipelines/Create_and_Manage_IACM_Workspaces/pipeline-studio?storeType=INLINE
inputset:
# Git details for external terraform template
GIT_REPOSITORY_CONNECTOR: account.buildfarm_source_code_manager_cloud
GIT_REPOSITORY_NAME: terraform-aws-modules/terraform-aws-eks
GIT_REPOSITORY_BRANCH: master
# Leave out if root directory is where the TF code lives
GIT_REPOSITORY_PATH: "tf-code-dir"
# Project where we want the workspace provisioned
WORKSPACE_ORG: ${{ parameters.org_id }}
WORKSPACE_PROJECT: ${{ parameters.project_id }}
# Cloud connector to use for workspace
# Leave out if no connector needed
IAC_PROVIDER_CONNECTOR: "account.harness_impeng_play"
# Workspace name and owner
RESOURCE_NAME: ${{ parameters.name|replace(" ", "_")|replace("-", "_") }}
RESOURCE_OWNER: group:default/harness_account_all_users
# YAML of Terraform variables of type 'String' mapped to their IDP parameters
RESOURCE_VARS:
some_terraform_variable: ${{ parameters.example }}
# YAML of Terraform variables of type 'Secret' Reference mapped to their IDP parameters
RESOURCE_VARS_SECRETS: {}
# YAML of Environment variables of type 'String' mapped to their IDP parameters
RESOURCE_VARS_ENVS:
some_environment_variable: ${{ parameters.example }}
# YAML of Environment variables of type 'Secret' Reference mapped to their IDP parameters
RESOURCE_VARS_ENVS_SECRET: {}
# If you want the created workspace to leverage a workspace template
WORKSPACE_TEMPLATE_IDENTIFIER: eks_cluster
WORKSPACE_TEMPLATE_VERSION: v1.0
# If the provisioning pipeline should pause before deployment
REQUIRES_APPROVAL: "false"
# Tags to add to the created workspace
WORKSPACE_TAGS:
source: IDP
# Should the workspace automatically include the default Harness Connector environment variables
INCLUDE_HARNESS_ENVS: "false"
apikey: ${{ parameters.token }}
showOutputVariables: true
output:
links:
- title: Harness Workspace Configured - Execution Link
url: ${{ steps.configure_workspace.output.PipelineUrl }}
- title: Harness Workspace Provisioned - Execution Link
url: ${{ steps.provision_workspace.output.PipelineUrl }}
- title: Harness Workspace
url: ${{ parameters.solutions_factory_details.harness_account_url }}/ng/account/${{ parameters.solutions_factory_details.harness_account_id }}/all/iacm/orgs/${{ parameters.orgId }}/projects/${{ parameters.projectId }}/workspaces/${{ parameters.name|replace(" ", "_")|replace("-", "_") }}/resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment