HARNESS_ACCOUNT_ID: harness account id
HARNESS_PLATFORM_API_KEY: harness api key, requires delegate:read and connectors:read/write
NEW_FEATURE: new feature to add to connectors
| apiVersion: harness.io/v1 | |
| kind: resource | |
| identifier: {{ resource_name | replace(" ","-") | replace("-","_") | lower }} | |
| name: {{ resource_name }} | |
| type: hsf_workspace | |
| owner: {{ owner if owner else "group:account/HSF_Admins"}} | |
| metadata: | |
| description: {{ description if description else "Automatically registered Harness Solutions Factory" }} | |
| annotations: | |
| {%- if workspace_uri %} |
| - step: | |
| type: Run | |
| name: tf output json container | |
| identifier: tf_output_json_container | |
| spec: | |
| # use the Harness plugin used by TF steps to avoid pulling another container | |
| connectorRef: account.harnessImage | |
| image: plugins/harness_terraform:latest | |
| shell: Sh | |
| command: |- |
| 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: |
| # | |
| # Create a copy of a built in role by copying the permissions and removing any that are not needed | |
| # | |
| # usage: tf apply -var org_id=default -var project_id=default -var scopes_to_remove='["iac_workspace_approve","idp_plugin_edit"]' | |
| # | |
| terraform { | |
| required_providers { | |
| harness = { | |
| source = "harness/harness" |
| terraform { | |
| required_providers { | |
| harness = { | |
| source = "harness/harness" | |
| } | |
| } | |
| } | |
| variable "folder_id" { | |
| type = string |
| Content-Type: multipart/mixed; boundary="//" | |
| MIME-Version: 1.0 | |
| --// | |
| Content-Type: text/cloud-config; charset="us-ascii" | |
| MIME-Version: 1.0 | |
| Content-Transfer-Encoding: 7bit | |
| Content-Disposition: attachment; filename="cloud-config.txt" | |
| #cloud-config |
| terraform { | |
| required_providers { | |
| harness = { | |
| source = "harness/harness" | |
| } | |
| aws = { | |
| source = "hashicorp/aws" | |
| } | |
| } | |
| } |
| resource "aws_iam_policy" "harness_actions" { | |
| name = "harness_actions" | |
| policy = jsonencode({ | |
| Version = "2012-10-17" | |
| Statement = [ | |
| { | |
| Action = [ | |
| "ec2:DeleteSnapshot", | |
| "rds:StartDBCluster", |
| terraform { | |
| required_providers { | |
| aws = { | |
| source = "hashicorp/aws" | |
| version = "~> 5.0" | |
| } | |
| } | |
| } | |
| variable "region" { |