Skip to content

Instantly share code, notes, and snippets.

View rssnyder's full-sized avatar
🥨
limitless servers in a serverless world

Riley Snyder rssnyder

🥨
limitless servers in a serverless world
View GitHub Profile
@rssnyder
rssnyder / vm.md
Created February 23, 2026 17:18
ci vm build farm dependencies

harness artifacts are needed for configuring binaries on the build vm machines as well as the docker images used on those machines (in pipelines).

--

for the docker images used in ci pipelines (harness steps are containers) we have a handy API that can retrive the current images:tags used in your account: https://developer.harness.io/docs/continuous-integration/use-ci/set-up-build-infrastructure/harness-ci/#specify-the-harness-ci-images-used-in-your-pipelines

pay close attention to the Send a get-default-config request to get a list of the latest Harness CI build images and tags and you will need to specify k8 or VM depending on your target infra model.

an example curl call is on the same page

@rssnyder
rssnyder / template.rego
Last active February 19, 2026 19:32
template governance
package template
import future.keywords.in
required_tags = {"ci", "cd", "db"}
any_required_tag_exists(map) {
some key in required_tags
_ = map[key]
}
@rssnyder
rssnyder / perms.md
Last active February 5, 2026 19:22
harness permissions 2/3/26

artifact_artregistry_delete artifact_artregistry_deleteartifact artifact_artregistry_downloadartifact artifact_artregistry_edit artifact_artregistry_quarantineartifact artifact_artregistry_uploadartifact artifact_artregistry_view cde_gitspace_create cde_gitspace_delete cde_gitspace_edit

@rssnyder
rssnyder / uninstall_hsf.sh
Last active January 8, 2026 00:07
remove hsf from a harness account
#!/bin/bash
echo "Deleting HSF in account $HARNESS_ACCOUNT_ID. Enter to proceed or Ctr-C to cancel..."
read
echo "Deleting org..."
curl -X DELETE 'https://app.harness.io/v1/orgs/Harness_Platform_Management' \
-H "x-api-key: $HARNESS_PLATFORM_API_KEY" \
-H "Harness-Account: $HARNESS_ACCOUNT_ID"
@rssnyder
rssnyder / dups.py
Created December 3, 2025 15:45
find duplicate k8s/ccm connectors
from doctest import master
from os import getenv
from json import dumps
from requests import post
def get_connectors(type: str, page: int = 0, size: int = 10):
resp = post(
"https://app.harness.io/gateway/ng/api/connectors/listV2",
@rssnyder
rssnyder / autostopping-alb.json
Last active December 29, 2025 14:16
ccm json perms
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"acm:ListCertificates",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:CreateLoadBalancer",
"elasticloadbalancing:DescribeTargetGroups",
"elasticloadbalancing:CreateTargetGroup",
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 %}
@rssnyder
rssnyder / tf_output_json_container.yaml
Created July 2, 2025 20:47
generate tf outputs in iacm stage
- 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: |-
@rssnyder
rssnyder / hsf-custom.yaml
Last active October 20, 2025 14:12
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:
@rssnyder
rssnyder / role.tf
Created June 18, 2025 17:11
Create a copy of the default Project Admin role
#
# 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"