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 / 3party.md
Created March 30, 2026 20:46
upload 3party data into harness ccm via api
  1. Here is a python implementation of the below process

  2. Call GET signed url. This is needed for any upload.

curl 'https://app.harness.io/gateway/ccm/api/externaldata/signedurl?providerId=<provider id>&accountIdentifier=<account id>&invoicePeriod=20250401-20250501&objectName=<csv file>.csv' \
  -H 'x-api-key: <api key>' \
  -H 'content-type: application/json'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/2cE6rUvhdb+lY6RENlicABrqZn+3T7aZn078yCWPRkGgjMMgfnDLQmR98J1kIk2P5GhjgORYb1aAO1yXtUlQf7ZwLj9FtgnJB/tFwY/KJjtvHfV9Ph06HsCpdPD9XVrJ0UnGZ+q46aGxm0LbfhdZXkF4RQk5WSWU41Iifzr7hbXkL2Hs/aclKk8yTZoXI6KWf5IAAROH7M8tHCVYWyJPQaKOrxVlgmuiKxHkj5cwEdmR8GdlS/CICbm/OovH/OKldJRYHQtdxcPyCoOjzulkcyUjKqf+0RlNtd/QLcGRFFtFLrLaVuPswg7wKFoA50xnrV0+qwO0Q6LaIxEhRFhOSvcGwnq2lewtt7kzq021CswA7+UXxRuPjNv+EY0VD4dT6lJInHYYQlIwS9LxkZMkK+4RwW/Ww6iarYWdZM7u8I89YNG/THIYSsAJiYM1rAQnh3LHUX6re5b3GTIAyTE1qwJS/yWv9K/ofgehbIt6lllMjySwTz63AiWYEQ3xcqE= rileysnyder@Riley Snyder
@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: |-